Plugin making call incorrectly | WordPress.org

Hello @jonataslessa,

Thank you for reaching out!

Plugin is making call incorrectly.

I can’t see this on my test site, not even one deprecation notice.


Link to image: https://d.pr/i/yx9zm9

Do you need to be on a certain page/directory? It would be great if you could attach a copy of your system status as well. You can find it via WooCommerce > Status. Select “Get system report” and then “Copy for support” (after you scroll down a bit)”. Once done, please paste it here in your reply or via a text-sharing service like https://gist.github.com/.

Look forward to hearing back from you.

I checked here, it was a function I had implemented to disable the pixel events of the “Facebook for WooCommerce” plugin, as I use another plugin for the Pixel, below is what I used, what is the best way to disable the pixel events of the “Facebook for WooCommerce” plugin?

/**
 * This snippet will stop purchase events to fire on thank you page
 **/
add_action( 'woocommerce_init', function () {

	//get all WooCommerce integrations
	$integrations = WC()->integrations->get_integrations();

	//checking if facebook for woocommerce installed?
	if ( isset( $integrations['facebookcommerce'] ) && $integrations['facebookcommerce'] instanceof WC_Facebookcommerce_Integration ) {

		/**
		 * For version < 1.1.0
		 */
		remove_action( 'woocommerce_thankyou', [
			$integrations['facebookcommerce']->events_tracker,
			'inject_gateway_purchase_event'
		], $integrations['facebookcommerce']->events_tracker::FB_PRIORITY_HIGH );

		/**
		 * For version >= 1.1.0
		 */
		remove_action( 'woocommerce_thankyou', [
			$integrations['facebookcommerce']->events_tracker,
			'inject_purchase_event'
		], 40 );
	}else{
		if ( function_exists('facebook_for_woocommerce') ) {
			$event_track = facebook_for_woocommerce()->get_integration()->events_tracker;


			/**
			 * For version >= 1.1.0
			 */
			remove_action( 'woocommerce_thankyou', [
				$event_track,
				'inject_purchase_event'
			], 40 );


			remove_action( 'woocommerce_checkout_update_order_meta', [
				$event_track,
				'inject_purchase_event'
			], 10 );
		}
	}
}, 999 );

Hi there

I checked here, it was a function I had implemented to disable the pixel events of the “Facebook for WooCommerce” plugin, as I use another plugin for the Pixel

Thank you for the update and for sharing the code you’ve used to disable the pixel events.

what is the best way to disable the pixel events of the “Facebook for WooCommerce” plugin?

You can disable pixel events by using a filter provided by the plugin. Here’s a code snippet that you can add to your child theme’s functions.php file. Note that this will disable all pixel events for the “Facebook for WooCommerce” plugin. If you want to disable specific events only, you may need to use a different approach, which could involve custom coding.

Hope this helps.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer