Add check for wp_set_script_translations. (https://github.com/woocommerce/woocommerce-admin/pull/2117)
* Add check for wp_set_script_translations. * Update admin alert to show correct required WooCommerce version. * Few more 3.6 text changes.
This commit is contained in:
parent
867e236c28
commit
2aaf0ee4b5
|
@ -150,8 +150,8 @@ class WC_Admin_Loader {
|
|||
$feature = strtolower( $feature );
|
||||
$file = WC_ADMIN_FEATURES_PATH . $feature . '/class-wc-admin-' . $feature . '.php';
|
||||
if ( file_exists( $file ) ) {
|
||||
require_once( $file );
|
||||
$feature = ucfirst( $feature );
|
||||
require_once $file;
|
||||
$feature = ucfirst( $feature );
|
||||
self::$classes[] = 'WC_Admin_' . $feature;
|
||||
}
|
||||
}
|
||||
|
@ -214,6 +214,10 @@ class WC_Admin_Loader {
|
|||
* Registers all the neccessary scripts and styles to show the admin experience.
|
||||
*/
|
||||
public static function register_scripts() {
|
||||
if ( ! function_exists( 'wp_set_script_translations' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
wp_register_script(
|
||||
'wc-csv',
|
||||
self::get_url( 'csv-export/index.js' ),
|
||||
|
@ -784,7 +788,7 @@ class WC_Admin_Loader {
|
|||
$settings['commentModeration'] = get_option( 'comment_moderation' );
|
||||
// @todo On merge, once plugin images are added to core WooCommerce, `wcAdminAssetUrl` can be retired,
|
||||
// and `wcAssetUrl` can be used in its place throughout the codebase.
|
||||
$settings['wcAdminAssetUrl'] = plugins_url( 'images/', plugin_dir_path( dirname( __FILE__ ) ) . 'woocommerce-admin.php' );
|
||||
$settings['wcAdminAssetUrl'] = plugins_url( 'images/', plugin_dir_path( dirname( __FILE__ ) ) . 'woocommerce-admin.php' );
|
||||
|
||||
if ( ! empty( $preload_data_endpoints ) ) {
|
||||
foreach ( $preload_data_endpoints as $key => $endpoint ) {
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
* Domain Path: /languages
|
||||
* Version: 0.11.0
|
||||
*
|
||||
* WC requires at least: 3.5.0
|
||||
* WC tested up to: 3.5.7
|
||||
* WC requires at least: 3.6.0
|
||||
* WC tested up to: 3.6.2
|
||||
*
|
||||
* @package WC_Admin
|
||||
*/
|
||||
|
@ -79,13 +79,13 @@ function wc_admin_plugins_notice() {
|
|||
if ( $wordpress_includes_gutenberg ) {
|
||||
$message = sprintf(
|
||||
/* translators: URL of WooCommerce plugin */
|
||||
__( 'The WooCommerce Admin feature plugin requires <a href="%s">WooCommerce</a> 3.5 or greater to be installed and active.', 'woocommerce-admin' ),
|
||||
__( 'The WooCommerce Admin feature plugin requires <a href="%s">WooCommerce</a> 3.6 or greater to be installed and active.', 'woocommerce-admin' ),
|
||||
'https://wordpress.org/plugins/woocommerce/'
|
||||
);
|
||||
} else {
|
||||
$message = sprintf(
|
||||
/* translators: 1: URL of WordPress.org, 2: URL of WooCommerce plugin */
|
||||
__( 'The WooCommerce Admin feature plugin requires both <a href="%1$s">WordPress</a> 5.0 or greater and <a href="%2$s">WooCommerce</a> 3.5 or greater to be installed and active.', 'woocommerce-admin' ),
|
||||
__( 'The WooCommerce Admin feature plugin requires both <a href="%1$s">WordPress</a> 5.0 or greater and <a href="%2$s">WooCommerce</a> 3.6 or greater to be installed and active.', 'woocommerce-admin' ),
|
||||
'https://wordpress.org/',
|
||||
'https://wordpress.org/plugins/woocommerce/'
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue