WordPress.org

Taiwan 正體中文

  • 佈景主題目錄
  • 外掛目錄
  • 最新消息
  • 技術支援
  • 關於我們
  • 團隊
  • 取得 WordPress
取得 WordPress
WordPress.org

Plugin Directory

Wrapping ShortCode

  • 提交外掛
  • 我的最愛
  • 登入
  • 提交外掛
  • 我的最愛
  • 登入

這個外掛並未在最新的 3 個 WordPress 主要版本上進行測試。開發者可能不再對這個外掛進行維護或提供技術支援,並可能會與更新版本的 WordPress 產生使用上的相容性問題。

Wrapping ShortCode

由 Asumaru 開發
下載
  • 詳細資料
  • 使用者評論
  • 安裝方式
  • 開發資訊
技術支援

外掛說明

Are you using shortcodes?
There is also a standard shortcode block in the default block editor.
But it can’t be used without writing code.
Also, you can’t enclose other blocks in shortcodes, so you have to write the HTML code.

This plugin provides a shortcode block. It is not just a shortcode, it is a shortcode block that wraps other blocks.

** Easy configuration **

This is available by simply selecting a shortcode that you have enabled in WordPress.
Shortcode arguments are also configurable.
These are configurable in the block editor sidebar.
Also, the selected shortcode name is displayed in the block on the editor.

** Nestable blocks **

This block can place blocks such as “paragraph” and “image”.
This blocks can also be nested.
For example, it is possible to repeat headings and paragraphs in combination with shortcodes that can list custom fields.

This block can set a “Comment Label”.
Write the specified HTML comment out before and after this block.
Useful for design adjustments.
If you don’t set it, it won’t be written in the HTML source.

** replacement keyword **

This block has some replacement keywords.
Keywords are used to display shortcode information.
For example, if you enter “%shortcode%” in the Additional CSS class, the selected shortcode name will be displayed in the CSS class.

This block itself does not output HTML tags.
Please use it together with “Group” block.

This plugin includes “commentout” and “meta-loop” as sample shortcodes.

There are many other shortcodes in the world.
Take advantage of useful shortcode assets in this block.

Usage

Child blocks

Child blocks are optional.
Child blocks can be placed inside the block.
It is also possible to use dynamic blocks.
The “Wrapping ShortCode” itself is also available for child blocks.
It is possible to use replacement keywords within child blocks.
“Wrapping ShortCode” itself has no HTML tags.
Use with “Group” block

ShortCode

List valid shortcodes within your WordPress site.
Select the shortcode you want to use.

*In the Pro version (paid), a shortcode filtering function is under development.

Arguments

Arguments are optional.
Arguments can be set for the specified shortcode.
It is okay to mix unkeyed and keyed arguments.
It also supports the presence or absence of double quotes.
It is possible to use replacement keywords in arguments.

Commnet labels

Commnet labels are optional.
Write the specified HTML comment out before and after this block.
If you don’t set it, it won’t be written in the HTML source.
It is possible to use replacement keywords in comment labels.

Additional CSS Classes

Additional CSS classes are standard items.
Additional CSS classes are optional.
It is possible to use replacement keywords within additional CSS classes.

Replacement keywords

Replace any of the following replacement keywords in the block with the appropriate values.
However, if the shortcodes or child blocks is nested, the replacement keyword will take precedence over the shortcodes or child blocks.
* %shortcode%: Selected shortcode name
* %shortcodeAttrs%: Arguments of the set shortcode
* %shortcodeStr%: Generated shortcode string
* %wscClass%: Additional CSS class

Shortcode: commentout

Overview

[commentout (arguments) ]comment here[/commentout]

Writes the contents of the shortcode as HTML comments out.

Arguments

  • trim_br: Remove < br > before and after content. Default “yes”
  • do_trim: Remove whitespace before and after content. Default “no”
  • do_shortcode: Run a content shortcode. Default “yes”
  • esc_html: Escape HTML tags in content. Default “yes”

Shortcode: meta-loop

Overview

[meta-loop (arguments) ]template HTML[/meta-loop]

Template and repeat the content of her shortcode by listing the custom field keys for the post.

eg. [meta-loop sample1 sample2 sample3 order=random]

#%number%) %key%:%value%

[/meta-loop]

Arguments

  • (meta key): The key of the custom field to output. Multiple allowed. Sequential number if omitted.
  • start: Output start position. 0 at the beginning. Default “0”
  • end: Output end position. Number of keys if null. Default “null”
  • step: position increment/decrement value. Default “1”
  • lines: Number of outputs. Default “null”. null is output until the end. 0 is hidden.
  • order: direction of sorting. default “none”
    ** none: no sorting.
    ** asc: Order sort.
    ** desc: Reverse sort.
    ** random: Random.
  • orderby: what to sort
    ** counter: output position
    ** metakey: the key of the custom field
    ** metavalue: custom field value
  • replaceNumber: Replacement keyword for output order. Default “%number%”
  • replaceCounter: replacement keyword for output position. Default “%counter%”
  • repkaceKey: Replacement keyword for the key of custom field. Default “%key%”
  • repkaceValue: Replacement keyword for custom field value. Default “%value%”
  • noContent: Alternate content if no template is specified.
  • nl2br: Whether to convert BR tags when there is a newline in the custom field value. Default “yes”.

