Use settings tabs filter to get setting pages for nav (https://github.com/woocommerce/woocommerce-admin/pull/6116)

This commit is contained in:
Joshua T Flowers 2021-01-22 14:54:34 -05:00 committed by GitHub
parent 592a4f2491
commit dfcca3385e
1 changed files with 2 additions and 6 deletions

View File

@ -42,15 +42,11 @@ class CoreMenu {
* Add registered admin settings as menu items.
*/
public static function get_setting_items() {
$setting_pages = \WC_Admin_Settings::get_settings_pages();
$settings = array();
foreach ( $setting_pages as $setting_page ) {
$settings = $setting_page->add_settings_page( $settings );
}
$tabs = apply_filters( 'woocommerce_settings_tabs_array', array() );
$menu_items = array();
$order = 0;
foreach ( $settings as $key => $setting ) {
foreach ( $tabs as $key => $setting ) {
$order += 10;
$menu_items[] = (
array(