refact: Use short array syntax

This commit is contained in:
Vlad Olaru 2023-07-12 20:14:24 +03:00
parent e91a72b8a1
commit 36abbfd233
No known key found for this signature in database
1 changed files with 5 additions and 5 deletions

View File

@ -42,7 +42,7 @@ class WcPayWelcomePage {
*/
public function __construct() {
add_action( 'admin_menu', [ $this, 'register_payments_welcome_page' ] );
add_filter( 'woocommerce_admin_shared_settings', array( $this, 'shared_settings' ) );
add_filter( 'woocommerce_admin_shared_settings', [ $this, 'shared_settings' ] );
add_filter( 'woocommerce_admin_allowed_promo_notes', [ $this, 'allowed_promo_notes' ] );
}
@ -98,7 +98,7 @@ class WcPayWelcomePage {
$menu_icon = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI4NTIiIGhlaWdodD0iNjg0Ij48cGF0aCBmaWxsPSIjYTJhYWIyIiBkPSJNODIgODZ2NTEyaDY4NFY4NlptMCA1OThjLTQ4IDAtODQtMzgtODQtODZWODZDLTIgMzggMzQgMCA4MiAwaDY4NGM0OCAwIDg0IDM4IDg0IDg2djUxMmMwIDQ4LTM2IDg2LTg0IDg2em0zODQtNTU2djQ0aDg2djg0SDM4MnY0NGgxMjhjMjQgMCA0MiAxOCA0MiA0MnYxMjhjMCAyNC0xOCA0Mi00MiA0MmgtNDR2NDRoLTg0di00NGgtODZ2LTg0aDE3MHYtNDRIMzM4Yy0yNCAwLTQyLTE4LTQyLTQyVjIxNGMwLTI0IDE4LTQyIDQyLTQyaDQ0di00NHoiLz48L3N2Zz4=';
$menu_data = array(
$menu_data = [
'id' => 'wc-calypso-bridge-payments-welcome-page',
'title' => esc_html__( 'Payments', 'woocommerce' ),
'path' => '/wc-pay-welcome-page',
@ -110,7 +110,7 @@ class WcPayWelcomePage {
'is_top_level' => true,
],
'icon' => $menu_icon,
);
];
wc_admin_register_page( $menu_data );
@ -119,7 +119,7 @@ class WcPayWelcomePage {
// We need to register this menu via add_menu_page so that it doesn't become a child of
// WooCommerce menu.
if ( get_option( 'woocommerce_navigation_enabled', 'no' ) === 'yes' ) {
$menu_with_nav_data = array(
$menu_with_nav_data = [
esc_html__( 'Payments', 'woocommerce' ),
esc_html__( 'Payments', 'woocommerce' ),
'view_woocommerce_reports',
@ -127,7 +127,7 @@ class WcPayWelcomePage {
null,
$menu_icon,
56,
);
];
call_user_func_array( 'add_menu_page', $menu_with_nav_data );
}