PluginProbe ʕ •ᴥ•ʔ
Everest Forms – Contact Form, Payment Form, Quiz, Survey & Custom Form Builder with AI / 2.0.3
Everest Forms – Contact Form, Payment Form, Quiz, Survey & Custom Form Builder with AI v2.0.3
3.5.2 3.5.1 3.5.0 3.4.8 3.4.7 3.4.6 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.5.1 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.9 1.5.0 1.5.1 1.5.10 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.6.1 1.6.7 1.7.0 1.7.0.1 1.7.0.2 1.7.0.3 1.7.1 1.7.2 1.7.2.1 1.7.2.2 1.7.3 1.7.4 1.7.5 1.7.5.1 1.7.5.2 1.7.6 1.7.7 1.7.7.1 1.7.7.2 1.7.8 1.7.9 1.8.0 1.8.0.1 1.8.1 1.8.2 1.8.2.1 1.8.2.2 1.8.2.3 1.8.3 1.8.4 1.8.5 1.8.6 1.8.7 1.8.8 1.8.9 1.9.0 1.9.0.1 1.9.1 1.9.2 1.9.3 1.9.4 1.9.4.1 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.0.1 2.0.1 2.0.2 2.0.3 2.0.3.1 2.0.4 2.0.4.1 2.0.5 2.0.6 2.0.7 2.0.8 2.0.8.1 2.0.9 3.0.0 3.0.0.1 3.0.1 3.0.2 3.0.3 3.0.3.1 3.0.4 3.0.4.1 3.0.4.2 3.0.5 3.0.5.1 3.0.5.2 3.0.6 3.0.6.1 3.0.7.1 3.0.8 3.0.8.1 3.0.9 3.0.9.1 3.0.9.2 3.0.9.3 3.0.9.4 3.0.9.5 3.1.0 3.1.1 3.1.2 3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.3.0 3.4.0 3.4.1 3.4.2 3.4.2.1 3.4.3 3.4.4 3.4.5 trunk 1.0 1.0.1 1.0.2 1.0.3
everest-forms / includes / admin / settings / class-evf-settings-page.php
everest-forms / includes / admin / settings Last commit date
class-evf-settings-email.php 3 years ago class-evf-settings-general.php 5 years ago class-evf-settings-integrations.php 6 years ago class-evf-settings-misc.php 2 years ago class-evf-settings-page.php 7 years ago class-evf-settings-recaptcha.php 2 years ago class-evf-settings-validation.php 6 years ago
class-evf-settings-page.php
139 lines
1 <?php
2 /**
3 * EverestForms Settings Page/Tab
4 *
5 * @package EverestForms\Admin
6 * @version 1.0.0
7 */
8
9 defined( 'ABSPATH' ) || exit;
10
11 if ( ! class_exists( 'EVF_Settings_Page', false ) ) :
12
13 /**
14 * EVF_Settings_Page.
15 */
16 abstract class EVF_Settings_Page {
17
18 /**
19 * Setting page id.
20 *
21 * @var string
22 */
23 protected $id = '';
24
25 /**
26 * Setting page label.
27 *
28 * @var string
29 */
30 protected $label = '';
31
32 /**
33 * Constructor.
34 */
35 public function __construct() {
36 add_filter( 'everest_forms_settings_tabs_array', array( $this, 'add_settings_page' ), 20 );
37 add_action( 'everest_forms_sections_' . $this->id, array( $this, 'output_sections' ) );
38 add_action( 'everest_forms_settings_' . $this->id, array( $this, 'output' ) );
39 add_action( 'everest_forms_settings_save_' . $this->id, array( $this, 'save' ) );
40 }
41
42 /**
43 * Get settings page ID.
44 *
45 * @since 1.2.0
46 * @return string
47 */
48 public function get_id() {
49 return $this->id;
50 }
51
52 /**
53 * Get settings page label.
54 *
55 * @since 1.2.0
56 * @return string
57 */
58 public function get_label() {
59 return $this->label;
60 }
61
62 /**
63 * Add this page to settings.
64 *
65 * @param array $pages Setting pages.
66 * @return mixed
67 */
68 public function add_settings_page( $pages ) {
69 $pages[ $this->id ] = $this->label;
70
71 return $pages;
72 }
73
74 /**
75 * Get settings array.
76 *
77 * @return array
78 */
79 public function get_settings() {
80 return apply_filters( 'everest_forms_get_settings_' . $this->id, array() );
81 }
82
83 /**
84 * Get sections.
85 *
86 * @return array
87 */
88 public function get_sections() {
89 return apply_filters( 'everest_forms_get_sections_' . $this->id, array() );
90 }
91
92 /**
93 * Output sections.
94 */
95 public function output_sections() {
96 global $current_section;
97
98 $sections = $this->get_sections();
99
100 if ( empty( $sections ) || 1 === count( $sections ) ) {
101 return;
102 }
103
104 echo '<ul class="subsubsub">';
105
106 $array_keys = array_keys( $sections );
107
108 foreach ( $sections as $id => $label ) {
109 echo '<li><a href="' . esc_url( admin_url( 'admin.php?page=evf-settings&tab=' . $this->id . '&section=' . sanitize_title( $id ) ) ) . '" class="' . ( $current_section === $id ? 'current' : '' ) . '">' . esc_html( $label ) . '</a> ' . ( end( $array_keys ) === $id ? '' : '|' ) . ' </li>';
110 }
111 echo '</ul><br class="clear" />';
112 }
113
114 /**
115 * Output the settings.
116 */
117 public function output() {
118 $settings = $this->get_settings();
119
120 EVF_Admin_Settings::output_fields( $settings );
121 }
122
123 /**
124 * Save settings.
125 */
126 public function save() {
127 global $current_section;
128
129 $settings = $this->get_settings();
130 EVF_Admin_Settings::save_fields( $settings );
131
132 if ( $current_section ) {
133 do_action( 'everest_forms_update_options_' . $this->id . '_' . $current_section );
134 }
135 }
136 }
137
138 endif;
139