Fix Screen ids when plugin name localised. Closes #3013.

Closes #3016.
This commit is contained in:
Mike Jolley 2013-04-24 14:29:38 +01:00
parent 035050c4c0
commit 3e43a19c30
2 changed files with 5 additions and 3 deletions

View File

@ -398,10 +398,11 @@ function woocommerce_admin_scripts() {
wp_register_script( 'chosen', $woocommerce->plugin_url() . '/assets/js/chosen/chosen.jquery'.$suffix.'.js', array('jquery'), $woocommerce->version ); wp_register_script( 'chosen', $woocommerce->plugin_url() . '/assets/js/chosen/chosen.jquery'.$suffix.'.js', array('jquery'), $woocommerce->version );
// Get admin screen id // Get admin screen id
$screen = get_current_screen(); $screen = get_current_screen();
$wc_screen_id = strtolower( __( 'WooCommerce', 'woocommerce' ) );
// WooCommerce admin pages // WooCommerce admin pages
if ( in_array( $screen->id, apply_filters( 'woocommerce_screen_ids', array( 'toplevel_page_woocommerce', 'woocommerce_page_woocommerce_settings', 'woocommerce_page_woocommerce_reports', 'edit-shop_order', 'edit-shop_coupon', 'shop_coupon', 'shop_order', 'edit-product', 'product' ) ) ) ) { if ( in_array( $screen->id, apply_filters( 'woocommerce_screen_ids', array( 'toplevel_page_' . $wc_screen_id, $wc_screen_id . '_page_woocommerce_settings', $wc_screen_id . '_page_woocommerce_reports', 'toplevel_page_woocommerce', 'woocommerce_page_woocommerce_settings', 'woocommerce_page_woocommerce_reports', 'edit-shop_order', 'edit-shop_coupon', 'shop_coupon', 'shop_order', 'edit-product', 'product' ) ) ) ) {
wp_enqueue_script( 'woocommerce_admin' ); wp_enqueue_script( 'woocommerce_admin' );
wp_enqueue_script( 'farbtastic' ); wp_enqueue_script( 'farbtastic' );
@ -496,7 +497,7 @@ function woocommerce_admin_scripts() {
} }
// Reports pages // Reports pages
if ( $screen->id == apply_filters( 'woocommerce_reports_screen_id', 'woocommerce_page_woocommerce_reports' ) ) { if ( in_array( $screen->id, apply_filters( 'woocommerce_reports_screen_ids', array( $wc_screen_id . '_page_woocommerce_reports', apply_filters( 'woocommerce_reports_screen_id', 'woocommerce_page_woocommerce_reports' ) ) ) ) ) {
wp_enqueue_script( 'jquery-ui-datepicker' ); wp_enqueue_script( 'jquery-ui-datepicker' );
wp_enqueue_script( 'flot', $woocommerce->plugin_url() . '/assets/js/admin/jquery.flot'.$suffix.'.js', 'jquery', '1.0' ); wp_enqueue_script( 'flot', $woocommerce->plugin_url() . '/assets/js/admin/jquery.flot'.$suffix.'.js', 'jquery', '1.0' );

View File

@ -169,6 +169,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
* Tweak - Notices during checkout for admin users if the checkout is mis-configured. * Tweak - Notices during checkout for admin users if the checkout is mis-configured.
* Fix - Disable autocomplete for checkout fields which refresh totals - no events get fired on autocomplete. * Fix - Disable autocomplete for checkout fields which refresh totals - no events get fired on autocomplete.
* Fix - Clear rating transients when editing comments. * Fix - Clear rating transients when editing comments.
* Fix - Screen ids when plugin name localised.
* Localization - Netherlands, Hungarian, Taiwan, Italian, Spanish updates. * Localization - Netherlands, Hungarian, Taiwan, Italian, Spanish updates.
* Other minor fixes and localisation updates. * Other minor fixes and localisation updates.