Cron jobs in wordpress

I would remove backupbuddy and just not use it at all. You don’t need it. You can create a cron job for different types of backups, whether database, your files, etc. To list current cron jobs on your server, the command is crontab -l and set up a new cron job, its crontab -e. Setting … Read more

Restrict role to use a plugin

Your current code disables plugins for logged in users with contributor capabilities on non-admin pages. The is_admin() function checks if the current page is “/wp-admin” page, to disable plugins just on the admin pages change this condition to: if ( current_user_can( ‘contributor’ ) && is_admin() ) { But to make this code work you need … Read more

How to get bulk actions handler to display simple “Hello World”?

The user is redirected away after the bulk action is performed, so any output will be on the page you’re quick redirected away from. For example, if you’re bulk eiditng pages, you’ll start on a URL like: http://example.com/wp-admin/edit.php?post_type=page&paged=1 Then you perform a bulk action. Once it’s done you’ll end up on: http://example.com/wp-admin/edit.php?post_type=page&paged=1 The same page, … Read more

Many to many relationship for variable products

a. If your fine with a plugin dependency, ACF has this kind of functionality built in with the “Relationship” field. Relationship: https://www.advancedcustomfields.com/resources/relationship/ Reverse Query: https://www.advancedcustomfields.com/resources/querying-relationship-fields/ b. If you want to do this with just WP core, you would use custom fields. First, on the child product, store the IDs of the product pages it should … Read more