WordPress Plugin Development – Headers Already Sent Message

I’m developing WordPress plugins. When I activate my plugin, I’m getting the following message: The plugin generated 293 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin. The plugin is working very well but I don’t know why … Read more

WP function/filter for modifying http headers?

Is there a dedicated WP function, action or filter to use when adding/modifying the HTTP headers? For now I just hook a PHP header() call into the WP ‘init’ hook like this: add_action(‘init’, ‘add_header_xua’); function add_header_xua(){ if(!is_admin()){ header(‘X-UA-Compatible: IE=edge,chrome=1’); } } But is this the correct way to do that? 4 The init action is … Read more

Why won’t wp_mail() let me set the From: header when plain old PHP mail() will?

When I use wp_mail( $to, $subject, $message, $headers ) (with values in place, of course), the email gets sent with a from name and email that isn’t set anywhere I can find (not even in PHP or Apache settings). However, using mail( $to, $subject, $message, $headers ) instead works just fine. What could be happening … Read more