CopyPastor

Detecting plagiarism made easy.

Score: 0.8394175171852112; Reported for: String similarity Open both answers

Possible Plagiarism

Plagiarized on 2023-05-29
by Druvi Shah

Original Post

Original - Posted on 2023-01-09
by ethanpil



            
Present in both answers; Present only in the new answer; Present only in the old answer;

//Customize Woocommerce Category Widget to show title of current category function dynamic_product_category_widget($title, $widget_instance, $widget_id) { if ( $widget_id !== 'woocommerce_product_categories' ) return $title; if ( is_product_category() ) { $cat_title = '<p class="widget-title footer-widget">'.single_cat_title()."</p>"; return $cat_title; } elseif ( is_product() ) { $cat = get_the_terms( $product->ID, 'product_cat' ); foreach ($cat as $categoria) { if($categoria->parent == 0){ $topCategory = $categoria; } } return '<p class="widget-title footer-widget">'.$topCategory->name.'</p>'; } return $title; } add_filter ( 'widget_title' , 'dynamic_product_category_widget', 10, 3);
Here you go for 2022!
//Customize Woocommerce Category Widget to show title of current category function dynamic_product_category_widget($title, $widget_instance, $widget_id) { if ( $widget_id !== 'woocommerce_product_categories' ) return $title; if ( is_product_category() ) { $cat_title = '<p class="widget-title footer-widget">'.single_cat_title()."</p>"; return $cat_title; } elseif ( is_product() ) { $cat = get_the_terms( $product->ID, 'product_cat' ); foreach ($cat as $categoria) { if($categoria->parent == 0){ $topCategory = $categoria; } } return '<p class="widget-title footer-widget">'.$topCategory->name.'</p>'; } return $title; } add_filter ( 'widget_title' , 'dynamic_product_category_widget', 10, 3);

        
Present in both answers; Present only in the new answer; Present only in the old answer;