Getting template_include to work when allow_url_include is off?

Wouldn’t ya know – 10 minutes or less since I asked my question and I’ve discovered the answer. I was attempting to define MY_PLUGIN_TEMPLATES using using plugins_dir_url(), now it looks like this and is working: define( ‘MY_PLUGIN_TEMPLATES’, dirname( __FILE__ ) . ‘/templates’ ); Thanks to mfields for the suggestion of dirname instead of WP_PLUGIN_DIR.

CSV file generation failing

Try this: <?php header(“Content-type: application/csv”); header(‘Content-Disposition: inline; filename=”export.csv”‘); // change this filename include (‘../../../wp-load.php’); // may need to change number of “../” depending upon location global $wpdb; $rows = $wpdb->get_results (“SELECT * FROM {$wpdb->prefix}table_name”); // change the table name echo strtolower(implode(‘,’, array_keys((array)$rows[0]))) . “\r\n”; // fixes an Excel bug if the first column is “ID” … Read more

Adding more text to a post, after it was published

Your best bet is to use the the_content filter hook and add your content to the post “on the fly” for ex: add_filter(‘the_content’,’add_my_extra_content’); function add_my_extra_content($content){ $my_extra = “<h5>this is the extra content</h5>’; //add before post content // return $my_extra.$content; //add after post content return $content.$my_extra.; }

Failed to Open Stream: Permission Denied While Writing to an XML File in a WordPress Plugin

Check folder permissions too. Also See this post http://www.php.net/manual/en/function.fopen.php#105465 – suggests he had to change to absolute from relative to get around error message. Set of debug suggestions here: http://www.wrensoft.com/forum/showthread.php?t=786 1) folder permissions 2) upper/lowercase 3) abs/relative path and finally it turned out to be an extra space somewhere,