Switched matching of screen ID with the untranslated string. (#36854)

This commit is contained in:
Barry Hughes 2023-02-17 13:31:36 -08:00 committed by GitHub
commit 96100062c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 5 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: fix
Screen ID matching switched to untranslated 'woocommerce' strings.

View File

@ -110,7 +110,7 @@ if ( ! class_exists( 'WC_Admin_Assets', false ) ) :
$screen = get_current_screen();
$screen_id = $screen ? $screen->id : '';
$wc_screen_id = sanitize_title( __( 'WooCommerce', 'woocommerce' ) );
$wc_screen_id = 'woocommerce';
$suffix = Constants::is_true( 'SCRIPT_DEBUG' ) ? '' : '.min';
$version = Constants::get_constant( 'WC_VERSION' );

View File

@ -506,7 +506,7 @@ class WC_Helper {
public static function admin_enqueue_scripts() {
$screen = get_current_screen();
$screen_id = $screen ? $screen->id : '';
$wc_screen_id = sanitize_title( __( 'WooCommerce', 'woocommerce' ) );
$wc_screen_id = 'woocommerce';
if ( $wc_screen_id . '_page_wc-addons' === $screen_id && isset( $_GET['section'] ) && 'helper' === $_GET['section'] ) {
wp_enqueue_style( 'woocommerce-helper', WC()->plugin_url() . '/assets/css/helper.css', array(), Constants::get_constant( 'WC_VERSION' ) );
@ -661,7 +661,7 @@ class WC_Helper {
* @param object $screen WP screen object.
*/
public static function current_screen( $screen ) {
$wc_screen_id = sanitize_title( __( 'WooCommerce', 'woocommerce' ) );
$wc_screen_id = 'woocommerce';
if ( $wc_screen_id . '_page_wc-addons' !== $screen->id ) {
return;

View File

@ -18,8 +18,7 @@ if ( ! defined( 'ABSPATH' ) ) {
* @return array
*/
function wc_get_screen_ids() {
$wc_screen_id = sanitize_title( __( 'WooCommerce', 'woocommerce' ) );
$wc_screen_id = 'woocommerce';
$screen_ids = array(
'toplevel_page_' . $wc_screen_id,
$wc_screen_id . '_page_wc-orders',