Custom Bulk Actions handler not firing

Hi first fix your condition if ( $action !== ‘out_of_stock’ || $action !== ‘in_stock’) { this condition will always run because your action is in contrast with “out_of_stock” or “in_stock”. So I think if you change the condition from OR to AND it will work. Then find out if the screen id is the one … Read more

woocommerce add a new bulk action in the bulk actions dropdown in the orders list

As LoicTheAztec commented, the post here Using custom bulk actions on admin orders list in Woocommerce 3 helped me to make the code for my plugin. Although it mentions that you should use the functions.php to make it work, I was able to implement it perfectly in my own plugin code. Thanks, Loic. I appreciate … Read more

How to get inserted row IDs for bulk/batch insert with wpdb query?

As described here: If you insert multiple rows using a single INSERT statement, LAST_INSERT_ID() returns the value generated for the first inserted row only. The reason for this is to make it possible to reproduce easily the same INSERT statement against some other server. So if you need every inserted ID you should use single … Read more

Bulk updating a group of WordPress Pages every 10 minutes

I will recommend to not use wp cron since will require someone to visit the website. Read more here about cron jobs. In case you want with wp-cron here is what you need: Create 10 minutes interval in your schedules if you dont have one. add_filter( ‘cron_schedules’, function ( $schedules ) { $schedules[‘every_ten_minutes’] = array( … Read more

How to change my 3000 Published post status to Draft using PHPMyAdmin

If you have access to phpMyAdmin you can run this SQL query directly: UPDATE {prefix}posts SET post_status=”draft” WHERE post_status=”publish” If you do not have any experience with SQL queries then you should use this solution. Just place this code in functions.php and refresh the WordPress once, and it will be done. function setPostsToDraft() { global … Read more