Title: Plugin is breaking my Carousel
Last modified: May 12, 2020

---

# Plugin is breaking my Carousel

 *  Resolved [arturino](https://wordpress.org/support/users/arturdesign2devcom/)
 * (@arturdesign2devcom)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/plugin-is-breaking-my-carousel/)
 * as you can see in the first carousel, every other image is missing.
    i confirmed
   this when i disabled your code.
 * what can i do to fix this on your code?
    thanks
 * Artur
    -  This topic was modified 6 years, 1 month ago by [arturino](https://wordpress.org/support/users/arturdesign2devcom/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fplugin-is-breaking-my-carousel%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Thread Starter [arturino](https://wordpress.org/support/users/arturdesign2devcom/)
 * (@arturdesign2devcom)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/plugin-is-breaking-my-carousel/#post-12826749)
 * hi i found your issue:
 * I see they append your code to the hook “woocommerce_after_shop_loop_item”.
 * Is there is a way to append your code to a different hook instead, maybe with
   a filter, to avoid this kind of issues.
 * I think that if you appended your code to “woocommerce_after_shop_loop_item_title”
   hook that would fix my and many other’s issue.
 * thanks
 *  Plugin Author [Antonino Scarfì](https://wordpress.org/support/users/antoscarface/)
 * (@antoscarface)
 * [6 years ago](https://wordpress.org/support/topic/plugin-is-breaking-my-carousel/#post-12922091)
 * Hi,
 * that hook actually is necessary appends a `<span data-content_category="%s" style
   ="display:none;"></span>` element, in order to have the `content_category` fulfilled
   in the Add To Cart event. This is the only one method to do that in WooCommerce.
 * If you don’t need that field, you may simply remove the filter as I think you
   already did.
 * Otherwise, could you please reproduce again the error and check in the console
   if there are some JS errors? I need to understand what this issue causes in your
   page
 *  Thread Starter [arturino](https://wordpress.org/support/users/arturdesign2devcom/)
 * (@arturdesign2devcom)
 * [6 years ago](https://wordpress.org/support/topic/plugin-is-breaking-my-carousel/#post-12922204)
 * hi Antonino, i had to hire a developer to make custom add-on plugin to remove
   this filter, so that any future updates of your plugin would not require more
   manual work. thanks for the followup
 *  Plugin Author [Antonino Scarfì](https://wordpress.org/support/users/antoscarface/)
 * (@antoscarface)
 * [6 years ago](https://wordpress.org/support/topic/plugin-is-breaking-my-carousel/#post-12933103)
 * Hi,
 * thanks for confirming this is solved for you! 🙂
 * If you will be able to share the exact solution, I’ll check if I can integrate
   this for all users and have it built-in in the plugin.
 * Thanks.
 *  Thread Starter [arturino](https://wordpress.org/support/users/arturdesign2devcom/)
 * (@arturdesign2devcom)
 * [6 years ago](https://wordpress.org/support/topic/plugin-is-breaking-my-carousel/#post-12933365)
 * `<?php
    /* * Plugin Name: Remove Hook From Pxel Plugin * Description: Remove 
   hook from the pixel plugin * Version: 1.0.0 * Author: Kevin * Requires at least:
   5.0.0 * Tested up to: 5.4.0 * WC requires at least: 3.3.0 * WC tested up to: 
   3.4.4 * Text Domain: remove-hook-from-pixel * Domain Path: /languages/ * License:
   GNU General Public License v3.0 * License URI: [http://www.gnu.org/licenses/gpl-3.0.html](http://www.gnu.org/licenses/gpl-3.0.html)*/
 * function remove_filters_with_method_name( $hook_name = ”, $method_name = ”, $
   priority = 0 ) {
    global $wp_filter;
 *  // Take only filters on right hook name and priority
    if ( ! isset( $wp_filter[
   $hook_name ][ $priority ] ) || ! is_array( $wp_filter[ $hook_name ][ $priority])){
   return false; }
 *  // Loop on filters registered
    foreach ( (array) $wp_filter[ $hook_name ][ $
   priority ] as $unique_id => $filter_array ) { // Test if filter is an array !(
   always for class/method) if ( isset( $filter_array[‘function’] ) && is_array(
   $filter_array[‘function’] ) ) { // Test if object is a class and method is equal
   to param ! if ( is_object( $filter_array[‘function’][0] ) && get_class( $filter_array[‘
   function’][0] ) && $filter_array[‘function’][1] == $method_name ) { // Test for
   WordPress >= 4.7 WP_Hook class ([https://make.wordpress.org/core/2016/09/08/wp_hook-next-generation-actions-and-filters/](https://make.wordpress.org/core/2016/09/08/wp_hook-next-generation-actions-and-filters/))
   if ( is_a( $wp_filter[ $hook_name ], ‘WP_Hook’ ) ) { unset( $wp_filter[ $hook_name]-
   >callbacks[ $priority ][ $unique_id ] ); } else { unset( $wp_filter[ $hook_name][
   $priority ][ $unique_id ] ); } } }
 *  }
 *  return false;
    }
 * /**
    * Allow to remove method for an hook when, it’s a class method used and 
   class don’t have variable, but you know the class name 🙂 */ function remove_filters_for_anonymous_class(
   $hook_name = ”, $class_name = ”, $method_name = ”, $priority = 0 ) { global $
   wp_filter;
 *  // Take only filters on right hook name and priority
    if ( ! isset( $wp_filter[
   $hook_name ][ $priority ] ) || ! is_array( $wp_filter[ $hook_name ][ $priority])){
   return false; }
 *  // Loop on filters registered
    foreach ( (array) $wp_filter[ $hook_name ][ $
   priority ] as $unique_id => $filter_array ) { // Test if filter is an array !(
   always for class/method) if ( isset( $filter_array[‘function’] ) && is_array(
   $filter_array[‘function’] ) ) { // Test if object is a class, class and method
   is equal to param ! if ( is_object( $filter_array[‘function’][0] ) && get_class(
   $filter_array[‘function’][0] ) && get_class( $filter_array[‘function’][0] ) =
   = $class_name && $filter_array[‘function’][1] == $method_name ) {
 *  if ( is_a( $wp_filter[ $hook_name ], ‘WP_Hook’ ) ) {
    unset( $wp_filter[ $hook_name]-
   >callbacks[ $priority ][ $unique_id ] ); } else { unset( $wp_filter[ $hook_name][
   $priority ][ $unique_id ] ); } } }
 *  }
 *  return false;
    }
 * add_action(‘wp_head’, function() {
 *  remove_filters_for_anonymous_class( ‘woocommerce_after_shop_loop_item’, ‘AEPC_Woocommerce_Addon_Support’,‘
   add_content_category_meta’, 99 );
 *  if ( class_exists(‘AEPC_Woocommerce_Addon_Support’) ) {
 *  $object = new AEPC_Woocommerce_Addon_Support();
 *  add_action( ‘woocommerce_after_shop_loop_item_title’, array( $object, ‘add_content_category_meta’),
   99 );
    } });
 *  Plugin Author [Antonino Scarfì](https://wordpress.org/support/users/antoscarface/)
 * (@antoscarface)
 * [6 years ago](https://wordpress.org/support/topic/plugin-is-breaking-my-carousel/#post-12953585)
 * Hi,
 * thanks for sharing your solution. I’ll evaluate if I can move the hook in that`
   woocommerce_after_shop_loop_item_title`.
 * Thanks 🙂
 *  Plugin Author [Antonino Scarfì](https://wordpress.org/support/users/antoscarface/)
 * (@antoscarface)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/plugin-is-breaking-my-carousel/#post-13468659)
 * Hi,
 * the new version with this fix is available, so you won’t need your custom plugin
   anymore 🙂
 * Thank you for reporting this.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Plugin is breaking my Carousel’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/pixel-caffeine_e2ce0c.svg)
 * [Pixel Caffeine](https://wordpress.org/plugins/pixel-caffeine/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/pixel-caffeine/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/pixel-caffeine/)
 * [Active Topics](https://wordpress.org/support/plugin/pixel-caffeine/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/pixel-caffeine/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/pixel-caffeine/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [Antonino Scarfì](https://wordpress.org/support/users/antoscarface/)
 * Last activity: [5 years, 8 months ago](https://wordpress.org/support/topic/plugin-is-breaking-my-carousel/#post-13468659)
 * Status: resolved