Remove typecasting to prevent fatal when $screen_id is null. (#34734)
This commit is contained in:
parent
0b62bf85bd
commit
c08551cd13
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: fix
|
||||
|
||||
Remove typecasting to prevent fatal when $screen_id is null.
|
|
@ -305,7 +305,7 @@ if ( ! class_exists( 'WC_Admin_Assets', false ) ) :
|
|||
)
|
||||
);
|
||||
}
|
||||
if ( in_array( str_replace( 'edit-', '', $screen_id ), array( 'shop_coupon', 'product' ) ) || $this->is_order_meta_box_screen( $screen_id ) ) {
|
||||
if ( in_array( str_replace( 'edit-', '', $screen_id ), array( 'shop_coupon', 'product' ), true ) || $this->is_order_meta_box_screen( $screen_id ) ) {
|
||||
$post_id = isset( $post->ID ) ? $post->ID : '';
|
||||
$currency = '';
|
||||
$remove_item_notice = __( 'Are you sure you want to remove the selected items?', 'woocommerce' );
|
||||
|
@ -507,8 +507,8 @@ if ( ! class_exists( 'WC_Admin_Assets', false ) ) :
|
|||
*
|
||||
* @return bool Whether the current screen is an order edit screen.
|
||||
*/
|
||||
private function is_order_meta_box_screen( string $screen_id ) {
|
||||
return in_array( str_replace( 'edit-', '', $screen_id ), wc_get_order_types( 'order-meta-boxes' ) ) ||
|
||||
private function is_order_meta_box_screen( $screen_id ) {
|
||||
return in_array( str_replace( 'edit-', '', $screen_id ), wc_get_order_types( 'order-meta-boxes' ), true ) ||
|
||||
wc_get_page_screen_id( 'shop-order' ) === $screen_id;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue