Coaderhub Reusable Blocks

外掛說明

Coaderhub Reusable Blocks provides a simple way to create and manage reusable content that can be displayed in different areas of a WordPress website.

Create a reusable content block from the WordPress admin and display it using a shortcode or the provided PHP function.

The plugin uses standard WordPress functionality and keeps frontend output simple so your active theme remains in control of the design.

Content block content is processed using WordPress content sanitization before it is stored and displayed.

Arbitrary JavaScript, CSS, or PHP entered into a content block is not executed by the plugin.

Supported iframe content is restricted to approved HTTPS embed providers.

Features

  • Create and manage reusable content blocks
  • Use content blocks with shortcodes
  • Display content blocks with PHP
  • Use block IDs or slugs with shortcodes
  • Categories for organizing content
  • WordPress revisions
  • Featured images
  • Preview content
  • Duplicate content
  • Custom CSS classes
  • Simple admin list with shortcode and ID
  • WordPress permissions and nonce protection
  • REST API support
  • Sanitized content output
  • Restricted HTTPS iframe embeds

Usage

Create a reusable content block from:

Coaderhub Reusable Blocks > Add New Reusable Block

After publishing, you can use the shortcode:

[coaderhub id=”123″]

Replace 123 with the ID of your reusable content block.

You can also use the block slug:

[coaderhub id=”homepage-cta”]

Additional shortcode attributes are available:

[coaderhub id=”123″ plain=”1″]

You can also specify a wrapper element:

[coaderhub id=”123″ wrapper=”section”]

Custom CSS classes can be added:

[coaderhub id=”123″ class=”homepage-cta”]

PHP Usage

Developers can display a reusable content block from their theme or plugin code using the provided PHP function:

echo coaderhub_show_content_block( 123 );

You can also use a slug:

echo coaderhub_show_content_block( ‘homepage-cta’ );

Optional attributes are supported:

echo coaderhub_show_content_block(
123,
array(
‘plain’ => ‘1’,
‘wrapper’ => ‘section’,
‘class’ => ‘homepage-cta’,
)
);

The PHP function is intended to be called from theme or plugin code.

PHP code entered into a content block is not executed by the plugin.

Privacy

Coaderhub Reusable Blocks does not send content or personal data to external services.

Content is stored using the standard WordPress database.

The plugin does not require an external account or third-party service.

螢幕擷圖

安裝方式

  1. Upload the coaderhub-reusable-blocks folder to /wp-content/plugins/.
  2. Activate the plugin from the WordPress Plugins screen.
  3. Open Coaderhub Reusable Blocks from the WordPress admin menu.
  4. Create and publish a reusable content block.
  5. Copy the shortcode and add it where needed.

常見問題集

How do I create a reusable content block?

Go to Coaderhub Reusable Blocks > Add New Reusable Block, add your content, and publish it.

How do I display a reusable content block?

Use:

[coaderhub id=”123″]

Replace 123 with your reusable content block ID.

Can I use a slug?

Yes.

[coaderhub id=”homepage-cta”]

The slug can be used instead of the numeric content block ID.

Can I use PHP?

Developers can display a reusable content block from their theme or plugin code using the provided PHP function:

echo coaderhub_show_content_block( 123 );

PHP code entered into a content block is not executed by the plugin.

Can I organize reusable content blocks?

Yes. You can organize reusable content blocks using categories.

Can I duplicate a reusable content block?

Yes. Use the Duplicate action from the Coaderhub Reusable Blocks list.

Does the plugin change my theme design?

The plugin uses minimal frontend styling and does not attempt to replace your theme’s design. Your active theme or custom CSS can control the appearance of the reusable content.

Does the plugin allow custom JavaScript or PHP code in content blocks?

No. Content blocks are intended for reusable content. The plugin does not provide a mechanism for executing arbitrary PHP or JavaScript code entered into a content block.

Can I add custom CSS to a content block?

The plugin allows custom CSS class names to be assigned to a reusable content block. It does not provide a mechanism for entering and executing arbitrary CSS code.

Can I use iframe embeds?

Supported iframe embeds are sanitized and restricted to approved HTTPS embed providers. Unsupported iframe sources are removed from the content.

使用者評論

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

參與者及開發者

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

參與者

將〈Coaderhub Reusable Blocks〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

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

變更記錄

1.0.1

  • Initial release.
  • Added reusable content block management.
  • Added shortcode support.
  • Added PHP function.
  • Added categories.
  • Added revisions.
  • Added preview and duplicate actions.
  • Added custom CSS classes.
  • Added REST API support.
  • Added content sanitization.
  • Added restricted HTTPS iframe embeds.