render_block

過濾鉤子
apply_filters( 'render_block', $block_content, $this->parsed_block, $this )
引數
  • (string) $block_content The block content.
    Required:
  • (array) $block The full block, including name and attributes.
    Required:
  • (WP_Block) $instance The block instance.
    Required:
定義位置
相關勾子
pre_render_blockrender_block_datarender_block_contextrender_block_this-namerespond_link
相關方法
render_blockrender_block_core_rssrender_block_core_filerender_block_core_blockrender_block_core_coverrender_block_core_image
引入
5.9.0
棄用
-

render_block: 這個過濾鉤子用於過濾一個塊的渲染的HTML內容。該鉤子為開發者提供了修改塊的輸出的許可權,如新增自定義類,改變HTML結構,或新增額外的內容。

過濾單個區塊的內容。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$block_content = apply_filters( 'render_block', $block_content, $this->parsed_block, $this );
$block_content = apply_filters( 'render_block', $block_content, $this->parsed_block, $this );
$block_content = apply_filters( 'render_block', $block_content, $this->parsed_block, $this );

常見問題

FAQs
檢視更多 >