apply_shortcodes

函式
apply_shortcodes ( $content, $ignore_html = false )
引數
  • (string) $content Content to search for shortcodes.
    Required:
  • (bool) $ignore_html When true, shortcodes inside HTML elements will be skipped. Default false.
    Required:
    Default: false
返回值
  • (string) Content with shortcodes filtered out.
相關
  • do_shortcode()
定義位置
相關方法
gallery_shortcodeadd_shortcodewp_playlist_shortcodehas_shortcodestrip_shortcodes
引入
5.4.0
棄用
-

apply_shortcodes: 這個函式用於解析和執行給定字串中的短程式碼。它需要一個引數,也就是要解析的字串。開發人員可以使用這個函式將動態內容新增到文章、頁面和其他內容型別。

為短程式碼搜尋內容,並通過其鉤子過濾短程式碼。

這個函式是do_shortcode()的一個別名。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function apply_shortcodes( $content, $ignore_html = false ) {
return do_shortcode( $content, $ignore_html );
}
function apply_shortcodes( $content, $ignore_html = false ) { return do_shortcode( $content, $ignore_html ); }
function apply_shortcodes( $content, $ignore_html = false ) {
	return do_shortcode( $content, $ignore_html );
}

常見問題

FAQs
檢視更多 >