render_block_{$this->name}

過濾鉤子
apply_filters( "render_block_{$this->name}", $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:
定義位置
相關勾子
render_block_datarender_block_contextrender_blockpre_render_blockwidget_block_dynamic_classname
相關方法
render_blockrender_block_core_archivesrender_block_core_rssrender_block_core_home_linkrender_block_core_comment_author_namerender_block_core_file
引入
5.9.0
棄用
-

render_block_{$this->name}: 這個過濾鉤子用於過濾特定塊的渲染的HTML內容。該鉤子專門針對一個特定的塊,$this->name引數代表該塊的名稱。這個鉤子可以用來修改一個特定塊的輸出。

鉤子名稱的動態部分,$name,是指塊的名稱,例如”core/paragraph”。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$block_content = apply_filters( "render_block_{$this->name}", $block_content, $this->parsed_block, $this );
$block_content = apply_filters( "render_block_{$this->name}", $block_content, $this->parsed_block, $this );
$block_content = apply_filters( "render_block_{$this->name}", $block_content, $this->parsed_block, $this );

常見問題

FAQs
檢視更多 >