WordPress.org

Support

Support » Plugins and Hacks » Echoing Text in Footer via Plugin

Echoing Text in Footer via Plugin

  • On my own blog, I am trying to put together a little plugin that would so some fancy dynamic stuff and then output the the resulting variable via the wp_footer() hook. Essentially, the plugin looks like this:

    function get_my_custom_variable() {
    	// *clip function contents*
    
    	echo $resulting_variable;
    }
    // hook to WordPress footer
    add_action( 'wp_footer', 'get_my_custom_variable', 10 );

    What happens when I activate the plugin is that my blog ceases to load — no errors, no warnings, just a blank page w/ no outputted HTML.

    If I comment out the last add_action() call and simply call the function itself, it works just fine when I access the plugin file directly via my browser. It seems to cause WordPress to choke, however.

    Any tips on how I can debug this? It seems so simple!

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Echoing Text in Footer via Plugin’ is closed to new replies.
Skip to toolbar