Inserting a class on before_widget if checkbox is checked

I eventually use the following to be able to do it: add_filter(‘dynamic_sidebar_params’, function($params) { global $wp_registered_widgets; $this_widget_id = $params[0][‘widget_id’]; $this_widget = $wp_registered_widgets[$this_widget_id]; $widget_object = $this_widget[‘callback’][0]; $all_settings = get_option($widget_object->option_name); $saved_settings = $all_settings[$params[1][‘number’]]; if ($saved_settings[‘myclass’]) { $classe_to_add = ‘myclass ‘; $classe_to_add = ‘class=” ‘.$classe_to_add; $params[0][‘before_widget’] = str_replace(‘class=”‘,$classe_to_add,$params[0][‘before_widget’]); } return $params; });

Get parent category name when only child category is applied to a product

Check if it works for you… i have modified the loop /Woo Cat product $woo_single_cats = get_the_terms( $post->ID, ‘product_cat’ ); if ( $woo_single_cats && ! is_wp_error( $woo_single_cats ) ) { $woo_single_cat = array(); foreach ( $woo_single_cats as $term ) { $woo_single_cat[$term->term_id] = $term->name; $term_parent_id = $term->parent; $parent_term = get_term($term_parent_id, ‘product_cat’); } $woo_single_cat = apply_filters(‘seopress_titles_product_cat’, $woo_single_cat); … Read more

Action on Custom Post publish

Issue is resolved Updated Code <?php /* Plugin Name: Send Notification CPT Description: Declares a plugin that will create a custom post type to send notifications. Version: 1.0 */ if( ! defined(‘ABSPATH’)) { exit; } // Register Custom Post Type Send Notifiction function create_sendnotifiction_cpt() { $labels = array( ‘name’ => _x( ‘Send Notifiction’, ‘Post Type … Read more