When/where would want to attach other classes to the base class in a WordPress plugin?

It’s hard to answer that without some additional code to accompany it as those aren’t WordPress core functions and could be doing anything really. Based on a previous question, I’ll assume one of the plugins you’re referring to is the LiquidChurch/lqd-messages plugin and I see those methods in the main plugin file. Even if this … Read more

do_action not working in loop

You are calling do_action before adding it. Move add_action up, before HTML part. Second, your action function ltc_generate_input_fields’ expects$fieldsvalue, however yourdo_action` does not pass this parameter, so change it to do_action($section_actions, $fields);

Call a single function on two different methods with hooks

I’m not sure what you’re hoping for, but all you can really do is just move the code from one function into the other. global $post is also not doing anything, so removing that will save you a couple of lines: /** * Register template */ public static function register_styles_templates() { add_filter(‘single_template’, function($single_template) { if … Read more

Adding new divs with custom classes to products on WooCommerce shop page [closed]

Why not edit the template file instead of using hooks? https://github.com/woocommerce/woocommerce/blob/3.8.0/templates/content-product.php This template can be overridden by copying it to yourtheme/woocommerce/content-product.php. A small example <li <?php wc_product_class( ”, $product ); ?>> <div class=”col-md-5 offset-md-1″> <?php /** * Hook: woocommerce_before_shop_loop_item. * * @hooked woocommerce_template_loop_product_link_open – 10 */ do_action( ‘woocommerce_before_shop_loop_item’ ); /** * Hook: woocommerce_before_shop_loop_item_title. * * … Read more

Is it possible to assign a css id to a row in plugins list table?

Updated answer on how to target with JS: since jQuery is included in wp-admin, you can still target the link with the row’s existing data-slug. Example of how to target all the links: jQuery(‘tr[data-slug=”my-plugin-slug”] a’.css(‘color’, ‘green’); (You can inspect the elements to work out a way to target just one specific link, if that’s your … Read more