true, 'strategy' => 'defer', ) ); wp_add_inline_script( 'proofpass-prop65', 'window.proofpassProp65 = ' . wp_json_encode( array( 'base' => ProofPass_Settings::base_url() ) ) . ';', 'before' ); wp_register_script( 'proofpass-variations', PROOFPASS_URL . 'assets/js/variations.js', array( 'jquery' ), PROOFPASS_VERSION, array( 'in_footer' => true ) ); wp_register_script( 'proofpass-generator', PROOFPASS_URL . 'assets/js/generator.js', array(), PROOFPASS_VERSION, array( 'in_footer' => true ) ); } add_action( 'init', 'proofpass_register_assets', 2 ); /** * Declare compatibility with WooCommerce High-Performance Order Storage and the * cart/checkout blocks. Orders are read through the WC_Order API only, never * through post tables; the Prop 65 warning reaches the cart and checkout * blocks as item data through the Store API. */ function proofpass_declare_wc_compatibility() { if ( class_exists( '\Automattic\WooCommerce\Utilities\FeaturesUtil' ) ) { \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', PROOFPASS_FILE, true ); \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'cart_checkout_blocks', PROOFPASS_FILE, true ); } } add_action( 'before_woocommerce_init', 'proofpass_declare_wc_compatibility' ); /** * "Settings" link on the Plugins screen. * * @param array $links Action links. * @return array */ function proofpass_action_links( $links ) { $url = admin_url( 'options-general.php?page=proofpass' ); array_unshift( $links, '' . esc_html__( 'Settings', 'proofpass' ) . '' ); return $links; } add_filter( 'plugin_action_links_' . plugin_basename( PROOFPASS_FILE ), 'proofpass_action_links' ); ProofPass_Upgrade::init(); ProofPass_Settings::init(); ProofPass_API::init(); ProofPass_Shortcodes::init(); ProofPass_Block::init(); ProofPass_REST::init(); ProofPass_WooCommerce::init(); ProofPass_Mapping::init(); ProofPass_Orders::init(); ProofPass_Scan::init(); ProofPass_Onboarding::init(); ProofPass_Health::init(); ProofPass_Builders::init(); if ( defined( 'WP_CLI' ) && WP_CLI ) { require_once PROOFPASS_DIR . 'includes/class-proofpass-cli.php'; WP_CLI::add_command( 'proofpass', 'ProofPass_CLI' ); }