| @@ -1,8 +1,11 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | 3 | * Class LP_Abstract_Settings |
| 4 | 4 | */ |
| 5 | + | |
| 6 | +use LearnPress\TemplateHooks\Admin\AdminSettingsPage; | |
| 7 | + | |
| 5 | 8 | abstract class LP_Abstract_Settings { |
| 6 | 9 | |
| 7 | 10 | /** |
| 8 | 11 | * LP_Abstract_Settings constructor. |
| @@ -35,15 +38,10 @@ | ||
| 35 | 38 | * |
| 36 | 39 | * @return mixed |
| 37 | 40 | */ |
| 38 | 41 | public function get_admin_field_name( $name ) { |
| 39 | - $items = LP_Admin_Menu::instance()->get_menu_items(); | |
| 40 | - $section = ''; | |
| 41 | - | |
| 42 | - if ( ! empty( $items['settings'] ) ) { | |
| 43 | - $tab = $items['settings']->get_active_tab(); | |
| 44 | - $section = $items['settings']->get_active_section(); | |
| 45 | - } | |
| 42 | + $tab = AdminSettingsPage::instance()->get_active_tab(); | |
| 43 | + $section = AdminSettingsPage::instance()->get_active_section(); | |
| 46 | 44 | |
| 47 | 45 | if ( $tab === 'payments' && $section !== 'general' && ! empty( $name ) ) { |
| 48 | 46 | if ( strpos( $name, '[' ) === 0 ) { |
| 49 | 47 | $name = $section . $name; |