update default capability for analytics report to view_woocommerce_reports
This commit is contained in:
parent
54a09ab232
commit
e9aa903fc6
|
@ -20,14 +20,16 @@ if ( ! function_exists( 'wc_admin_register_page' ) ) {
|
|||
*/
|
||||
function wc_admin_register_page( $options ) {
|
||||
$defaults = array(
|
||||
'parent' => '/analytics',
|
||||
'parent' => '/analytics',
|
||||
'capability' => 'view_woocommerce_reports',
|
||||
);
|
||||
$options = wp_parse_args( $options, $defaults );
|
||||
|
||||
add_submenu_page(
|
||||
'/' === $options['parent'][0] ? "wc-admin#{$options['parent']}" : $options['parent'],
|
||||
$options['title'],
|
||||
$options['title'],
|
||||
'manage_options',
|
||||
$options['capability'],
|
||||
"wc-admin#{$options['path']}",
|
||||
array( 'WC_Admin_Loader', 'page_wrapper' )
|
||||
);
|
||||
|
@ -171,11 +173,12 @@ class WC_Admin_Loader {
|
|||
$menu_title = __( 'Dashboard', 'woocommerce-admin' );
|
||||
}
|
||||
|
||||
$analytics_cap = apply_filters( 'woocommerce_admin_analytics_menu_capability', 'view_woocommerce_reports' );
|
||||
add_submenu_page(
|
||||
'woocommerce',
|
||||
$page_title,
|
||||
$menu_title,
|
||||
'manage_options',
|
||||
$analytics_cap,
|
||||
'wc-admin',
|
||||
array( 'WC_Admin_Loader', 'page_wrapper' )
|
||||
);
|
||||
|
|
|
@ -76,7 +76,7 @@ class WC_Admin_Analytics {
|
|||
add_menu_page(
|
||||
__( 'WooCommerce Analytics', 'woocommerce-admin' ),
|
||||
__( 'Analytics', 'woocommerce-admin' ),
|
||||
'manage_options',
|
||||
'view_woocommerce_reports',
|
||||
'wc-admin#/analytics/revenue',
|
||||
array( 'WC_Admin_Loader', 'page_wrapper' ),
|
||||
'dashicons-chart-bar',
|
||||
|
|
Loading…
Reference in New Issue