Problem creating cron job wordpress

Here’s the minified reference I use for setting up WordPress cron, which is all from wp_schedule_event() and cron_schedules: Setup Cron // SETUP CRON add_action(‘wp’, ‘myplugin_schedule_cron’); function myplugin_schedule_cron() { if ( !wp_next_scheduled( ‘myplugin_cron’ ) ) wp_schedule_event(time(), ‘daily’, ‘myplugin_cron’); } Cron Function // the CRON hook for firing function add_action(‘myplugin_cron’, ‘myplugin_cron_function’); #add_action(‘wp_head’, ‘myplugin_cron_function’); //test on page load … Read more

Overwriting Core WordPress Functions with Plugins

Not really, no. You can override built-in PHP functions, but not user-defined functions. However, all this function does is define a meta box. Why not define your own? Once you’ve got your own meta box defined and added, you can call remove_meta_box to remove the standard one: remove_meta_box( ‘add-POSTTYPENAME’, ‘nav-menus’, ‘side’); The meta box is … Read more

How to add HTML / Form to an Admin Bar Menu

I just gave this a shot and it seemed to work fine: function wpse_form_in_admin_bar() { global $wp_admin_bar; $wp_admin_bar->add_menu( array( ‘id’ => ‘wpse-form-in-admin-bar’, ‘parent’ => ‘top-secondary’, ‘title’ => ‘<form><input type=”text” /><input type=”submit” /> </form>’ ) ); } add_action( ‘admin_bar_menu’, ‘wpse_form_in_admin_bar’ ); You’ll have to do some work to gussy it up a bit, but it looks … Read more

Headers already sent error with CSV export plugin

Move your download/output code into admin_init hook. This hook is called before anything is output. It should work. <?php /* Plugin Name: Your Site’s Functionality Plugin Description: All of the important functionality of your site belongs in this. Version: 0.1 License: GPL Author: Your Name Author URI: yoururl */ add_action(‘admin_menu’, ‘my_page_export_menu’); add_action(‘admin_init’,’wpse9876_download_csv’); function my_page_export_menu() { … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)