最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

plugin development - Unable to change footer using wp_footer action hook

programmeradmin0浏览0评论

I am learning Wordpress from a book and while learning about how to use action hooks the author gives the below code . I am assuming this would change the footer at the front end .

<?php
function boj_example_footer_message() {
echo 'This site is built using < a href=""
title=”WordPress publishing platform” > WordPress < /a > .';
}
add_action( 'wp_footer', 'boj_example_footer_message', 100 );

?>

To test this out I created a plugin and had the above code put in the main plugin file . However , upon activation I get

"The plugin generated 8 characters of unexpected output during activation. "

What causes this ? What is the correct way to echo to the front end on an action hook ? How to make this work ?

发布评论

评论列表(0)

  1. 暂无评论