Detect when any plugin is activated or deactivated

There are few solutions. You can use activate_plugin and deactivate_plugin hooks for example. But… As far as I understand you right, you want to get notified whenever list of plugins get changed and not when a plugin is activated or deactivated. So the easiest way will be hooking onto update_option. add_action(‘updated_option’, function( $option_name, $old_value, $value … Read more

Change words on ‘Log in’ and ‘Register’ buttons on Woocommerce

You will need to add the following code to your theme’s functions.php file. If you haven’t already you should create a child theme, so you don’t lose your edits when the theme updates. Update the Log In text function custome_login_btn(){ add_filter(‘gettext’, ‘custome_login_btn_text’, 10, 2); } function custome_login_btn_text($translation, $text){ if (‘Log In’ == $text) { return … Read more

Is it possible to require approval before a page edit is made live?

Unfortunately, WP Core does not support this type of workflow. Plugin requests are considered off-topic here because plugin functionality can change and some plugins don’t last, but I think it would be helpful to the community (and OP) to know that Oasis Workflow satisfies these basic requirements. The downside is, the editors who can’t publish … Read more

How to add css class to a specific set of images?

You can use the get_image_tag_class filter which passes the attachment ID as an argument: apply_filters(‘get_image_tag_class’, string $class, int $id, string $align, string|array $size) So you can use: function my_image_tag_class($class, $id, $align, $size) { // Logic to check your attachment IDs if($some_logic) { $class .= ‘ no-lazy-loaded’; } return $class; } add_filter(‘get_image_tag_class’,’my_image_tag_class’); If you have an … Read more