unescape_invalid_shortcodes

函式
unescape_invalid_shortcodes ( $content )
引數
  • (string) $content Content to search for placeholders.
    Required:
返回值
  • (string) Content with placeholders removed.
定義位置
相關方法
wp_video_shortcoderemove_all_shortcodesapply_shortcodesimg_caption_shortcodewp_playlist_shortcode
引入
4.2.3
棄用
-

unescape_invalid_shortcodes: 這個函式從一個給定的內容字串中刪除無效的或不安全的短碼標籤。它需要一個引數,$content,這是要清除的內容。

刪除由do_shortcodes_in_html_tags()新增的佔位符。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function unescape_invalid_shortcodes( $content ) {
// Clean up entire string, avoids re-parsing HTML.
$trans = array(
'[' => '[',
']' => ']',
);
$content = strtr( $content, $trans );
return $content;
}
function unescape_invalid_shortcodes( $content ) { // Clean up entire string, avoids re-parsing HTML. $trans = array( '[' => '[', ']' => ']', ); $content = strtr( $content, $trans ); return $content; }
function unescape_invalid_shortcodes( $content ) {
	// Clean up entire string, avoids re-parsing HTML.
	$trans = array(
		'[' => '[',
		']' => ']',
	);

	$content = strtr( $content, $trans );

	return $content;
}

常見問題

FAQs
檢視更多 >