| 开发者 | npmyj |
|---|---|
| 更新时间 | 2026年11月26日 09:22 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.2 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
assets/js/scratchblocks/LICENSE for the full license text.
/wp-content/plugins/iyo-block-code-renderer-scratch directory, or install the plugin through the WordPress plugins screen directly.scratchblocks class element to your content and write Scratch pseudocode inside it:
when green flag clicked
say [Hello!]
Note: Manually escape < and > characters (e.g. < and >) inside the block.
Note: Use <code> (or <pre>), not <div>. WordPress's wptexturize filter can rewrite plain punctuation such as a hyphen surrounded by spaces (-) into a dash character before the page is sent to the browser, and it only leaves the contents of <pre>, <code>, <kbd>, <style>, <script>, and <tt> tags untouched. If the block is inside a <div>, an operator like - can be silently corrupted, which makes scratchblocks render it as an unrecognized block (shown in red) instead of the intended operator block.Currently English (en) and Japanese (ja) are enabled.
This usually means the character reaching the browser is not a plain ASCII hyphen. WordPress's wptexturize filter can rewrite a hyphen surrounded by spaces into a dash character, and it only skips this rewriting inside <pre>, <code>, <kbd>, <style>, <script>, and <tt> tags. Write your Scratch pseudocode inside a <code class="scratchblocks"> element (or a <pre class="scratchblocks"> element) rather than a <div> to avoid this.
Rendering happens entirely in the visitor's browser via JavaScript; no server-side processing or external requests are made.
Please use the GitHub issue tracker for bug reports and feature requests.
The plugin (and its slug) was renamed from iyo-scratch-blocks ("Iyo Scratch Blocks") to iyo-block-code-renderer-scratch ("Iyo Block Code Renderer for Scratch"). WordPress core's automatic-update mechanism matches plugins by slug, so a copy installed manually under the old slug will not be picked up as an update to this listing. If you installed the old version manually, deactivate and delete it, then install "Iyo Block Code Renderer for Scratch" fresh from the WordPress.org directory (or via the "Add Plugins" screen) to get automatic updates going forward.
Text Domain and Domain Path headers and a languages/ directory with a generated .pot file, enabling translation of the plugin listing via translate.wordpress.org.wp_add_inline_script() instead of a manual footer <script> tag.