get_settings(); $theme_supports = $this->get('Settings')->is_theme_supports(); View::get_instance()->render_html('../templates/settings/general', array('settings' => $data, 'theme_supports' => $theme_supports)); } else { wp_die( sprintf( 'Access denied, %s, %s', __FUNCTION__, basename( __FILE__ ) ) ); } } /** * Save settings */ public function action_save() { if ( empty( $_GET['page'] ) || wp_unslash( $_GET['page'] ) !== 'mptt-settings' ) { return; } if ( isset( $_POST['mp-timetable-save-settings'] ) && wp_verify_nonce( sanitize_key( $_POST['mp-timetable-save-settings'] ), 'mp_timetable_nonce_settings') ) { $redirect = Settings::get_instance()->save_settings(); wp_safe_redirect( add_query_arg( array( 'page' => sanitize_key( $_GET['page'] ), 'settings-updated' => 'true' ), admin_url( 'edit.php?post_type=mp-event') ) ); exit; } /** * Show success message */ if ( isset( $_GET['settings-updated'] ) && ( filter_var( $_GET['settings-updated'], FILTER_VALIDATE_BOOLEAN) == TRUE ) ) { add_settings_error('mpTimetableSettings', esc_attr('settings_updated'), __('Settings saved.', 'mp-timetable'), 'updated'); } } }