How to know if WP cron is currently running my hook?
How to know if WP cron is currently running my hook?
How to know if WP cron is currently running my hook?
I think I solved this issue. The reason seems to be that I had the following cron related constants set in my wp-config.php file: define( ‘DISABLE_WP_CRON’, false ); define( ‘ALTERNATE_WP_CRON’, true ); Since I am using a docker container here, I added ALTERNATE_WP_CRON and when using this we also need to set DISABLE_WP_CRON to true, … Read more
Is this assumption valid? Or does DISABLE_WP_CRON actually block crons from running, and block plugins from registering new cron events? Yes, setting DISABLE_WP_CRON to true doesn’t actually block WordPress’ crons from running; it just prevents wordpress itself from initiating the events to run when your backend is triggered by a customer viewing your website. I’m … Read more
The WP_DISABLE_CRON constant only removes WP-Cron from loading on the page so it’s no longer triggered by site traffic. You can absolutely hit the wp-cron.php file directly to trigger it. I use https://cron-job.org to ping my private sites at https://dev.example.com/wp-cron.php?doing_wp_cron for example. This is actually recommended in the WordPress handbook: https://developer.wordpress.org/plugins/cron/hooking-wp-cron-into-the-system-task-scheduler/ Editing to add: if … Read more
I think that is the wrong way. What you might consider to to is to create an wp_schedule_event and then run http://www.abc.de/wp-cron.php per cPanel-Cron, that should work and will be a better way in the “idea” of WordPress. -Edit- Create an cron.php (or whatever you would like to call that file) in you plugin. Than … Read more
You can remotely create posts programmatically via XML-RPC e.g. PHP http://www.nickycakes.com/post-to-wordpress-remotely-with-xmlrpc-in-php/ Java http://code.google.com/p/wordpress-java/ Of note, the media library handles image EXIF data etc, it might be more convenient to switch from using posts to just displaying the latest uploaded attachments that do not have a parent post (attachments with a parent post are attached to … Read more
Ok that was pretty easy // Set the CRON for pages wp_schedule_event( current_time( ‘timestamp’ ) + 450, self::FB_CRON_FREQUENCY, self::FB_CRON_PAGES, array( Ai1ec_Facebook_Graph_Object_Collection::FB_PAGE ) ); // Set the CRON for groups wp_schedule_event( current_time( ‘timestamp’ ) + 900, self::FB_CRON_FREQUENCY, self::FB_CRON_GROUPS, array( Ai1ec_Facebook_Graph_Object_Collection::FB_GROUP ) ); // Set the CRON for users wp_schedule_event( current_time( ‘timestamp’ ) + 1350, self::FB_CRON_FREQUENCY, self::FB_CRON_USERS, … Read more
Using mysql queries to delete custom post types based on meta_value
Ohh Sorry, It was my mistake! It was caching problem. Whoever facing such problems, just try to disable Database Cache(of Total Cache) plugin. This caching is now pre-inistalled in all your new wordpress installation.
In your functions.php you can use this. You will have to activate your theme again for it to take effect. You only want to schedule a cron job on activation, not on activation NOT on every page load, which is what the functions.php does, it loads on every page load. This would be betterused in … Read more