HEX
Server: Apache/2.4.65 (Debian)
System: Linux wordpress-7cb4c6b6f6-qgbk2 5.15.0-131-generic #141-Ubuntu SMP Fri Jan 10 21:18:28 UTC 2025 x86_64
User: www-data (33)
PHP: 8.3.27
Disabled: NONE
Upload Files
File: /var/www/html/wp-content/plugins/jet-menu/integration/plugins/woocommerce/functions.php
<?php
/**
 * Jet Woo compatibility
 */
/**
 * Fix for nonce user logged out
 */
add_action( 'init', function() {

	if ( ! is_user_logged_in() ) {
		add_filter( 'nonce_user_logged_out', function ( $uid , $action = -1 ) {

			if ( 'wp_rest' === $action ) {
				return get_current_user_id();
			}

			return $uid;

		}, 99, 2 );
	}
} ) ;

/**
 * Include woo hooks functions for ajax
 */
add_action( 'jet-menu/render/elementor-render/get-content/before', function ( $template_id, $settings ) {

	if ( wp_doing_ajax() || ( defined( 'REST_REQUEST' ) && REST_REQUEST ) ) {
		WC()->frontend_includes();
	}
}, 10, 4 );