woocommerce/plugins/woocommerce-beta-tester/plugin.php

30 lines
831 B
PHP
Raw Permalink Normal View History

2021-02-23 05:30:49 +00:00
<?php
add_action( 'admin_menu', function() {
add_management_page(
'WooCommerce Admin Test Helper',
'WCA Test Helper',
'install_plugins',
'woocommerce-admin-test-helper',
function() {
2021-02-23 06:28:11 +00:00
?><div id="woocommerce-admin-test-helper-app-root"></div><?php
2021-02-23 05:30:49 +00:00
}
);
} );
2021-03-01 03:57:53 +00:00
add_action( 'wp_loaded', function() {
require_once __DIR__ . '/vendor/autoload.php';
2021-03-01 03:57:53 +00:00
require( 'api/api.php' );
} );
2022-03-15 14:09:40 +00:00
add_filter( 'woocommerce_admin_get_feature_config', function( $feature_config ) {
$feature_config['beta-tester-slotfill-examples'] = false;
2022-03-15 14:09:40 +00:00
$custom_feature_values = get_option( 'wc_admin_helper_feature_values', array() );
foreach ( $custom_feature_values as $feature => $value ) {
if ( isset( $feature_config[$feature] ) ) {
$feature_config[$feature] = $value;
}
}
return $feature_config;
} );