Use integers for add_menu_page priority (https://github.com/woocommerce/woocommerce-admin/pull/8399)
* Use integers for menu page priority In wordpress >= 6.0, the seventh parameter passed to add_menu_page() should be an integer representing menu position. * Add changelog * Fix Analytics & WcPayWelcomePage menu positions
This commit is contained in:
parent
6c474ed5cb
commit
be7e73d484
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: Fix
|
||||
|
||||
Fix invalid parameter passed to add_menu_page() for wordpress >= 6.0. #8399
|
|
@ -186,7 +186,7 @@ class Analytics {
|
|||
'title' => __( 'Analytics', 'woocommerce-admin' ),
|
||||
'path' => '/analytics/overview',
|
||||
'icon' => 'dashicons-chart-bar',
|
||||
'position' => 56, // After WooCommerce & Product menu items.
|
||||
'position' => 57, // After WooCommerce & Product menu items.
|
||||
);
|
||||
|
||||
$report_pages = array(
|
||||
|
|
|
@ -48,7 +48,7 @@ class WcPayWelcomePage {
|
|||
'id' => 'wc-calypso-bridge-payments-welcome-page',
|
||||
'title' => __( 'Payments', 'woocommerce-admin' ),
|
||||
'path' => '/wc-pay-welcome-page',
|
||||
'position' => '55.7',
|
||||
'position' => '56',
|
||||
'nav_args' => [
|
||||
'title' => __( 'WooCommerce Payments', 'woocommerce-admin' ),
|
||||
'is_category' => false,
|
||||
|
@ -72,7 +72,7 @@ class WcPayWelcomePage {
|
|||
'admin.php?page=wc-admin&path=/wc-pay-welcome-page',
|
||||
null,
|
||||
$menu_icon,
|
||||
55.7,
|
||||
56,
|
||||
);
|
||||
|
||||
call_user_func_array( 'add_menu_page', $menu_with_nav_data );
|
||||
|
|
|
@ -440,7 +440,7 @@ class PageController {
|
|||
$options['path'],
|
||||
array( __CLASS__, 'page_wrapper' ),
|
||||
$options['icon'],
|
||||
$options['position']
|
||||
intval( round( $options['position'] ) )
|
||||
);
|
||||
} else {
|
||||
$parent_path = $this->get_path_from_id( $options['parent'] );
|
||||
|
|
Loading…
Reference in New Issue