
內容簡介
MetaShortcode 是一個輕量級的模組,允許使用者使用簡單的短代碼在前端顯示任何自訂(meta)欄位的值。
此模組可以從設定頁面停用。重要提示:此模組預設為停用狀態。如果您保持未選取「啟用」方塊,此外掛將沒有任何影響。
指定格式:[msc custom_field_name]
以上述格式出現的短碼將在文章中顯示儲存在自訂欄位名稱中的值。
替代格式:{msc custom_field_name}
如果需要,在啟用後您可以使用替代短碼格式,將方括號更改為花括號。這樣做可讓您將自訂欄位值作為現有短碼定義內的屬性使用。例如:
錯誤格式:[shortcode name=”example” url=”[msc custom_url_field]”]…[/shortcode]
正確格式:[shortcode name=”example” url=”{msc custom_url_field}”]…[/shortcode]
請注意,除非您有特定需要將短碼嵌套為屬性,否則應將此選項保持停用狀態,以避免額外的內容篩選導致的輕微(且不必要的)性能 degradation。
路線圖
允許自定義短碼識別符
捐贈
不需要任何捐贈。
外掛標籤
開發者團隊
原文外掛簡介
MetaShortcode is a lightweight module that allows users to display the value any custom (meta) field on the front-end using a simple shortcode.
The module can be disabled from the settings page. Important: The module is inactive by default. If you leave the Enabled box unchecked, the plugin will have no effect at all.
Pattern: [msc custom_field_name]
Shortcodes with the pattern above will display the value stored in custom field name in the post.
Alternative pattern: {msc custom_field_name}
An alternative shortcode pattern, which replaces square brackets with curly braces, can be activated if needed. This can be helpful if you need to use a custom field value as an attribute inside an existing shortcode definition. For example:
invalid: [shortcode name=”example” url=”[msc custom_url_field]”]…[/shortcode]
valid: [shortcode name=”example” url=”{msc custom_url_field}”]…[/shortcode]
Note that unless you have a specific need for nesting shortcodes as attributes, you should leave this option disabled in the settings to avoid the slight (and unnecessary) performance degradation that the additional content filter involves.
Roadmap
Allow customizing the shortcode identifier
Donations
None needed.
