| @@ -7,8 +7,9 @@ | ||
| 7 | 7 | * @version 4.0.0 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | 10 | use LearnPress\Helpers\Config; |
| 11 | +use LearnPress\TemplateHooks\Admin\AdminSettingsPage; | |
| 11 | 12 | |
| 12 | 13 | defined( 'ABSPATH' ) || exit; |
| 13 | 14 | |
| 14 | 15 | /** |
| @@ -147,17 +148,11 @@ | ||
| 147 | 148 | * |
| 148 | 149 | * @return mixed |
| 149 | 150 | */ |
| 150 | 151 | public function get_admin_field_name( $name ) { |
| 151 | - $items = LP_Admin_Menu::instance()->get_menu_items(); | |
| 152 | - $tab = ''; | |
| 153 | - $section = ''; | |
| 152 | + $tab = AdminSettingsPage::instance()->get_active_tab(); | |
| 153 | + $section = AdminSettingsPage::instance()->get_active_section(); | |
| 154 | 154 | |
| 155 | - if ( ! empty( $items['settings'] ) ) { | |
| 156 | - $tab = $items['settings']->get_active_tab(); | |
| 157 | - $section = $items['settings']->get_active_section(); | |
| 158 | - } | |
| 159 | - | |
| 160 | 155 | if ( 'payments' === $tab && 'refund' === $section ) { |
| 161 | 156 | if ( empty( $name ) ) { |
| 162 | 157 | $name = md5( microtime( true ) ); |
| 163 | 158 | } |
| @@ -168,17 +163,11 @@ | ||
| 168 | 163 | return parent::get_admin_field_name( $name ); |
| 169 | 164 | } |
| 170 | 165 | |
| 171 | 166 | public function admin_page_settings( $section = null, $tab = null ) { |
| 172 | - $sections = array(); | |
| 173 | - $items = LP_Admin_Menu::instance()->get_menu_items(); | |
| 174 | - | |
| 175 | - if ( ! empty( $items['settings'] ) ) { | |
| 176 | - $tab = $items['settings']->get_active_tab(); | |
| 177 | - $section = $items['settings']->get_active_section(); | |
| 178 | - $sections = $items['settings']->get_sections(); | |
| 179 | - } | |
| 180 | - | |
| 167 | + $tab = AdminSettingsPage::instance()->get_active_tab(); | |
| 168 | + $section = AdminSettingsPage::instance()->get_active_section(); | |
| 169 | + $sections = AdminSettingsPage::instance()->get_sections(); | |
| 181 | 170 | $section_data = ! empty( $sections[ $section ] ) ? $sections[ $section ] : false; |
| 182 | 171 | |
| 183 | 172 | if ( $section_data instanceof LP_Abstract_Settings ) { |
| 184 | 173 | $section_data->admin_option_settings(); |