[yith_compare_button] shortcode not rendering
-
The above is a staging site as the upgrade of free version YITH WooCommerce Compare plugin from 2.48.0 to 3.2.0 has broken the compare button. [yith_compare_button] displays instead of the compare button (compare live site: https://practicalbathing.co.uk/product-category/walk-in-baths/)
I have taken on the site recently and asked to update WP and plugins. The site has a bespoke theme which was written at least 5 years ago.
In the theme inc folder there is a file called extras.php withfunction practical_compare_and_wishlist_tab( ) {
ob_start(); //$yith_compare = new YITH_Woocompare_Frontend(); //add_shortcode( 'yith_compare_button', array( $yith_compare , 'compare_button_sc' ) ); echo ' <ul> <li>'.do_shortcode('[yith_compare_button]').'</li> <li>'.do_shortcode('[yith_wcwl_add_to_wishlist]').'</li> </ul>'; $content=ob_get_contents(); ob_end_clean(); echo $content;};
add_action( ‘woocommerce_after_add_to_cart_button’, ‘practical_compare_and_wishlist_tab’, 100, 0 );
BTW as a test I ativated WP 2025 theme and the compare button works so I know this is theme related.
Do you have any clues as to what has changed between version 2.48.0 and 3.2.0 that would cause the shortcode not to work?
This is the error message in the error log:
E_USER_NOTICE: Function do_shortcode_tag was called incorrectly. Attempting to parse a shortcode without a valid callback: yith_compare_button Please see Debugging in WordPress for more information. (This message was added in version 4.3.0.) in /mnt/BLOCKSTORAGE/home/1101307.cloudwaysapps.com/gghcuutkcq/public_html/wp-includes/functions.php on line 6121The page I need help with: [log in to see the link]
The topic ‘[yith_compare_button] shortcode not rendering’ is closed to new replies.