我想the_content駐留在/wp-includes/post-template.php從在我的插件我想改變the_content
function the_content($more_link_text = null, $stripteaser = false) {
$content = get_the_content($more_link_text, $stripteaser);
$content = apply_filters('the_content', $content);
$content = str_replace(']]>', ']]>', $content);
echo $content;
}
變成
function the_content($more_link_text = null, $stripteaser = false) {
$content = get_the_content($more_link_text, $stripteaser);
$content = apply_filters('the_content', $content);
echo $content;
}
怎麼辦功能我在我的插件中完成了此操作,但未觸及wordpress代碼(讓我的代碼升級兼容)?我知道某些功能可以被替換,但是這個呢?
我很好奇,是str_replace函數你一個問題嗎?我試圖記住它是什麼... –
是的。我在wp_head中注入了一個google跟蹤標記,並且它包含一個由str_replace函數取代的CDATA結束標記。 – AleV
CDATA和'wp_head'細節應該在問題中。 '
'與'the_content'無關,是嗎? – brasofilo