PluginProbe
WebberZone Top 10 — Popular Posts / 4.5.2
WebberZone Top 10 — Popular Posts v4.5.2
4.5.2 4.5.1 4.5.0 4.4.3 4.4.2 4.4.1 4.4.0 4.3.4 4.3.3 4.3.2 4.3.1 4.3.0 trunk 1.0 1.0.1 1.1 1.2 1.3 1.4 1.4.1 1.5 1.5.1 1.5.2 1.5.3 1.6 All 118 releases
← All changes | includes/admin/class-settings.php +481 -53 4.3.2 → 4.5.2 View file →
@@ -21,12 +21,13 @@
21 21
22 22 /**
23 23 * Class to register the settings.
24 24 *
25 - * @since 3.3.0
25 + * @since 3.3.0
26 26 */
27 27 class Settings {
28 28
29 +
29 30 /**
30 31 * Settings API.
31 32 *
32 33 * @since 3.3.0
@@ -98,13 +99,14 @@
98 99 * @since 3.3.0
99 100 */
100 101 public function initialise_settings() {
101 102 $props = array(
102 - 'default_tab' => 'general',
103 + 'default_tab' => 'features',
103 104 'help_sidebar' => $this->get_help_sidebar(),
104 105 'help_tabs' => $this->get_help_tabs(),
105 106 'admin_footer_text' => $this->get_admin_footer_text(),
106 107 'menus' => $this->get_menus(),
108 + 'version' => TOP_TEN_VERSION,
107 109 );
108 110
109 111 $args = array(
110 112 'props' => $props,
@@ -131,9 +133,15 @@
131 133 'success_message' => esc_html__( 'Settings updated.', 'top-10' ),
132 134 'save_changes' => esc_html__( 'Save Changes', 'top-10' ),
133 135 'reset_settings' => esc_html__( 'Reset all settings', 'top-10' ),
134 136 'reset_button_confirm' => esc_html__( 'Do you really want to reset all these settings to their default values?', 'top-10' ),
135 - 'checkbox_modified' => esc_html__( 'Modified from default setting', 'top-10' ),
137 + 'modified_field' => esc_html__( 'Modified from default setting', 'top-10' ),
138 + 'modified_legend' => esc_html__( 'Setting modified from its default value', 'top-10' ),
139 + 'default_label' => esc_html__( 'Default', 'top-10' ),
140 + 'default_none' => esc_html__( 'None', 'top-10' ),
141 + 'repeater_move_up' => esc_html__( 'Move item up', 'top-10' ),
142 + 'repeater_move_down' => esc_html__( 'Move item down', 'top-10' ),
143 + 'repeater_remove_item' => esc_html__( 'Remove item', 'top-10' ),
136 144 );
137 145
138 146 /**
139 147 * Filter the array containing the settings' sections.
@@ -174,8 +182,9 @@
174 182 * @return array Settings array
175 183 */
176 184 public static function get_settings_sections() {
177 185 $settings_sections = array(
186 + 'features' => __( 'Features', 'top-10' ),
178 187 'general' => __( 'General', 'top-10' ),
179 188 'counter' => __( 'Counter/Tracker', 'top-10' ),
180 189 'list' => __( 'Posts list', 'top-10' ),
181 190 'thumbnail' => __( 'Thumbnail', 'top-10' ),
@@ -195,8 +204,159 @@
195 204 }
196 205
197 206
198 207 /**
208 + * Raw defaults for every registered setting, keyed by option ID.
209 + *
210 + * Must exactly match what `tptn_settings_defaults()` computes from
211 + * {@see self::get_registered_settings()}, but without building the full
212 + * (translated) field definitions. Values are pre-normalized: checkboxes are
213 + * `1`/`0`, not `true`/`false`. Computed defaults (e.g. `thumb_default`) are
214 + * represented as `''` here since their real value cannot be known statically.
215 + *
216 + * @since 4.4.2
217 + *
218 + * @return array<string, mixed> Default value for every option ID.
219 + */
220 + public static function get_defaults() {
221 + return array(
222 + 'features_header' => '',
223 + 'features_display_header' => '',
224 + 'features_performance_header' => '',
225 + 'enable_blocks' => 1,
226 + 'enable_legacy_widgets' => 1,
227 + 'enable_rest_api' => 1,
228 + 'enable_query_block' => 1,
229 + 'enable_featured_image_block' => 1,
230 + 'enable_popular_posts_pro_block' => 1,
231 + 'enable_page_builders' => 1,
232 + 'enable_popular_authors' => 1,
233 + 'features_tracking_header' => '',
234 + 'enable_feed' => 1,
235 + 'enable_fast_tracker' => 1,
236 + 'enable_sitewide_tracking' => 1,
237 + 'features_data_header' => '',
238 + 'enable_daily_table_rollup' => 1,
239 + 'features_admin_header' => '',
240 + 'features_api_header' => '',
241 + 'enable_pro_dashboard_widgets' => 1,
242 + 'enable_lazy_load' => 1,
243 + 'cache' => 1,
244 + 'cache_time' => HOUR_IN_SECONDS,
245 + 'lazy_load' => 0,
246 + 'uninstall_clean_options' => 1,
247 + 'uninstall_clean_tables' => 0,
248 + 'show_credit' => 0,
249 + 'admin_header' => '',
250 + 'show_metabox' => 1,
251 + 'show_metabox_admins' => 0,
252 + 'pv_in_admin' => 1,
253 + 'admin_column_post_types' => 'post,page',
254 + 'show_count_non_admins' => 1,
255 + 'show_dashboard_to_roles' => 'administrator',
256 + 'show_admin_bar' => 1,
257 + 'query_optimization' => '',
258 + 'max_execution_time' => 3000,
259 + 'counter_header' => '',
260 + 'add_to' => 'single,page',
261 + 'count_disp_form' => 'Visited %totalcount% times, %dailycount% visit(s) today',
262 + 'count_disp_form_zero' => 'No visits yet',
263 + 'number_format_count' => 1,
264 + 'number_format_style' => 'full',
265 + 'daily_midnight' => 1,
266 + 'range_desc' => '',
267 + 'daily_range' => '1',
268 + 'hour_range' => '0',
269 + 'dynamic_post_count' => 0,
270 + 'exclude_on_post_ids' => '',
271 + 'tracker_header' => '',
272 + 'trackers' => 'overall,daily',
273 + 'tracker_type' => 'query_based',
274 + 'tracking_method' => 'funnel',
275 + 'tracker_all_pages' => 0,
276 + 'track_sitewide' => 0,
277 + 'track_feed_views' => 0,
278 + 'track_users' => 'authors,editors,admins',
279 + 'logged_in' => 1,
280 + 'no_bots' => 0,
281 + 'debug_mode' => 0,
282 + 'use_global_settings' => 0,
283 + 'limit' => '10',
284 + 'how_old' => '0',
285 + 'post_types' => 'post',
286 + 'exclusion_header' => '',
287 + 'exclude_front' => 0,
288 + 'exclude_current_post' => 0,
289 + 'exclude_post_ids' => '',
290 + 'exclude_cat_slugs' => '',
291 + 'exclude_categories' => '',
292 + 'exclude_terms_include_parents' => 'none',
293 + 'exclude_on_cat_slugs' => '',
294 + 'customize_output_header' => '',
295 + 'title' => '<h3>Popular posts:</h3>',
296 + 'title_daily' => '<h3>Currently trending:</h3>',
297 + 'blank_output' => 'blank',
298 + 'blank_output_text' => 'No top posts yet',
299 + 'show_excerpt' => 0,
300 + 'excerpt_length' => '10',
301 + 'show_date' => 0,
302 + 'show_author' => 0,
303 + 'disp_list_count' => 0,
304 + 'show_ratings' => '',
305 + 'title_length' => '60',
306 + 'link_new_window' => 0,
307 + 'link_nofollow' => 0,
308 + 'html_wrapper_header' => '',
309 + 'before_list' => '<ul>',
310 + 'after_list' => '</ul>',
311 + 'before_list_item' => '<li>',
312 + 'after_list_item' => '</li>',
313 + 'post_thumb_op' => 'text_only',
314 + 'thumb_size' => 'tptn_thumbnail',
315 + 'thumb_width' => '250',
316 + 'thumb_height' => '250',
317 + 'thumb_crop' => 1,
318 + 'thumb_create_sizes' => 1,
319 + 'thumb_html' => 'html',
320 + 'thumb_meta' => 'post-image',
321 + 'scan_images' => 1,
322 + 'thumb_default_show' => 1,
323 + 'thumb_default' => '',
324 + 'tptn_styles' => 'no_style',
325 + 'custom_css' => '',
326 + 'cron_on' => 0,
327 + 'maintenance_days' => 0,
328 + 'log_retention_days' => 0,
329 + 'cron_range_desc' => '',
330 + 'cron_hour' => '0',
331 + 'cron_min' => '0',
332 + 'cron_recurrence' => 'weekly',
333 + 'feed_permalink_overall' => 'popular-posts',
334 + 'feed_permalink_daily' => 'popular-posts-daily',
335 + 'feed_limit' => '10',
336 + 'feed_daily_range' => '1',
337 + 'feed_category_slugs' => '',
338 + 'wzpa_number' => 10,
339 + 'wzpa_daily_range' => 1,
340 + 'wzpa_hour_range' => 0,
341 + 'wzpa_optioncount' => 0,
342 + 'wzpa_show_postcount' => 0,
343 + 'wzpa_show_fullname' => 0,
344 + 'wzpa_show_avatar' => 0,
345 + 'wzpa_exclude_admin' => 0,
346 + 'wzpa_post_type' => 'post',
347 + 'wzpa_cache' => 1,
348 + 'wzpa_styles_desc' => '',
349 + 'wzpa_styles' => 'no_style',
350 + 'wzpa_html_wrapper_header' => '',
351 + 'wzpa_before_list' => '<ul>',
352 + 'wzpa_after_list' => '</ul>',
353 + 'wzpa_before_list_item' => '<li>',
354 + 'wzpa_after_list_item' => '</li>',
355 + );
356 + }
357 +
358 + /**
199 359 * Retrieve the array of plugin settings
200 360 *
201 361 * @since 3.3.0
202 362 *
@@ -245,8 +405,16 @@
245 405 'desc' => esc_html__( 'Enter the number of seconds to cache the output.', 'top-10' ),
246 406 'type' => 'text',
247 407 'default' => HOUR_IN_SECONDS,
248 408 ),
409 + 'lazy_load' => array(
410 + 'id' => 'lazy_load',
411 + 'name' => esc_html__( 'Lazy load popular posts', 'top-10' ),
412 + 'desc' => esc_html__( 'Load popular posts using JavaScript when the list is about to enter the viewport. This speeds up initial page loads and lets full-page caches serve fresh lists. Search engines may not index links loaded this way. Applies to content, shortcodes, widgets and the Popular Posts block. Use lazy_load="0" in the shortcode or block attributes to disable it per instance. Not applied on feeds or AMP pages.', 'top-10' ),
413 + 'type' => 'checkbox',
414 + 'default' => false,
415 + 'pro' => true,
416 + ),
249 417 'uninstall_clean_options' => array(
250 418 'id' => 'uninstall_clean_options',
251 419 'name' => esc_html__( 'Delete options on uninstall', 'top-10' ),
252 420 'desc' => esc_html__( 'If this is checked, all settings related to Top 10 are removed from the database if you choose to uninstall/delete the plugin.', 'top-10' ),
@@ -409,8 +577,19 @@
409 577 'desc' => esc_html__( 'Activating this option will convert the post counts into a number format based on the locale', 'top-10' ),
410 578 'type' => 'checkbox',
411 579 'default' => true,
412 580 ),
581 + 'number_format_style' => array(
582 + 'id' => 'number_format_style',
583 + 'name' => esc_html__( 'Number format style', 'top-10' ),
584 + 'desc' => esc_html__( 'Select Abbreviated to display large view counts in a compact form, e.g. 1.2k or 3.4M, wherever counts are displayed. Full displays the complete number.', 'top-10' ),
585 + 'type' => 'select',
586 + 'default' => 'full',
587 + 'options' => array(
588 + 'full' => esc_html__( 'Full', 'top-10' ),
589 + 'abbreviated' => esc_html__( 'Abbreviated (1.2k, 3.4M)', 'top-10' ),
590 + ),
591 + ),
413 592 'daily_midnight' => array(
414 593 'id' => 'daily_midnight',
415 594 'name' => esc_html__( 'Start daily counts at midnight', 'top-10' ),
416 595 'desc' => esc_html__( 'The daily counter displays visits starting at midnight. This option is enabled by default, similar to most standard counters. If you disable this option, you can use the hourly setting in the next option.', 'top-10' ),
@@ -481,8 +660,16 @@
481 660 'type' => 'radiodesc',
482 661 'default' => 'query_based',
483 662 'options' => self::get_tracker_types(),
484 663 ),
664 + 'tracking_method' => array(
665 + 'id' => 'tracking_method',
666 + 'name' => esc_html__( 'Tracking method', 'top-10' ),
667 + 'desc' => esc_html__( 'Funnel tracking buffers views in a staging table that is merged into the count tables by a background job every few minutes and is recommended for most sites. Switch to Legacy tracking if view counts are not updating on your site, e.g. when WP-Cron is disabled or unreliable. Legacy tracking does not populate the visits log table.', 'top-10' ),
668 + 'type' => 'radiodesc',
669 + 'default' => 'funnel',
670 + 'options' => self::get_tracking_methods(),
671 + ),
485 672 'tracker_all_pages' => array(
486 673 'id' => 'tracker_all_pages',
487 674 'name' => esc_html__( 'Load tracker on all pages', 'top-10' ),
488 675 'desc' => esc_html__( 'This will load the tracker js on all pages. Helpful if you are running minification/concatenation plugins.', 'top-10' ),
@@ -488,8 +675,16 @@
488 675 'desc' => esc_html__( 'This will load the tracker js on all pages. Helpful if you are running minification/concatenation plugins.', 'top-10' ),
489 676 'type' => 'checkbox',
490 677 'default' => false,
491 678 ),
679 + 'track_sitewide' => array(
680 + 'id' => 'track_sitewide',
681 + 'name' => esc_html__( 'Track site-wide views', 'top-10' ),
682 + 'desc' => esc_html__( 'Track views for the front page, posts page, archives, and search results in addition to individual posts and pages. Site-wide contexts use fixed reserved IDs in the shared Top 10 tables: front page = PHP_INT_MAX; home page = PHP_INT_MAX - 1; search = PHP_INT_MAX - 2; category = PHP_INT_MAX - 4; tag = PHP_INT_MAX - 5; taxonomy = PHP_INT_MAX - 6; author = PHP_INT_MAX - 7; post type archive = PHP_INT_MAX - 8; date archive = PHP_INT_MAX - 9; archive = PHP_INT_MAX - 10; other = PHP_INT_MAX - 11. These IDs are the same on every site and counts remain separate by site (blog ID).', 'top-10' ),
683 + 'type' => 'checkbox',
684 + 'default' => false,
685 + 'pro' => true,
686 + ),
492 687 'track_feed_views' => array(
493 688 'id' => 'track_feed_views',
494 689 'name' => esc_html__( 'Track feed views', 'top-10' ),
495 690 'desc' => esc_html__( 'Count post views from RSS/Atom feed readers via a tracking pixel. Views are added to the post\'s regular view count. Note: some feed readers block remote images by default; views are only counted when the reader loads images.', 'top-10' ),
@@ -729,8 +924,20 @@
729 924 'desc' => '',
730 925 'type' => 'checkbox',
731 926 'default' => false,
732 927 ),
928 + 'show_ratings' => array(
929 + 'id' => 'show_ratings',
930 + 'name' => esc_html__( 'Show WP-PostRatings rating', 'top-10' ),
931 + 'desc' => esc_html__( 'Display the rating from the WP-PostRatings plugin with each post in the list. This option only takes effect when the WP-PostRatings plugin is active. The Star rating output, including the text shown alongside the stars, comes from the "Ratings Voted Text" template which you can edit under WP-PostRatings » Settings » Templates.', 'top-10' ),
932 + 'type' => 'select',
933 + 'default' => '',
934 + 'options' => array(
935 + '' => esc_html__( 'Do not display', 'top-10' ),
936 + 'stars' => esc_html__( 'Star rating', 'top-10' ),
937 + 'score' => esc_html__( 'Average score, e.g. 4.25', 'top-10' ),
938 + ),
939 + ),
733 940 'title_length' => array(
734 941 'id' => 'title_length',
735 942 'name' => esc_html__( 'Limit post title length (in characters)', 'top-10' ),
736 943 'desc' => '',
@@ -898,14 +1105,15 @@
898 1105 'type' => 'checkbox',
899 1106 'default' => true,
900 1107 ),
901 1108 'thumb_default' => array(
902 - 'id' => 'thumb_default',
903 - 'name' => esc_html__( 'Default thumbnail', 'top-10' ),
904 - 'desc' => esc_html__( 'Enter the full URL of the image that you wish to display if no thumbnail is found. This image will be displayed below.', 'top-10' ),
905 - 'type' => 'file',
906 - 'default' => Display::get_default_thumbnail(),
907 - 'size' => 'large',
1109 + 'id' => 'thumb_default',
1110 + 'name' => esc_html__( 'Default thumbnail', 'top-10' ),
1111 + 'desc' => esc_html__( 'Enter the full URL of the image that you wish to display if no thumbnail is found. This image will be displayed below.', 'top-10' ),
1112 + 'type' => 'file',
1113 + 'default' => Display::get_default_thumbnail(),
1114 + 'size' => 'large',
1115 + 'modified_indicator' => false,
908 1116 ),
909 1117 );
910 1118
911 1119 /**
@@ -939,9 +1147,9 @@
939 1147 'custom_css' => array(
940 1148 'id' => 'custom_css',
941 1149 'name' => esc_html__( 'Custom CSS', 'top-10' ),
942 1150 'desc' => sprintf(
943 - /* translators: 1: Opening a tag, 2: Closing a tag, 3: Opening code tage, 4. Closing code tag. */
1151 + /* translators: 1: Opening a tag, 2: Closing a tag, 3: Opening code tage, 4. Closing code tag. */
944 1152 esc_html__( 'Do not include %3$sstyle%4$s tags. Check out %1$sthis article%2$s for available CSS classes to style.', 'top-10' ),
945 1153 '<a href="' . esc_url( 'https://webberzone.com/support/knowledgebase/using-and-customising-top-10/' ) . '" target="_blank">',
946 1154 '</a>',
947 1155 '<code>',
@@ -976,10 +1184,11 @@
976 1184 'cron_on' => array(
977 1185 'id' => 'cron_on',
978 1186 'name' => esc_html__( 'Enable scheduled maintenance', 'top-10' ),
979 1187 'desc' => sprintf(
980 - /* translators: 1: Constant holding number of days data is stored. */
1188 + /* translators: 1: Constant holding number of days data is stored. */
981 1189 esc_html__( 'Regularly cleaning the database can enhance performance, especially for high-traffic blogs. Enabling maintenance will automatically delete entries older than %s days from the daily tables.', 'top-10' ),
1190 + /** This filter is documented in includes/admin/class-cron.php */
982 1191 '<strong>' . (int) apply_filters( 'tptn_maintenance_days', TOP_TEN_STORE_DATA ) . '</strong>'
983 1192 ),
984 1193 'type' => 'checkbox',
985 1194 'default' => false,
@@ -987,9 +1196,9 @@
987 1196 'maintenance_days' => array(
988 1197 'id' => 'maintenance_days',
989 1198 'name' => esc_html__( 'Daily table retention period', 'top-10' ),
990 1199 'desc' => sprintf(
991 - /* translators: 1: Constant holding number of days data is stored. */
1200 + /* translators: 1: Constant holding number of days data is stored. */
992 1201 esc_html__( 'Enter the number of days to retain data in the daily tables before scheduled maintenance removes older entries. Enter 0 to use the default value of %s days.', 'top-10' ),
993 1202 '<strong>' . TOP_TEN_STORE_DATA . '</strong>'
994 1203 ),
995 1204 'type' => 'number',
@@ -1001,9 +1210,9 @@
1001 1210 'log_retention_days' => array(
1002 1211 'id' => 'log_retention_days',
1003 1212 'name' => esc_html__( 'Visits log retention period', 'top-10' ),
1004 1213 'desc' => sprintf(
1005 - /* translators: 1: Default number of days for visits log retention. */
1214 + /* translators: 1: Default number of days for visits log retention. */
1006 1215 esc_html__( 'Enter the number of days to retain raw visit rows in the visits log table. The log stores one row per visit and grows faster than the daily table, so a shorter window is recommended. Enter 0 to use the default value of %s days.', 'top-10' ),
1007 1216 '<strong>' . TOP_TEN_LOG_STORE_DATA . '</strong>'
1008 1217 ),
1009 1218 'type' => 'number',
@@ -1132,11 +1341,185 @@
1132 1341 return apply_filters( self::$prefix . '_settings_feed', $settings );
1133 1342 }
1134 1343
1135 1344 /**
1345 + * Retrieve the array of Features settings
1346 + *
1347 + * All features are enabled by default. Disabling a feature stops its
1348 + * classes from being loaded on any request.
1349 + *
1350 + * @since 4.4.0
1351 + *
1352 + * @return array Features settings array
1353 + */
1354 + public static function settings_features() {
1355 + $settings = array(
1356 + 'features_header' => array(
1357 + 'id' => 'features_header',
1358 + 'name' => '<h3>' . esc_html__( 'Features', 'top-10' ) . '</h3>',
1359 + 'desc' => esc_html__( 'Turn off any features you do not use and the plugin will not load their code. All features are enabled by default. Blocks that are disabled will render as empty on the front end and show an unavailable notice in the block editor.', 'top-10' ),
1360 + 'type' => 'header',
1361 + ),
1362 + 'features_display_header' => array(
1363 + 'id' => 'features_display_header',
1364 + 'name' => '<h3>' . esc_html__( 'Content and display', 'top-10' ) . '</h3>',
1365 + 'desc' => esc_html__( 'Control the blocks, widgets, page builders, and author tools registered by Top 10.', 'top-10' ),
1366 + 'type' => 'header',
1367 + ),
1368 + 'enable_blocks' => array(
1369 + 'id' => 'enable_blocks',
1370 + 'name' => esc_html__( 'Popular Posts and Post Count blocks', 'top-10' ),
1371 + 'desc' => esc_html__( 'Registers the free Popular Posts and Post Count blocks for the block editor.', 'top-10' ),
1372 + 'type' => 'checkbox',
1373 + 'default' => 1,
1374 + ),
1375 + 'enable_legacy_widgets' => array(
1376 + 'id' => 'enable_legacy_widgets',
1377 + 'name' => esc_html__( 'Legacy widgets', 'top-10' ),
1378 + 'desc' => esc_html__( 'Registers the classic Popular Posts and Views Count widgets. Disable this if you use blocks instead of classic widgets.', 'top-10' ),
1379 + 'type' => 'checkbox',
1380 + 'default' => 1,
1381 + ),
1382 + 'enable_query_block' => array(
1383 + 'id' => 'enable_query_block',
1384 + 'name' => esc_html__( 'Query block', 'top-10' ),
1385 + 'desc' => esc_html__( 'Registers the Top 10 Query block and the pre-built block patterns.', 'top-10' ),
1386 + 'type' => 'checkbox',
1387 + 'default' => 1,
1388 + 'pro' => true,
1389 + ),
1390 + 'enable_featured_image_block' => array(
1391 + 'id' => 'enable_featured_image_block',
1392 + 'name' => esc_html__( 'Featured Image block', 'top-10' ),
1393 + 'desc' => esc_html__( 'Extends the core Featured Image block with Top 10 options.', 'top-10' ),
1394 + 'type' => 'checkbox',
1395 + 'default' => 1,
1396 + 'pro' => true,
1397 + ),
1398 + 'enable_popular_posts_pro_block' => array(
1399 + 'id' => 'enable_popular_posts_pro_block',
1400 + 'name' => esc_html__( 'Popular Posts Pro block', 'top-10' ),
1401 + 'desc' => esc_html__( 'Registers the Popular Posts Pro block for the block editor.', 'top-10' ),
1402 + 'type' => 'checkbox',
1403 + 'default' => 1,
1404 + 'pro' => true,
1405 + ),
1406 + 'enable_page_builders' => array(
1407 + 'id' => 'enable_page_builders',
1408 + 'name' => esc_html__( 'Page builder integrations', 'top-10' ),
1409 + 'desc' => esc_html__( 'Registers the Popular Posts elements for Elementor, Bricks Builder, and WPBakery Page Builder.', 'top-10' ),
1410 + 'type' => 'checkbox',
1411 + 'default' => 1,
1412 + 'pro' => true,
1413 + ),
1414 + 'enable_popular_authors' => array(
1415 + 'id' => 'enable_popular_authors',
1416 + 'name' => esc_html__( 'Popular Authors', 'top-10' ),
1417 + 'desc' => esc_html__( 'Enables the Popular Authors blocks, shortcodes, widgets and settings.', 'top-10' ),
1418 + 'type' => 'checkbox',
1419 + 'default' => 1,
1420 + 'pro' => true,
1421 + ),
1422 + 'features_performance_header' => array(
1423 + 'id' => 'features_performance_header',
1424 + 'name' => '<h3>' . esc_html__( 'Performance', 'top-10' ) . '</h3>',
1425 + 'desc' => esc_html__( 'Control optional output performance modules.', 'top-10' ),
1426 + 'type' => 'header',
1427 + ),
1428 + 'enable_lazy_load' => array(
1429 + 'id' => 'enable_lazy_load',
1430 + 'name' => esc_html__( 'Lazy-load module', 'top-10' ),
1431 + 'desc' => esc_html__( 'Loads the lazy-loading module and its REST endpoint. Disable this to remove lazy-loading support, including per-shortcode and per-block lazy_load overrides. Requires REST API endpoints to be enabled.', 'top-10' ),
1432 + 'type' => 'checkbox',
1433 + 'default' => 1,
1434 + 'pro' => true,
1435 + ),
1436 + 'features_tracking_header' => array(
1437 + 'id' => 'features_tracking_header',
1438 + 'name' => '<h3>' . esc_html__( 'Tracking and feeds', 'top-10' ) . '</h3>',
1439 + 'desc' => esc_html__( 'Control how Top 10 records views and provides popular posts feeds.', 'top-10' ),
1440 + 'type' => 'header',
1441 + ),
1442 + 'enable_feed' => array(
1443 + 'id' => 'enable_feed',
1444 + 'name' => esc_html__( 'Popular posts feeds', 'top-10' ),
1445 + 'desc' => esc_html__( 'Adds custom RSS feeds for overall and daily popular posts. The feed settings are on the Feed tab.', 'top-10' ),
1446 + 'type' => 'checkbox',
1447 + 'default' => 1,
1448 + ),
1449 + 'enable_fast_tracker' => array(
1450 + 'id' => 'enable_fast_tracker',
1451 + 'name' => esc_html__( 'Fast and High-traffic trackers', 'top-10' ),
1452 + 'desc' => esc_html__( 'Adds the Fast tracker and High-traffic tracker options to the Tracker type setting. If this is disabled while one of these trackers is in use, the tracker type will be reset to the default.', 'top-10' ),
1453 + 'type' => 'checkbox',
1454 + 'default' => 1,
1455 + 'pro' => true,
1456 + ),
1457 + 'enable_sitewide_tracking' => array(
1458 + 'id' => 'enable_sitewide_tracking',
1459 + 'name' => esc_html__( 'Site-wide tracking', 'top-10' ),
1460 + 'desc' => esc_html__( 'Enables the site-wide tracking feature. When enabled, turn on Track site-wide views under Counter/Tracker to count front pages, posts pages, archives, and searches.', 'top-10' ),
1461 + 'type' => 'checkbox',
1462 + 'default' => 1,
1463 + 'pro' => true,
1464 + ),
1465 + 'features_data_header' => array(
1466 + 'id' => 'features_data_header',
1467 + 'name' => '<h3>' . esc_html__( 'Data and maintenance', 'top-10' ) . '</h3>',
1468 + 'desc' => esc_html__( 'Control tools that manage and reduce stored view data.', 'top-10' ),
1469 + 'type' => 'header',
1470 + ),
1471 + 'enable_daily_table_rollup' => array(
1472 + 'id' => 'enable_daily_table_rollup',
1473 + 'name' => esc_html__( 'Daily table size reduction', 'top-10' ),
1474 + 'desc' => esc_html__( 'Enables the Reduce Daily Table Size tool and the wp top10 db rollup command for combining older hourly records.', 'top-10' ),
1475 + 'type' => 'checkbox',
1476 + 'default' => 1,
1477 + 'pro' => true,
1478 + ),
1479 + 'features_admin_header' => array(
1480 + 'id' => 'features_admin_header',
1481 + 'name' => '<h3>' . esc_html__( 'Administration', 'top-10' ) . '</h3>',
1482 + 'desc' => esc_html__( 'Control additional Top 10 administration features.', 'top-10' ),
1483 + 'type' => 'header',
1484 + ),
1485 + 'enable_pro_dashboard_widgets' => array(
1486 + 'id' => 'enable_pro_dashboard_widgets',
1487 + 'name' => esc_html__( 'Pro dashboard widgets', 'top-10' ),
1488 + 'desc' => esc_html__( 'Adds the enhanced Top 10 Pro widgets to the WordPress dashboard.', 'top-10' ),
1489 + 'type' => 'checkbox',
1490 + 'default' => 1,
1491 + 'pro' => true,
1492 + ),
1493 + 'features_api_header' => array(
1494 + 'id' => 'features_api_header',
1495 + 'name' => '<h3>' . esc_html__( 'API integrations', 'top-10' ) . '</h3>',
1496 + 'desc' => esc_html__( 'Control the Top 10 REST API endpoints used by integrations, tracking, blocks, and lazy loading.', 'top-10' ),
1497 + 'type' => 'header',
1498 + ),
1499 + 'enable_rest_api' => array(
1500 + 'id' => 'enable_rest_api',
1501 + 'name' => esc_html__( 'REST API endpoints', 'top-10' ),
1502 + 'desc' => esc_html__( 'Registers the top-10/v1 endpoints for popular posts, tracking, counters, blocks, and lazy loading. Keep enabled if your tracker type is REST-based or if your integrations or blocks use these endpoints.', 'top-10' ),
1503 + 'type' => 'checkbox',
1504 + 'default' => 1,
1505 + ),
1506 + );
1507 +
1508 + /**
1509 + * Filters the Features settings array
1510 + *
1511 + * @since 4.4.0
1512 + *
1513 + * @param array $settings Features settings array
1514 + */
1515 + return apply_filters( self::$prefix . '_settings_features', $settings );
1516 + }
1517 +
1518 + /**
1136 1519 * Get the various styles.
1137 1520 *
1138 - * @since 2.5.0
1521 + * @since 2.5.0
1139 1522 * @return array Style options.
1140 1523 */
1141 1524 public static function get_styles() {
1142 1525 $styles = array(
@@ -1171,9 +1554,9 @@
1171 1554 * Get User Roles.
1172 1555 *
1173 1556 * @since 4.0.0
1174 1557 *
1175 - * @param array $remove_roles Roles to remove.
1558 + * @param array $remove_roles Roles to remove.
1176 1559 * @return array User roles in the format 'role' => 'name'.
1177 1560 */
1178 1561 public static function get_user_roles( $remove_roles = array() ) {
1179 1562 // Get the global $wp_roles object using the wp_roles() function.
@@ -1214,9 +1597,9 @@
1214 1597 * Adding WordPress plugin action links.
1215 1598 *
1216 1599 * @since 3.3.0
1217 1600 *
1218 - * @param array $links Array of links.
1601 + * @param array $links Array of links.
1219 1602 * @return array
1220 1603 */
1221 1604 public function plugin_actions_links( $links ) {
1222 1605
@@ -1232,10 +1615,10 @@
1232 1615 * Add meta links on Plugins page.
1233 1616 *
1234 1617 * @since 3.3.0
1235 1618 *
1236 - * @param array $links Array of Links.
1237 - * @param string $file Current file.
1619 + * @param array $links Array of Links.
1620 + * @param string $file Current file.
1238 1621 * @return array
1239 1622 */
1240 1623 public function plugin_row_meta( $links, $file ) {
1241 1624
@@ -1257,18 +1640,18 @@
1257 1640 * @since 1.8.0
1258 1641 */
1259 1642 public function get_help_sidebar() {
1260 1643 $help_sidebar =
1261 - /* translators: 1: Plugin support site link. */
1262 - '<p>' . sprintf( __( 'For more information or how to get support visit the <a href="%s">support site</a>.', 'top-10' ), esc_url( 'https://webberzone.com/support/' ) ) . '</p>' .
1263 - /* translators: 1: WordPress.org support forums link. */
1264 - '<p>' . sprintf( __( 'Support queries should be posted in the <a href="%s">WordPress.org support forums</a>.', 'top-10' ), esc_url( 'https://wordpress.org/support/plugin/top-10' ) ) . '</p>' .
1265 - '<p>' . sprintf(
1266 - /* translators: 1: Github issues link, 2: Github plugin page link. */
1267 - __( '<a href="%1$s">Post an issue</a> on <a href="%2$s">GitHub</a> (bug reports only).', 'top-10' ),
1268 - esc_url( 'https://github.com/ajaydsouza/top-10/issues' ),
1269 - esc_url( 'https://github.com/ajaydsouza/top-10' )
1270 - ) . '</p>';
1644 + /* translators: 1: Plugin support site link. */
1645 + '<p>' . sprintf( __( 'For more information or how to get support visit the <a href="%s">support site</a>.', 'top-10' ), esc_url( 'https://webberzone.com/support/' ) ) . '</p>' .
1646 + /* translators: 1: WordPress.org support forums link. */
1647 + '<p>' . sprintf( __( 'Support queries should be posted in the <a href="%s">WordPress.org support forums</a>.', 'top-10' ), esc_url( 'https://wordpress.org/support/plugin/top-10' ) ) . '</p>' .
1648 + '<p>' . sprintf(
1649 + /* translators: 1: Github issues link, 2: Github plugin page link. */
1650 + __( '<a href="%1$s">Post an issue</a> on <a href="%2$s">GitHub</a> (bug reports only).', 'top-10' ),
1651 + esc_url( 'https://github.com/ajaydsouza/top-10/issues' ),
1652 + esc_url( 'https://github.com/ajaydsouza/top-10' )
1653 + ) . '</p>';
1271 1654
1272 1655 /**
1273 1656 * Filter to modify the help sidebar content.
1274 1657 *
@@ -1290,9 +1673,9 @@
1290 1673 'id' => 'tptn-settings-general-help',
1291 1674 'title' => esc_html__( 'General', 'top-10' ),
1292 1675 'content' =>
1293 1676 '<p><strong>' . esc_html__( 'This tab provides global settings for how Top 10 works across your site.', 'top-10' ) . '</strong></p>' .
1294 - '<p>' . esc_html__( 'Configure caching, uninstall behaviour, admin columns, the dashboard, and other high-level options. You must click the Save Changes button at the bottom of the screen for new settings to take effect.', 'top-10' ) . '</p>',
1677 + '<p>' . esc_html__( 'Configure caching, uninstall behaviour, admin columns, the dashboard, and other high-level options. You must click the Save Changes button at the bottom of the screen for new settings to take effect.', 'top-10' ) . '</p>',
1295 1678 ),
1296 1679 array(
1297 1680 'id' => 'tptn-settings-counter-help',
1298 1681 'title' => esc_html__( 'Counter / Tracker', 'top-10' ),
@@ -1297,9 +1680,9 @@
1297 1680 'id' => 'tptn-settings-counter-help',
1298 1681 'title' => esc_html__( 'Counter / Tracker', 'top-10' ),
1299 1682 'content' =>
1300 1683 '<p><strong>' . esc_html__( 'This tab controls how Top 10 tracks and displays view counts.', 'top-10' ) . '</strong></p>' .
1301 - '<p>' . esc_html__( 'Choose where to display view counts, how they are formatted, which visits are tracked, and how the tracker works (REST API, query variables, or Ajax).', 'top-10' ) . '</p>',
1684 + '<p>' . esc_html__( 'Choose where to display view counts, how they are formatted, which visits are tracked, and how the tracker works (REST API, query variables, or Ajax).', 'top-10' ) . '</p>',
1302 1685 ),
1303 1686 array(
1304 1687 'id' => 'tptn-settings-list-help',
1305 1688 'title' => esc_html__( 'Posts list', 'top-10' ),
@@ -1304,9 +1687,9 @@
1304 1687 'id' => 'tptn-settings-list-help',
1305 1688 'title' => esc_html__( 'Posts list', 'top-10' ),
1306 1689 'content' =>
1307 1690 '<p><strong>' . esc_html__( 'This tab controls the popular posts list output.', 'top-10' ) . '</strong></p>' .
1308 - '<p>' . esc_html__( 'Configure the number of posts, age of posts, post types, exclusions, and what information is shown (title, date, author, views, excerpts, and HTML wrappers).', 'top-10' ) . '</p>',
1691 + '<p>' . esc_html__( 'Configure the number of posts, age of posts, post types, exclusions, and what information is shown (title, date, author, views, excerpts, and HTML wrappers).', 'top-10' ) . '</p>',
1309 1692 ),
1310 1693 array(
1311 1694 'id' => 'tptn-settings-thumbnail-help',
1312 1695 'title' => esc_html__( 'Thumbnail', 'top-10' ),
@@ -1311,9 +1694,9 @@
1311 1694 'id' => 'tptn-settings-thumbnail-help',
1312 1695 'title' => esc_html__( 'Thumbnail', 'top-10' ),
1313 1696 'content' =>
1314 1697 '<p><strong>' . esc_html__( 'This tab manages thumbnail settings for the popular posts list.', 'top-10' ) . '</strong></p>' .
1315 - '<p>' . esc_html__( 'Choose whether thumbnails are displayed, select the image size, configure custom dimensions, cropping, the default thumbnail, and fallback behaviour when no thumbnail is found.', 'top-10' ) . '</p>',
1698 + '<p>' . esc_html__( 'Choose whether thumbnails are displayed, select the image size, configure custom dimensions, cropping, the default thumbnail, and fallback behaviour when no thumbnail is found.', 'top-10' ) . '</p>',
1316 1699 ),
1317 1700 array(
1318 1701 'id' => 'tptn-settings-styles-help',
1319 1702 'title' => esc_html__( 'Styles', 'top-10' ),
@@ -1318,9 +1701,9 @@
1318 1701 'id' => 'tptn-settings-styles-help',
1319 1702 'title' => esc_html__( 'Styles', 'top-10' ),
1320 1703 'content' =>
1321 1704 '<p><strong>' . esc_html__( 'This tab controls how the popular posts list is styled.', 'top-10' ) . '</strong></p>' .
1322 - '<p>' . esc_html__( 'Select a built-in style or disable styles if you want to fully control the look using your own CSS.', 'top-10' ) . '</p>',
1705 + '<p>' . esc_html__( 'Select a built-in style or disable styles if you want to fully control the look using your own CSS.', 'top-10' ) . '</p>',
1323 1706 ),
1324 1707 array(
1325 1708 'id' => 'tptn-settings-maintenance-help',
1326 1709 'title' => esc_html__( 'Maintenance', 'top-10' ),
@@ -1325,9 +1708,9 @@
1325 1708 'id' => 'tptn-settings-maintenance-help',
1326 1709 'title' => esc_html__( 'Maintenance', 'top-10' ),
1327 1710 'content' =>
1328 1711 '<p><strong>' . esc_html__( 'This tab handles tools and maintenance-related options.', 'top-10' ) . '</strong></p>' .
1329 - '<p>' . esc_html__( 'Use this screen to reset settings, clear cached popular posts, and manage database-related options such as pruning or rebuilding counts.', 'top-10' ) . '</p>',
1712 + '<p>' . esc_html__( 'Use this screen to reset settings, clear cached popular posts, and manage database-related options such as pruning or rebuilding counts.', 'top-10' ) . '</p>',
1330 1713 ),
1331 1714 array(
1332 1715 'id' => 'tptn-settings-feed-help',
1333 1716 'title' => esc_html__( 'Feed', 'top-10' ),
@@ -1332,9 +1715,9 @@
1332 1715 'id' => 'tptn-settings-feed-help',
1333 1716 'title' => esc_html__( 'Feed', 'top-10' ),
1334 1717 'content' =>
1335 1718 '<p><strong>' . esc_html__( 'This tab controls how Top 10 content appears in your site feed.', 'top-10' ) . '</strong></p>' .
1336 - '<p>' . esc_html__( 'Configure copyright text and additional HTML that is added before or after the content in your feeds.', 'top-10' ) . '</p>',
1719 + '<p>' . esc_html__( 'Configure copyright text and additional HTML that is added before or after the content in your feeds.', 'top-10' ) . '</p>',
1337 1720 ),
1338 1721 );
1339 1722
1340 1723 /**
@@ -1349,9 +1732,9 @@
1349 1732
1350 1733 /**
1351 1734 * Function returns the different types of trackers.
1352 1735 *
1353 - * @since 3.3.0
1736 + * @since 3.3.0
1354 1737 * @return array Tracker types.
1355 1738 */
1356 1739 public static function get_tracker_types() {
1357 1740
@@ -1382,11 +1765,42 @@
1382 1765 */
1383 1766 return apply_filters( self::$prefix . '_get_tracker_types', $trackers );
1384 1767 }
1385 1768
1769 + /**
1770 + * Function returns the different tracking methods.
1771 + *
1772 + * @since 4.3.3
1773 + * @return array Tracking methods.
1774 + */
1775 + public static function get_tracking_methods() {
1386 1776
1777 + $methods = array(
1778 + array(
1779 + 'id' => 'funnel',
1780 + 'name' => __( 'Funnel tracking', 'top-10' ),
1781 + 'description' => __( 'Views are buffered and merged into the count tables every few minutes (default)', 'top-10' ),
1782 + ),
1783 + array(
1784 + 'id' => 'legacy',
1785 + 'name' => __( 'Legacy tracking', 'top-10' ),
1786 + 'description' => __( 'Views are written directly to the count tables on every visit (behaviour of versions before 4.3)', 'top-10' ),
1787 + ),
1788 + );
1387 1789
1790 + /**
1791 + * Filter the array containing the tracking methods.
1792 + *
1793 + * @since 4.3.3
1794 + *
1795 + * @param array $methods Tracking methods.
1796 + */
1797 + return apply_filters( self::$prefix . '_get_tracking_methods', $methods );
1798 + }
1388 1799
1800 +
1801 +
1802 +
1389 1803 /**
1390 1804 * Add footer text on the plugin page.
1391 1805 *
1392 1806 * @since 2.0.0
@@ -1392,9 +1806,9 @@
1392 1806 * @since 2.0.0
1393 1807 */
1394 1808 public static function get_admin_footer_text() {
1395 1809 return sprintf(
1396 - /* translators: 1: Opening achor tag with Plugin page link, 2: Closing anchor tag, 3: Opening anchor tag with review link. */
1810 + /* translators: 1: Opening achor tag with Plugin page link, 2: Closing anchor tag, 3: Opening anchor tag with review link. */
1397 1811 __( 'Thank you for using %1$sWebberZone Top 10%2$s! Please %3$srate us%2$s on WordPress.org', 'top-10' ),
1398 1812 '<a href="https://webberzone.com/plugins/top-10/" target="_blank">',
1399 1813 '</a>',
1400 1814 '<a href="https://wordpress.org/support/plugin/top-10/reviews/#new-post" target="_blank">'
@@ -1475,15 +1889,15 @@
1475 1889 // Overwrite settings based on selected style; guard against missing keys on reset.
1476 1890 $style = $settings['tptn_styles'] ?? '';
1477 1891
1478 1892 $inline_thumb_styles = array(
1479 - 'left_thumbs' => esc_html__( 'Note: Thumbnail location can only be Inline or Thumbnails only when the Popular posts style is set to Left thumbnails. You can change the style in the Styles tab.', 'top-10' ),
1480 - 'grid_thumbs' => esc_html__( 'Note: Thumbnail location can only be Inline or Thumbnails only when the Popular posts style is set to Grid thumbnails. You can change the style in the Styles tab.', 'top-10' ),
1893 + 'left_thumbs' => esc_html__( 'Note: Thumbnail location can only be Inline, After, or Thumbnails only when the Popular posts style is set to Left thumbnails. You can change the style in the Styles tab.', 'top-10' ),
1894 + 'grid_thumbs' => esc_html__( 'Note: Thumbnail location can only be Inline, After, or Thumbnails only when the Popular posts style is set to Grid thumbnails. You can change the style in the Styles tab.', 'top-10' ),
1481 1895 );
1482 1896
1483 1897 if ( array_key_exists( $style, $inline_thumb_styles ) ) {
1484 1898 $post_thumb_op = $settings['post_thumb_op'] ?? '';
1485 - if ( 'inline' !== $post_thumb_op && 'thumbs_only' !== $post_thumb_op ) {
1899 + if ( 'inline' !== $post_thumb_op && 'after' !== $post_thumb_op && 'thumbs_only' !== $post_thumb_op ) {
1486 1900 $settings['post_thumb_op'] = 'inline';
1487 1901 }
1488 1902
1489 1903 add_settings_error(
@@ -1504,8 +1918,20 @@
1504 1918 'warning'
1505 1919 );
1506 1920 }
1507 1921
1922 + // If the fast/high-traffic trackers are disabled, reset the tracker type to the default.
1923 + if ( isset( $settings['enable_fast_tracker'] ) && empty( $settings['enable_fast_tracker'] ) && isset( $settings['tracker_type'] ) && in_array( $settings['tracker_type'], array( 'fast_tracker', 'high_traffic_tracker' ), true ) ) {
1924 + $settings['tracker_type'] = 'query_based';
1925 +
1926 + add_settings_error(
1927 + self::$prefix . '-notices',
1928 + '',
1929 + esc_html__( 'Note: Tracker type has been reset to the default as the Fast and High-traffic trackers feature is disabled.', 'top-10' ),
1930 + 'warning'
1931 + );
1932 + }
1933 +
1508 1934 // Delete the cache.
1509 1935 \WebberZone\Top_Ten\Util\Cache::delete();
1510 1936
1511 1937 return $settings;
@@ -1560,13 +1986,13 @@
1560 1986 public static function settings_page_header() {
1561 1987 global $tptn_freemius;
1562 1988 ?>
1563 1989 <p>
1564 - <?php if ( ! $tptn_freemius->is_paying() ) { ?>
1990 + <?php if ( ! $tptn_freemius->is_paying() ) { ?>
1565 1991 <a class="tptn_button tptn_button_gold" href="<?php echo esc_url( $tptn_freemius->get_upgrade_url() ); ?>">
1566 - <?php esc_html_e( 'Upgrade to Pro', 'top-10' ); ?>
1992 + <?php esc_html_e( 'Upgrade to Pro', 'top-10' ); ?>
1567 1993 </a>
1568 - <?php } ?>
1994 + <?php } ?>
1569 1995 </p>
1570 1996
1571 1997 <?php
1572 1998 }
@@ -1573,10 +1999,10 @@
1573 1999
1574 2000 /**
1575 2001 * Updated the settings fields to display a pro version link.
1576 2002 *
1577 - * @param string $output Settings field HTML.
1578 - * @param array $args Settings field arguments.
2003 + * @param string $output Settings field HTML.
2004 + * @param array $args Settings field arguments.
1579 2005 * @return string Updated HTML.
1580 2006 */
1581 2007 public static function after_setting_output( $output, $args ) {
1582 2008 if ( isset( $args['pro'] ) && $args['pro'] ) {
@@ -1658,9 +2084,9 @@
1658 2084 if ( false !== strpos( $search_term, ',' ) ) {
1659 2085 $search_term = explode( ',', $search_term );
1660 2086 $search_term = $search_term[ count( $search_term ) - 1 ];
1661 2087 }
1662 - $search_term = trim( $search_term );
2088 + $search_term = trim( $search_term, " \t\n\r\0\x0B" );
1663 2089
1664 2090 if ( 'public_taxonomies' === $endpoint ) {
1665 2091 $taxonomies = (array) get_taxonomies( array( 'public' => true ), 'objects' );
1666 2092 $taxonomy = array();
@@ -1695,15 +2121,17 @@
1695 2121 wp_send_json_error( 'Insufficient permissions' );
1696 2122 }
1697 2123 }
1698 2124
1699 - /** This filter has been defined in /wp-admin/includes/ajax-actions.php */
2125 + /**
2126 + * This filter has been defined in /wp-admin/includes/ajax-actions.php
2127 +*/
1700 2128 $term_search_min_chars = (int) apply_filters( 'term_search_min_chars', 2, $tax, $search_term );
1701 2129
1702 2130 /*
1703 - * Require $term_search_min_chars chars for matching (default: 2)
1704 - * ensure it's a non-negative, non-zero integer.
1705 - */
2131 + * Require $term_search_min_chars chars for matching (default: 2)
2132 + * ensure it's a non-negative, non-zero integer.
2133 + */
1706 2134 if ( ( 0 === $term_search_min_chars ) || ( strlen( $search_term ) < $term_search_min_chars ) ) {
1707 2135 wp_send_json_success( array() );
1708 2136 }
1709 2137
@@ -1731,10 +2159,10 @@
1731 2159 * Get field attributes for Tom Select taxonomy search fields.
1732 2160 *
1733 2161 * @since 4.2.0
1734 2162 *
1735 - * @param string $taxonomy The taxonomy to search.
1736 - * @param array $ts_config Optional Tom Select configuration.
2163 + * @param string $taxonomy The taxonomy to search.
2164 + * @param array $ts_config Optional Tom Select configuration.
1737 2165 * @return array Field attributes array.
1738 2166 */
1739 2167 private static function get_taxonomy_search_field_attributes( $taxonomy, $ts_config = array() ) {
1740 2168 $attributes = array(
@@ -1755,9 +2183,9 @@
1755 2183 * Get field attributes for Tom Select meta key search fields.
1756 2184 *
1757 2185 * @since 4.2.0
1758 2186 *
1759 - * @param array $ts_config Optional Tom Select configuration.
2187 + * @param array $ts_config Optional Tom Select configuration.
1760 2188 * @return array Field attributes array.
1761 2189 */
1762 2190 private static function get_meta_keys_search_field_attributes( $ts_config = array() ) {
1763 2191 $attributes = array(