Alternate content

< div class=”no-%number%”>%key%:%value%

replacement keyword

  • %counter%: Repeated number starting from 0
  • %number%: Repeated number starting from 1
  • %key%: the key of the custom field
  • %value%: custom field value

螢幕擷圖

  • Block icon in the block editor
  • “Wrapping ShortCode” block immediately after placement
  • Place “headings” and “paragraphs” in child blocks
  • Select “Shortcode” and set “Arguments”
  • Describe each content of the child block
  • Add “sample1”, “sample2” and “sample3” to custom fields
  • Output result
  • HTML source

適用於區塊編輯器

這個外掛提供 1 個可供 Gutenberg/區塊編輯器使用的區塊。

  • Wrapping ShortCode This plugin provides a shortcode block. It is not just a shortcode, it is a shortcode block that wraps other blocks.

安裝方式

  1. Upload the plugin files to the /wp-content/plugins/asm-wrapping-shortcode-block directory, or install the plugin through the WordPress plugins screen directly.
  2. Activate the plugin through the ‘Plugins’ screen in WordPress
  3. Edit a post or page, select Block Editor and add a “Wrapping ShortCode” block.
  4. Select the block and set “Shortcode” and “Arguments” from “Settings”.
  5. Place some blocks inside the block.

常見問題集

What happens if I don’t specify a shortcode?

The blocks placed within the block will be displayed.

What happens if you don’t set the arguments?

Arguments are optional.
Follow the shortcode you specify.

What happens if there are no child blocks?

Child blocks are optional.
nothing happens

What is the icon?

It is a Japanese food “Onigiri”(rice ball).

Why is the icon “Onigiri”?

Onigiri is often wrapped in seaweed.
The “rice” inside is the child blocks.
The “seaweed” that he wraps around is likened to the shortcode.

Do you support unkeyed and keyed arguments?

It is okay to mix unkeyed and keyed arguments.
They are processed separately internally.
It also supports the presence or absence of double quotes.

Can replacement keywords be used in arguments, comment labels, and additional CSS classes?

Yes.
However, if you nest this block, the replacement keyword takes precedence over the child blocks.

使用者評論

這個外掛目前沒有任何使用者評論。

參與者及開發者

以下人員參與了開源軟體〈Wrapping ShortCode〉的開發相關工作。

參與者
  • Asumaru

〈Wrapping ShortCode〉外掛目前已有 1 個本地化語言版本。 感謝全部譯者為這個外掛做出的貢獻。

將〈Wrapping ShortCode〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄。

變更記錄

0.1.0

  • Release

中繼資料

  • 版本 0.1.0
  • 最後更新 3 年前
  • 啟用安裝數 少於 10 次
  • WordPress 版本需求 5.9 或更新版本
  • 已測試相容的 WordPress 版本 6.1.7
  • PHP 版本需求 7.4 或更新版本
  • 語言

    English (US) 及 Japanese.

    將這個外掛本地化為你的母語版本

  • 標籤
    blockgrouppostmetashortcode
  • 進階檢視

評分

這個項目尚無任何評論記錄。

新增使用者評論

查看全部使用者評論

參與者

  • Asumaru

技術支援

使用者可在技術支援論壇提出意見反應或使用問題。

檢視技術支援論壇

贊助

想要支援這個外掛的發展嗎?

贊助這個外掛

  • 關於我們
  • 最新消息
  • 主機代管
  • 隱私權
  • 展示網站
  • 佈景主題目錄
  • 外掛目錄
  • 區塊版面配置目錄
  • Learn
  • 技術支援
  • 開發者資源
  • WordPress.tv ↗
  • 共同參與
  • 活動
  • 贊助基金會 ↗
  • Five for the Future
  • WordPress.com ↗
  • Matt ↗
  • bbPress ↗
  • BuddyPress ↗
WordPress.org
WordPress.org

Taiwan 正體中文

  • 查看我們的 X (之前的 Twitter) 帳號
  • Visit our Bluesky account
  • 造訪我們的 Mastodon 帳號
  • Visit our Threads account
  • 造訪我們的 Facebook 粉絲專頁
  • Visit our Instagram account
  • Visit our LinkedIn account
  • Visit our TikTok account
  • Visit our YouTube channel
  • Visit our Tumblr account
程式碼,如詩