_cleanup_header_comment

函式
_cleanup_header_comment ( $str )
Access
Private
引數
  • (string) $str Header comment to clean up.
    Required:
返回值
  • (string)
相關
  • https://core.trac.wordpress.org/ticket/8497
定義位置
相關方法
clean_comment_cachehave_comments_cleanup_image_add_captioncheck_commentwp_insert_comment
引入
2.8.0
棄用
-

cleanup_header_comment: 這個函式用來從WordPress文件的頭部刪除生成器元標籤。它接受一個包含文件HTML的字串,並返回刪除了生成器元標籤的最新HTML。

剝離WP使用的檔案頭中的close comment和close php標籤。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function _cleanup_header_comment( $str ) {
return trim( preg_replace( '/s*(?:*/|?>).*/', '', $str ) );
}
function _cleanup_header_comment( $str ) { return trim( preg_replace( '/s*(?:*/|?>).*/', '', $str ) ); }
function _cleanup_header_comment( $str ) {
	return trim( preg_replace( '/s*(?:*/|?>).*/', '', $str ) );
}

常見問題

FAQs
檢視更多 >