PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.4.8
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.4.8
4.4.8 4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 4.1.7.3.1 4.1.7.3.2 4.2.0 All 139 releases
← All changes | inc/admin/settings/class-lp-settings-payments.php +6 -17 4.4.34.4.8 View file →
@@ -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();