false, 'all_no_av' => false, ); $script_choice = \Oneacc\AgeCheck::script_choice( $tags, $this->client_id, $this->tobacco_client_id, $this->client_secret, $this->tobacco_client_secret ); wp_enqueue_script( 'one-account-push-api', $this->push_api_script_url, [], false, true ); wp_script_add_data( 'one-account-push-api', 'attributes', array( 'data-ecommerce' => '1' ) ); wp_enqueue_script( 'oneacc-script', "{$this->plugin_url}assets/one-account.js", [ 'jquery', 'one-account-push-api' ], filemtime( "{$this->plugin_path}assets/one-account.js" ), true ); wp_localize_script( 'oneacc-script', 'ajax_object', array( 'ajax_url' => admin_url( 'admin-ajax.php' ) ) ); wp_localize_script( 'oneacc-script', 'one_acc_woo_params', [ 'ajax_url' => admin_url( 'admin-ajax.php' ), 'update_user_status_nonce' => wp_create_nonce( 'update_user_status' ), 'check_user_status_nonce' => wp_create_nonce( 'check_user_status' ), 'update_order_meta_nonce' => wp_create_nonce( 'update_order_meta' ), 'is_user_logged_in' => is_user_logged_in() ? 'true' : 'false', 'current_page' => 'order_received', 'auth_code' => wp_create_nonce( 'auth_code' ), 'client_id' => $script_choice['client_id'], 'client_secret' => $script_choice['client_secret'], 'skip_av' => $script_choice['skip_av'], ] ); } } function admin_enqueue() { wp_enqueue_style( 'oneacc-scriptss', "{$this->plugin_url}assets/one-account.css", array(), filemtime( "{$this->plugin_path}assets/one-account.css" ) ); wp_enqueue_script('oneacc-admins', "{$this->plugin_url}assets/one-admin-account.js", ['jquery'], filemtime("{$this->plugin_path}assets/one-admin-account.js"), true); wp_localize_script('oneacc-admins', 'ajax_object', array('ajax_url' => admin_url('admin-ajax.php'))); } // Replace ID oneacc-script-js removed -js text function custom_script_loader_tag($tag, $handle) { return str_replace("oneacc-script-js", "oneacc-script", $tag); } }