我正在使用
add_action(\'the_content\', \'myFunction\', 10)
将数据附加到内容的末尾。如何将内容放在内容的开头?
我正在使用
add_action(\'the_content\', \'myFunction\', 10)
将数据附加到内容的末尾。如何将内容放在内容的开头?
the_content
也是一个过滤器,内容作为参数传递到其中。您只需预先编写内容,然后像这样返回即可。
add_filter(\'the_content\',\'prepend_this\');
function prepend_this($content)
{
$content = "string to prepend" . $content;
return $content
}
我偶然发现this question 在写这个问题的时候。我有一个问题是关于这个问题的。我发现你用的是get_delete_post_link 筛选为我的操作创建一个新的url(或一个类似的函数——在任何情况下,我都会将该函数与布尔值一起使用)。唯一的问题是,I don\'t know how to capture the event now. 考虑到我在谷歌上找不到很多关于行后操作的例子,我将不胜感激-/public function _wp_filter_get_delete_post_link( $