PluginProbe
SimpleTOC – Table of Contents Block / 7.3.1
SimpleTOC – Table of Contents Block v7.3.1
7.3.1 7.2.0 7.3.0 7.1.1 7.1.0 7.0.10 7.0.9 7.0.8 7.0.7 7.0.6 7.0.4 7.0.5 5.0.21.1 5.0.22 5.0.23 5.0.24 5.0.25 5.0.25.1 5.0.27 5.0.28 5.0.29 5.0.3 5.0.30 5.0.31 5.0.32 All 160 releases
← All changes | simpletoc-admin-settings.php +2 -33 7.1.17.3.1 View file →
@@ -47,9 +47,8 @@
47 47 * Register SimpleTOC settings.
48 48 */
49 49 function simpletoc_register_settings() {
50 50 // Register settings and filters for existing features.
51 - $wrapper_enabled_filter = apply_filters( 'simpletoc_wrapper_enabled', null );
52 51 $accordion_enabled_filter = apply_filters( 'simpletoc_accordion_enabled', null );
53 52 $smooth_enabled_filter = apply_filters( 'simpletoc_smooth_enabled', null );
54 53 $absolute_urls_enabled_filter = apply_filters( 'simpletoc_absolute_urls_enabled', null );
55 54 $autoupdate_enabled_filter = apply_filters( 'simpletoc_autoupdate_enabled', null );
@@ -54,12 +53,8 @@
54 53 $absolute_urls_enabled_filter = apply_filters( 'simpletoc_absolute_urls_enabled', null );
55 54 $autoupdate_enabled_filter = apply_filters( 'simpletoc_autoupdate_enabled', null );
56 55 $box_style_enabled_filter = apply_filters( 'simpletoc_box_style_enabled', null );
57 56
58 - if ( null === $wrapper_enabled_filter ) {
59 - register_setting( 'simpletoc_settings', 'simpletoc_wrapper_enabled' );
60 - }
61 -
62 57 if ( null === $accordion_enabled_filter ) {
63 58 register_setting( 'simpletoc_settings', 'simpletoc_accordion_enabled' );
64 59 }
65 60
@@ -95,16 +90,8 @@
95 90 'simpletoc_wrapper_section'
96 91 );
97 92
98 93 add_settings_field(
99 - 'simpletoc_wrapper_enabled',
100 - esc_html__( 'Force wrapper div', 'simpletoc' ),
101 - __NAMESPACE__ . '\simpletoc_wrapper_enabled_callback',
102 - 'simpletoc',
103 - 'simpletoc_wrapper_section'
104 - );
105 -
106 - add_settings_field(
107 94 'simpletoc_smooth_enabled',
108 95 esc_html__( 'Force smooth scrolling', 'simpletoc' ),
109 96 __NAMESPACE__ . '\simpletoc_smooth_enabled_callback',
110 97 'simpletoc',
@@ -152,32 +139,14 @@
152 139 '</p>';
153 140 }
154 141
155 142 /**
156 - * SimpleTOC wrapper enabled callback.
157 - */
158 -function simpletoc_wrapper_enabled_callback() {
159 - $wrapper_enabled = get_option( 'simpletoc_wrapper_enabled', false );
160 -
161 - if ( has_filter( 'simpletoc_wrapper_enabled' ) ) {
162 - echo '<input type="checkbox" name="simpletoc_wrapper_enabled" id="simpletoc_wrapper_enabled" value="1" checked="checked" disabled="disabled" />';
163 - echo '<label for="simpletoc_wrapper_enabled" class="description">' . esc_html__( 'Setting controlled by "simpletoc_wrapper_enabled" filter. Remove filter to adjust setting.', 'simpletoc' ) . '</label>';
164 - } else {
165 - echo '<input type="checkbox" name="simpletoc_wrapper_enabled" id="simpletoc_wrapper_enabled" value="1" ' . checked( 1, $wrapper_enabled, false ) . ' />';
166 - echo '<label for="simpletoc_wrapper_enabled" class="description">' . esc_html__( 'Additionally adds the role "navigation" and ARIA attributes.', 'simpletoc' ) . '</label>';
167 - }
168 -}
169 -
170 -/**
171 143 * SimpleTOC accordion enabled callback.
172 144 */
173 145 function simpletoc_accordion_enabled_callback() {
174 146 $accordion_enabled = get_option( 'simpletoc_accordion_enabled', false );
175 - if ( $accordion_enabled ) {
176 - update_option( 'simpletoc_wrapper_enabled', true );
177 - }
178 147 echo '<input type="checkbox" name="simpletoc_accordion_enabled" id="simpletoc_accordion_enabled" value="1" ' . checked( 1, $accordion_enabled, false ) . ' />';
179 - echo '<label for="simpletoc_accordion_enabled" class="description">' . esc_html__( 'Adds minimal JavaScript and css styles.', 'simpletoc' ) . ' <strong>' . esc_html__( 'Notice:', 'simpletoc' ) . '</strong> ' . esc_html__( 'This will automatically enable the wrapper div.', 'simpletoc' ) . '</label>';
148 + echo '<label for="simpletoc_accordion_enabled" class="description">' . esc_html__( 'Adds minimal JavaScript and css styles.', 'simpletoc' ) . '</label>';
180 149 }
181 150
182 151 /**
183 152 * SimpleTOC smooth enabled callback.
@@ -216,7 +185,7 @@
216 185 echo '<input type="checkbox" name="simpletoc_box_style_enabled" id="simpletoc_box_style_enabled" value="1" checked="checked" disabled="disabled" />';
217 186 echo '<label for="simpletoc_box_style_enabled" class="description">' . esc_html__( 'Setting controlled by "simpletoc_box_style_enabled" filter. Remove filter to adjust setting.', 'simpletoc' ) . '</label>';
218 187 } else {
219 188 echo '<input type="checkbox" name="simpletoc_box_style_enabled" id="simpletoc_box_style_enabled" value="1" ' . checked( 1, $box_style_enabled, false ) . ' />';
220 - echo '<label for="simpletoc_box_style_enabled" class="description">' . esc_html__( 'Enables the box style for all SimpleTOC blocks with the default gray background. Wrapper markup is added automatically.', 'simpletoc' ) . '</label>';
189 + echo '<label for="simpletoc_box_style_enabled" class="description">' . esc_html__( 'Applies the Box style with the default gray background to all SimpleTOC blocks.', 'simpletoc' ) . '</label>';
221 190 }
222 191 }