PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 5.2.07
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v5.2.07
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
← All changes | classes/helpers/FrmListHelper.php +151 -263 6.28 → 5.2.07 View file →
@@ -7,17 +7,15 @@
7 7 /**
8 8 * The current list of items
9 9 *
10 10 * @since 2.0.18
11 - *
12 11 * @var array
12 + * @access public
13 13 */
14 14 public $items;
15 15
16 16 /**
17 17 * @since 4.07
18 - *
19 - * @var bool|int
20 18 */
21 19 public $total_items = false;
22 20
23 21 /**
@@ -23,10 +21,10 @@
23 21 /**
24 22 * Various information about the current table
25 23 *
26 24 * @since 2.0.18
27 - *
28 25 * @var array
26 + * @access protected
29 27 */
30 28 protected $_args;
31 29
32 30 /**
@@ -32,9 +30,8 @@
32 30 /**
33 31 * Various information needed for displaying the pagination
34 32 *
35 33 * @since 2.0.18
36 - *
37 34 * @var array
38 35 */
39 36 protected $_pagination_args = array();
40 37
@@ -41,10 +38,10 @@
41 38 /**
42 39 * The current screen
43 40 *
44 41 * @since 2.0.18
45 - *
46 - * @var \WP_Screen
42 + * @var object
43 + * @access protected
47 44 */
48 45 protected $screen;
49 46
50 47 /**
@@ -50,10 +47,10 @@
50 47 /**
51 48 * Cached bulk actions
52 49 *
53 50 * @since 2.0.18
54 - *
55 51 * @var array
52 + * @access private
56 53 */
57 54 private $_actions;
58 55
59 56 /**
@@ -59,10 +56,10 @@
59 56 /**
60 57 * Cached pagination output
61 58 *
62 59 * @since 2.0.18
63 - *
64 60 * @var string
61 + * @access private
65 62 */
66 63 private $_pagination;
67 64
68 65 /**
@@ -68,14 +65,15 @@
68 65 /**
69 66 * The view switcher modes.
70 67 *
71 68 * @since 2.0.18
72 - *
73 69 * @var array
70 + * @access protected
74 71 */
75 72 protected $modes = array();
76 73
77 74 /**
75 + *
78 76 * @var array
79 77 */
80 78 protected $params;
81 79
@@ -85,16 +83,10 @@
85 83 * @var array
86 84 */
87 85 protected $_column_headers;
88 86
89 - /**
90 - * @var array
91 - */
92 87 protected $compat_fields = array( '_args', '_pagination_args', 'screen', '_actions', '_pagination' );
93 88
94 - /**
95 - * @var array
96 - */
97 89 protected $compat_methods = array(
98 90 'set_pagination_args',
99 91 'get_views',
100 92 'get_bulk_actions',
@@ -112,12 +104,8 @@
112 104 );
113 105
114 106 /**
115 107 * Construct the table object
116 - *
117 - * @param array $args
118 - *
119 - * @return void
120 108 */
121 109 public function __construct( $args ) {
122 110 $args = wp_parse_args(
123 111 $args,
@@ -149,9 +137,9 @@
149 137 // wp_enqueue_script( 'list-table' );
150 138 add_action( 'admin_footer', array( $this, '_js_vars' ) );
151 139 }
152 140
153 - if ( ! $this->modes ) {
141 + if ( empty( $this->modes ) ) {
154 142 $this->modes = array(
155 143 'list' => __( 'List View', 'formidable' ),
156 144 'excerpt' => __( 'Excerpt View', 'formidable' ),
157 145 );
@@ -161,11 +149,8 @@
161 149 public function ajax_user_can() {
162 150 return current_user_can( 'administrator' );
163 151 }
164 152
165 - /**
166 - * @return array
167 - */
168 153 public function get_columns() {
169 154 return array();
170 155 }
171 156
@@ -180,9 +165,9 @@
180 165 *
181 166 * @uses FrmListHelper::set_pagination_args()
182 167 *
183 168 * @since 2.0.18
184 - *
169 + * @access public
185 170 * @abstract
186 171 */
187 172 public function prepare_items() {
188 173 die( 'function FrmListHelper::prepare_items() must be over-ridden in a sub-class.' );
@@ -189,19 +174,15 @@
189 174 }
190 175
191 176 /**
192 177 * @since 3.0
193 - *
194 - * @param array $args
195 - *
196 - * @return array|string
197 178 */
198 179 protected function get_param( $args ) {
199 180 return FrmAppHelper::get_simple_request(
200 181 array(
201 182 'param' => $args['param'],
202 - 'default' => $args['default'] ?? '',
203 - 'sanitize' => $args['sanitize'] ?? 'sanitize_title',
183 + 'default' => isset( $args['default'] ) ? $args['default'] : '',
184 + 'sanitize' => isset( $args['sanitize'] ) ? $args['sanitize'] : 'sanitize_title',
204 185 'type' => 'request',
205 186 )
206 187 );
207 188 }
@@ -208,9 +189,13 @@
208 189
209 190 /**
210 191 * An internal method that sets all the necessary pagination arguments
211 192 *
212 - * @param array $args An associative array with information about the pagination.
193 + * @param array $args An associative array with information about the pagination
194 + *
195 + * @access protected
196 + *
197 + * @param array|string $args
213 198 */
214 199 protected function set_pagination_args( $args ) {
215 200 $args = wp_parse_args(
216 201 $args,
@@ -225,17 +210,10 @@
225 210 $args['total_pages'] = ceil( $args['total_items'] / $args['per_page'] );
226 211 }
227 212
228 213 // Redirect if page number is invalid and headers are not already sent.
229 - if ( ! wp_doing_ajax() && $args['total_pages'] > 0 && $this->get_pagenum() > $args['total_pages'] ) {
230 - $url = add_query_arg( 'paged', $args['total_pages'] );
231 -
232 - if ( headers_sent() ) {
233 - FrmAppHelper::js_redirect( $url, true );
234 - exit;
235 - }
236 -
237 - wp_safe_redirect( $url );
214 + if ( ! headers_sent() && ! wp_doing_ajax() && $args['total_pages'] > 0 && $this->get_pagenum() > $args['total_pages'] ) {
215 + wp_redirect( add_query_arg( 'paged', $args['total_pages'] ) );
238 216 exit;
239 217 }
240 218
241 219 $this->_pagination_args = $args;
@@ -244,8 +222,9 @@
244 222 /**
245 223 * Access the pagination args.
246 224 *
247 225 * @since 2.0.18
226 + * @access public
248 227 *
249 228 * @param string $key Pagination argument to retrieve. Common values include 'total_items',
250 229 * 'total_pages', 'per_page', or 'infinite_scroll'.
251 230 *
@@ -251,13 +230,15 @@
251 230 *
252 231 * @return int Number of items that correspond to the given pagination argument.
253 232 */
254 233 public function get_pagination_arg( $key ) {
255 - if ( 'page' === $key ) {
234 + if ( 'page' == $key ) {
256 235 return $this->get_pagenum();
257 236 }
258 237
259 - return $this->_pagination_args[ $key ] ?? null;
238 + if ( isset( $this->_pagination_args[ $key ] ) ) {
239 + return $this->_pagination_args[ $key ];
240 + }
260 241 }
261 242
262 243 /**
263 244 * Whether the table has items to display or not
@@ -262,8 +243,9 @@
262 243 /**
263 244 * Whether the table has items to display or not
264 245 *
265 246 * @since 2.0.18
247 + * @access public
266 248 *
267 249 * @return bool
268 250 */
269 251 public function has_items() {
@@ -273,8 +255,9 @@
273 255 /**
274 256 * Message to be displayed when there are no items
275 257 *
276 258 * @since 2.0.18
259 + * @access public
277 260 */
278 261 public function no_items() {
279 262 esc_html_e( 'No items found.', 'formidable' );
280 263 }
@@ -282,11 +265,12 @@
282 265 /**
283 266 * Display the search box.
284 267 *
285 268 * @since 2.0.18
269 + * @access public
286 270 *
287 - * @param string $text The search button text.
288 - * @param string $input_id The search input id.
271 + * @param string $text The search button text
272 + * @param string $input_id The search input id
289 273 */
290 274 public function search_box( $text, $input_id ) {
291 275 if ( empty( $_REQUEST['s'] ) && ! $this->has_items() ) {
292 276 return;
@@ -298,13 +282,8 @@
298 282
299 283 FrmAppHelper::show_search_box( compact( 'text', 'input_id' ) );
300 284 }
301 285
302 - /**
303 - * @param string $param_name
304 - *
305 - * @return void
306 - */
307 286 private function hidden_search_inputs( $param_name ) {
308 287 if ( ! empty( $_REQUEST[ $param_name ] ) ) {
309 288 $value = sanitize_text_field( wp_unslash( $_REQUEST[ $param_name ] ) );
310 289 echo '<input type="hidden" name="' . esc_attr( $param_name ) . '" value="' . esc_attr( $value ) . '" />';
@@ -315,8 +294,9 @@
315 294 * Get an associative array ( id => link ) with the list
316 295 * of views available on this table.
317 296 *
318 297 * @since 2.0.18
298 + * @access protected
319 299 *
320 300 * @return array
321 301 */
322 302 protected function get_views() {
@@ -326,8 +306,9 @@
326 306 /**
327 307 * Display the list of views available on this table.
328 308 *
329 309 * @since 2.0.18
310 + * @access public
330 311 */
331 312 public function views() {
332 313 $views = $this->get_views();
333 314 /**
@@ -341,14 +322,13 @@
341 322 * @param array $views An array of available list table views.
342 323 */
343 324 $views = apply_filters( 'views_' . $this->screen->id, $views );
344 325
345 - if ( ! $views ) {
326 + if ( empty( $views ) ) {
346 327 return;
347 328 }
348 329
349 330 echo "<ul class='subsubsub'>\n";
350 -
351 331 foreach ( $views as $class => $view ) {
352 332 $views[ $class ] = "\t" . '<li class="' . esc_attr( $class ) . '">' . $view;
353 333 }
354 334 echo implode( " |</li>\n", $views ) . "</li>\n"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
@@ -359,8 +339,9 @@
359 339 * Get an associative array ( option_name => option_title ) with the list
360 340 * of bulk actions available on this table.
361 341 *
362 342 * @since 2.0.18
343 + * @access protected
363 344 *
364 345 * @return array
365 346 */
366 347 protected function get_bulk_actions() {
@@ -370,8 +351,9 @@
370 351 /**
371 352 * Display the bulk actions dropdown.
372 353 *
373 354 * @since 2.0.18
355 + * @access protected
374 356 *
375 357 * @param string $which The location of the bulk actions: 'top' or 'bottom'.
376 358 * This is designated as optional for backwards-compatibility.
377 359 */
@@ -397,23 +379,22 @@
397 379
398 380 $two = '';
399 381 } else {
400 382 $two = '2';
401 - }//end if
383 + }
402 384
403 385 if ( empty( $this->_actions ) ) {
404 386 return;
405 387 }
406 388
407 - echo "<label for='bulk-action-selector-" . esc_attr( $which ) . "' class='screen-reader-text'>" . esc_html__( 'Select bulk action', 'formidable' ) . '</label>';
389 + echo "<label for='bulk-action-selector-" . esc_attr( $which ) . "' class='screen-reader-text'>" . esc_attr__( 'Select bulk action', 'formidable' ) . '</label>';
408 390 echo "<select name='action" . esc_attr( $two ) . "' id='bulk-action-selector-" . esc_attr( $which ) . "'>\n";
409 - echo "<option value='-1' selected='selected'>" . esc_html__( 'Bulk Actions', 'formidable' ) . "</option>\n";
391 + echo "<option value='-1' selected='selected'>" . esc_attr__( 'Bulk Actions', 'formidable' ) . "</option>\n";
410 392
411 393 foreach ( $this->_actions as $name => $title ) {
412 394 $params = array(
413 395 'value' => $name,
414 396 );
415 -
416 397 if ( 'edit' === $name ) {
417 398 $params['class'] = 'hide-if-no-js';
418 399 }
419 400
@@ -427,21 +408,9 @@
427 408 if ( isset( $this->_actions['bulk_delete'] ) ) {
428 409 $verify = $this->confirm_bulk_delete();
429 410
430 411 if ( $verify ) {
431 - $confirm_delete_attributes = array(
432 - 'id' => 'confirm-bulk-delete-' . $which,
433 - 'class' => 'frm-hidden',
434 - 'tabindex' => '-1',
435 - 'aria-hidden' => 'true',
436 - 'href' => 'confirm-bulk-delete',
437 - 'data-loaded-from' => $this->loaded_from(),
438 - 'data-frmverify' => $verify,
439 - 'data-frmverify-btn' => 'frm-button-red',
440 - );
441 -
442 - // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
443 - echo '<a ' . FrmAppHelper::array_to_html_params( $confirm_delete_attributes ) . '></a>';
412 + echo "<a id='confirm-bulk-delete-" . esc_attr( $which ) . "' class='frm-hidden' href='confirm-bulk-delete' data-frmcaution='" . esc_html__( 'Heads up', 'formidable' ) . "' data-frmverify='" . esc_attr( $verify ) . "'></a>";
444 413 }
445 414 }
446 415
447 416 submit_button( __( 'Apply', 'formidable' ), 'action', '', false, array( 'id' => "doaction$two" ) );
@@ -458,26 +427,25 @@
458 427 /**
459 428 * Get the current action selected from the bulk actions dropdown.
460 429 *
461 430 * @since 2.0.18
431 + * @access public
462 432 *
463 - * @return false|string The action name or False if no action was selected
433 + * @return string|false The action name or False if no action was selected
464 434 */
465 435 public function current_action() {
466 - if ( ! empty( $_REQUEST['filter_action'] ) ) {
436 + if ( isset( $_REQUEST['filter_action'] ) && ! empty( $_REQUEST['filter_action'] ) ) {
467 437 return false;
468 438 }
469 439
470 440 $action = $this->get_bulk_action( 'action' );
441 + if ( $action === false ) {
442 + $action = $this->get_bulk_action( 'action2' );
443 + }
471 444
472 - return $action === false ? $this->get_bulk_action( 'action2' ) : $action;
445 + return $action;
473 446 }
474 447
475 - /**
476 - * @param string $action_name
477 - *
478 - * @return false|string
479 - */
480 448 private function get_bulk_action( $action_name ) {
481 449 $action = false;
482 450 $action_param = $this->get_param(
483 451 array(
@@ -484,12 +452,10 @@
484 452 'param' => $action_name,
485 453 'sanitize' => 'sanitize_text_field',
486 454 )
487 455 );
488 -
489 - // phpcs:ignore Universal.Operators.StrictComparisons
490 456 if ( $action_param && - 1 != $action_param ) {
491 - return $action_param;
457 + $action = $action_param;
492 458 }
493 459
494 460 return $action;
495 461 }
@@ -497,11 +463,12 @@
497 463 /**
498 464 * Generate row actions div
499 465 *
500 466 * @since 2.0.18
467 + * @access protected
501 468 *
502 - * @param array $actions The list of actions.
503 - * @param bool $always_visible Whether the actions should be always visible.
469 + * @param array $actions The list of actions
470 + * @param bool $always_visible Whether the actions should be always visible
504 471 *
505 472 * @return string
506 473 */
507 474 protected function row_actions( $actions, $always_visible = false ) {
@@ -506,24 +473,25 @@
506 473 */
507 474 protected function row_actions( $actions, $always_visible = false ) {
508 475 $action_count = count( $actions );
509 476
477 + $i = 0;
478 +
510 479 if ( ! $action_count ) {
511 480 return '';
512 481 }
513 482
514 - $i = 0;
515 483 $out = '<div class="' . ( $always_visible ? 'row-actions visible' : 'row-actions' ) . '">';
516 -
517 484 foreach ( $actions as $action => $link ) {
518 - ++$i;
519 - $sep = $i === $action_count ? '' : ' | ';
485 + ++ $i;
486 + ( $i == $action_count ) ? $sep = '' : $sep = ' | ';
520 487 $out .= "<span class='$action'>$link$sep</span>";
521 488 }
489 + $out .= '</div>';
522 490
523 - $out .= '</div>';
491 + $out .= '<button type="button" class="toggle-row"><span class="screen-reader-text">' . __( 'Show more details', 'formidable' ) . '</span></button>';
524 492
525 - return $out . ( '<button type="button" class="toggle-row"><span class="screen-reader-text">' . esc_html__( 'Show more details', 'formidable' ) . '</span></button>' );
493 + return $out;
526 494 }
527 495
528 496 /**
529 497 * Display a view switcher
@@ -528,13 +496,13 @@
528 496 /**
529 497 * Display a view switcher
530 498 *
531 499 * @since 2.0.18
500 + * @access protected
532 501 *
533 502 * @param string $current_mode
534 503 */
535 504 protected function view_switcher( $current_mode ) {
536 - // phpcs:disable Generic.WhiteSpace.ScopeIndent
537 505 ?>
538 506 <input type="hidden" name="mode" value="<?php echo esc_attr( $current_mode ); ?>"/>
539 507 <div class="view-switch">
540 508 <?php
@@ -539,10 +507,8 @@
539 507 <div class="view-switch">
540 508 <?php
541 509 foreach ( $this->modes as $mode => $title ) {
542 510 $classes = array( 'view-' . $mode );
543 -
544 - // phpcs:ignore Universal.Operators.StrictComparisons
545 511 if ( $current_mode == $mode ) {
546 512 $classes[] = 'current';
547 513 }
548 514
@@ -555,9 +521,8 @@
555 521 }
556 522 ?>
557 523 </div>
558 524 <?php
559 - // phpcs:enable Generic.WhiteSpace.ScopeIndent
560 525 }
561 526
562 527 /**
563 528 * Get the current page number
@@ -562,8 +527,9 @@
562 527 /**
563 528 * Get the current page number
564 529 *
565 530 * @since 2.0.18
531 + * @access public
566 532 *
567 533 * @return int
568 534 */
569 535 public function get_pagenum() {
@@ -579,18 +545,18 @@
579 545 /**
580 546 * Get number of items to display on a single page
581 547 *
582 548 * @since 2.0.18
549 + * @access protected
583 550 *
584 551 * @param string $option
585 - * @param int $default
552 + * @param int $default
586 553 *
587 554 * @return int
588 555 */
589 556 protected function get_items_per_page( $option, $default = 20 ) {
590 557 $per_page = (int) get_user_option( $option );
591 -
592 - if ( ! $per_page || $per_page < 1 ) {
558 + if ( empty( $per_page ) || $per_page < 1 ) {
593 559 $per_page = $default;
594 560 }
595 561
596 562 /**
@@ -612,8 +578,9 @@
612 578 /**
613 579 * Display the pagination.
614 580 *
615 581 * @since 2.0.18
582 + * @access protected
616 583 *
617 584 * @param string $which
618 585 */
619 586 protected function pagination( $which ) {
@@ -623,9 +590,8 @@
623 590
624 591 $total_items = $this->_pagination_args['total_items'];
625 592 $total_pages = $this->_pagination_args['total_pages'];
626 593 $infinite_scroll = false;
627 -
628 594 if ( isset( $this->_pagination_args['infinite_scroll'] ) ) {
629 595 $infinite_scroll = $this->_pagination_args['infinite_scroll'];
630 596 }
631 597
@@ -631,14 +597,17 @@
631 597
632 598 /* translators: %s: Number of items */
633 599 $output = '<span class="displaying-num">' . sprintf( _n( '%s item', '%s items', $total_items, 'formidable' ), number_format_i18n( $total_items ) ) . '</span>';
634 600
635 - $current = $this->get_pagenum();
636 - $page_links = array();
601 + $current = $this->get_pagenum();
602 +
603 + $page_links = array();
604 +
637 605 $total_pages_before = '<span class="paging-input">';
638 606 $total_pages_after = '</span>';
639 - $disable = $this->disabled_pages( $total_pages );
640 607
608 + $disable = $this->disabled_pages( $total_pages );
609 +
641 610 $page_links[] = $this->add_page_link(
642 611 array(
643 612 'page' => 'first',
644 613 'arrow' => '&laquo;',
@@ -655,20 +624,19 @@
655 624 'disabled' => $disable['prev'],
656 625 )
657 626 );
658 627
659 - if ( 'bottom' === $which ) {
628 + if ( 'bottom' == $which ) {
660 629 $html_current_page = $current;
661 - $total_pages_before = '<span class="screen-reader-text">' . esc_html__( 'Current Page', 'formidable' ) . '</span><span id="table-paging" class="paging-input">';
630 + $total_pages_before = '<span class="screen-reader-text">' . __( 'Current Page', 'formidable' ) . '</span><span id="table-paging" class="paging-input">';
662 631 } else {
663 632 $html_current_page = sprintf(
664 633 "%s<input class='current-page' id='current-page-selector' type='text' name='paged' value='%s' size='%d' aria-describedby='table-paging' />",
665 - '<label for="current-page-selector" class="screen-reader-text">' . esc_html__( 'Current Page', 'formidable' ) . '</label>',
634 + '<label for="current-page-selector" class="screen-reader-text">' . __( 'Current Page', 'formidable' ) . '</label>',
666 635 $current,
667 636 strlen( $total_pages )
668 637 );
669 638 }
670 -
671 639 $html_total_pages = sprintf( "<span class='total-pages'>%s</span>", number_format_i18n( $total_pages ) );
672 640
673 641 /* translators: %1$s: Current page number, %2$s: Total pages */
674 642 $page_links[] = $total_pages_before . sprintf( _x( '%1$s of %2$s', 'paging', 'formidable' ), $html_current_page, $html_total_pages ) . $total_pages_after;
@@ -691,15 +659,13 @@
691 659 )
692 660 );
693 661
694 662 $pagination_links_class = 'pagination-links';
695 -
696 - if ( $infinite_scroll ) {
663 + if ( ! empty( $infinite_scroll ) ) {
697 664 $pagination_links_class = ' hide-if-js';
698 665 }
666 + $output .= "\n" . '<span class="' . esc_attr( $pagination_links_class ) . '">' . join( "\n", $page_links ) . '</span>';
699 667
700 - $output .= "\n" . '<span class="' . esc_attr( $pagination_links_class ) . '">' . implode( "\n", $page_links ) . '</span>';
701 -
702 668 if ( $total_pages ) {
703 669 $page_class = $total_pages < 2 ? ' one-page' : '';
704 670 } else {
705 671 $page_class = ' no-pages';
@@ -708,13 +674,8 @@
708 674
709 675 echo $this->_pagination; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
710 676 }
711 677
712 - /**
713 - * @param int $total_pages
714 - *
715 - * @return array
716 - */
717 678 private function disabled_pages( $total_pages ) {
718 679 $current = $this->get_pagenum();
719 680 $disable = array(
720 681 'first' => false,
@@ -722,21 +683,19 @@
722 683 'prev' => false,
723 684 'next' => false,
724 685 );
725 686
726 - // phpcs:ignore Universal.Operators.StrictComparisons
727 687 if ( $current == 1 ) {
728 688 $disable['first'] = true;
729 689 $disable['prev'] = true;
730 - } elseif ( $current == 2 ) { // phpcs:ignore Universal.Operators.StrictComparisons
690 + } elseif ( $current == 2 ) {
731 691 $disable['first'] = true;
732 692 }
733 693
734 - // phpcs:ignore Universal.Operators.StrictComparisons
735 694 if ( $current == $total_pages ) {
736 695 $disable['last'] = true;
737 696 $disable['next'] = true;
738 - } elseif ( $current == $total_pages - 1 ) { // phpcs:ignore Universal.Operators.StrictComparisons
697 + } elseif ( $current == $total_pages - 1 ) {
739 698 $disable['last'] = true;
740 699 }
741 700
742 701 return $disable;
@@ -741,13 +700,8 @@
741 700
742 701 return $disable;
743 702 }
744 703
745 - /**
746 - * @param string $link
747 - *
748 - * @return string
749 - */
750 704 private function link_label( $link ) {
751 705 $labels = array(
752 706 'first' => __( 'First page', 'formidable' ),
753 707 'last' => __( 'Last page', 'formidable' ),
@@ -759,34 +713,26 @@
759 713 }
760 714
761 715 private function current_url() {
762 716 $current_url = set_url_scheme( 'http://' . FrmAppHelper::get_server_value( 'HTTP_HOST' ) . FrmAppHelper::get_server_value( 'REQUEST_URI' ) );
717 +
763 718 return remove_query_arg( array( 'hotkeys_highlight_last', 'hotkeys_highlight_first' ), $current_url );
764 719 }
765 720
766 - /**
767 - * @param array $atts
768 - *
769 - * @return string
770 - */
771 721 private function add_page_link( $atts ) {
772 - return $atts['disabled'] ? $this->add_disabled_link( $atts['arrow'] ) : $this->add_active_link( $atts );
722 + if ( $atts['disabled'] ) {
723 + $link = $this->add_disabled_link( $atts['arrow'] );
724 + } else {
725 + $link = $this->add_active_link( $atts );
726 + }
727 +
728 + return $link;
773 729 }
774 730
775 - /**
776 - * @param string $label
777 - *
778 - * @return string
779 - */
780 731 private function add_disabled_link( $label ) {
781 732 return '<span class="tablenav-pages-navspan button disabled" aria-hidden="true">' . $label . '</span>';
782 733 }
783 734
784 - /**
785 - * @param array $atts
786 - *
787 - * @return string
788 - */
789 735 private function add_active_link( $atts ) {
790 736 $url = esc_url( add_query_arg( 'paged', $atts['number'], $this->current_url() ) );
791 737 $label = $this->link_label( $atts['page'] );
792 738
@@ -807,8 +753,9 @@
807 753 *
808 754 * The second format will make the initial sorting order be descending
809 755 *
810 756 * @since 2.0.18
757 + * @access protected
811 758 *
812 759 * @return array
813 760 */
814 761 protected function get_sortable_columns() {
@@ -818,8 +765,9 @@
818 765 /**
819 766 * Gets the name of the default primary column.
820 767 *
821 768 * @since 4.3.0
769 + * @access protected
822 770 *
823 771 * @return string Name of the default primary column, in this case, an empty string.
824 772 */
825 773 protected function get_default_primary_column_name() {
@@ -826,9 +774,9 @@
826 774 $columns = $this->get_columns();
827 775 $column = '';
828 776
829 777 // We need a primary defined so responsive views show something,
830 - // So let's fall back to the first non-checkbox column.
778 + // so let's fall back to the first non-checkbox column.
831 779 foreach ( $columns as $col => $column_name ) {
832 780 if ( 'cb' === $col ) {
833 781 continue;
834 782 }
@@ -843,8 +791,9 @@
843 791 /**
844 792 * Gets the name of the primary column.
845 793 *
846 794 * @since 4.3.0
795 + * @access protected
847 796 *
848 797 * @return string The name of the primary column.
849 798 */
850 799 protected function get_primary_column_name() {
@@ -851,9 +800,9 @@
851 800 $columns = $this->get_columns();
852 801 $default = $this->get_default_primary_column_name();
853 802
854 803 // If the primary column doesn't exist fall back to the
855 - // First non-checkbox column.
804 + // first non-checkbox column.
856 805 if ( ! isset( $columns[ $default ] ) ) {
857 806 $default = self::get_default_primary_column_name();
858 807 }
859 808
@@ -866,10 +815,10 @@
866 815 * @param string $context Screen ID for specific list table, e.g. 'plugins'.
867 816 */
868 817 $column = apply_filters( 'list_table_primary_column', $default, $this->screen->id );
869 818
870 - if ( ! $column || ! isset( $columns[ $column ] ) ) {
871 - return $default;
819 + if ( empty( $column ) || ! isset( $columns[ $column ] ) ) {
820 + $column = $default;
872 821 }
873 822
874 823 return $column;
875 824 }
@@ -877,18 +826,18 @@
877 826 /**
878 827 * Get a list of all, hidden and sortable columns, with filter applied
879 828 *
880 829 * @since 2.0.18
830 + * @access protected
881 831 *
882 832 * @return array
883 833 */
884 834 protected function get_column_info() {
885 835 // $_column_headers is already set / cached
886 - if ( is_array( $this->_column_headers ) ) {
836 + if ( isset( $this->_column_headers ) && is_array( $this->_column_headers ) ) {
887 837 // Back-compat for list tables that have been manually setting $_column_headers for horse reasons.
888 838 // In 4.3, we added a fourth argument for primary column.
889 839 $column_headers = array( array(), array(), array(), $this->get_primary_column_name() );
890 -
891 840 foreach ( $this->_column_headers as $key => $value ) {
892 841 $column_headers[ $key ] = $value;
893 842 }
894 843
@@ -894,10 +843,11 @@
894 843
895 844 return $column_headers;
896 845 }
897 846
898 - $columns = get_column_headers( $this->screen );
899 - $hidden = get_hidden_columns( $this->screen );
847 + $columns = get_column_headers( $this->screen );
848 + $hidden = get_hidden_columns( $this->screen );
849 +
900 850 $sortable_columns = $this->get_sortable_columns();
901 851 /**
902 852 * Filter the list table sortable columns for a specific screen.
903 853 *
@@ -910,16 +860,14 @@
910 860 */
911 861 $_sortable = apply_filters( "manage_{$this->screen->id}_sortable_columns", $sortable_columns );
912 862
913 863 $sortable = array();
914 -
915 864 foreach ( $_sortable as $id => $data ) {
916 - if ( ! $data ) {
865 + if ( empty( $data ) ) {
917 866 continue;
918 867 }
919 868
920 869 $data = (array) $data;
921 -
922 870 if ( ! isset( $data[1] ) ) {
923 871 $data[1] = false;
924 872 }
925 873
@@ -936,14 +884,15 @@
936 884 /**
937 885 * Return number of visible columns
938 886 *
939 887 * @since 2.0.18
888 + * @access public
940 889 *
941 890 * @return int
942 891 */
943 892 public function get_column_count() {
944 893 list ( $columns, $hidden ) = $this->get_column_info();
945 - $hidden = array_intersect( array_keys( $columns ), array_filter( $hidden ) );
894 + $hidden = array_intersect( array_keys( $columns ), array_filter( $hidden ) );
946 895
947 896 return count( $columns ) - count( $hidden );
948 897 }
949 898
@@ -950,49 +899,53 @@
950 899 /**
951 900 * Print column headers, accounting for hidden and sortable columns.
952 901 *
953 902 * @since 2.0.18
903 + * @access public
954 904 *
955 905 * @staticvar int $cb_counter
956 906 *
957 - * @param bool $with_id Whether to set the id attribute or not.
958 - *
959 - * @return void
907 + * @param bool $with_id Whether to set the id attribute or not
960 908 */
961 - public function print_column_headers( $with_id = true ) { // phpcs:ignore SlevomatCodingStandard.Complexity.Cognitive.ComplexityTooHigh, Generic.Metrics.CyclomaticComplexity.MaxExceeded, SlevomatCodingStandard.Files.LineLength.LineTooLong
909 + public function print_column_headers( $with_id = true ) {
962 910 list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();
963 911
964 - $current_url = set_url_scheme( 'http://' . FrmAppHelper::get_server_value( 'HTTP_HOST' ) . FrmAppHelper::get_server_value( 'REQUEST_URI' ) );
965 - $current_url = remove_query_arg( 'paged', $current_url );
966 - $current_orderby = isset( $_GET['orderby'] ) ? sanitize_text_field( wp_unslash( $_GET['orderby'] ) ) : '';
967 - $current_order = isset( $_GET['order'] ) && 'desc' === $_GET['order'] ? 'desc' : 'asc';
912 + $current_url = set_url_scheme( 'http://' . FrmAppHelper::get_server_value( 'HTTP_HOST' ) . FrmAppHelper::get_server_value( 'REQUEST_URI' ) );
913 + $current_url = remove_query_arg( 'paged', $current_url );
968 914
969 - FrmAppController::apply_saved_sort_preference( $current_orderby, $current_order );
915 + if ( isset( $_GET['orderby'] ) ) {
916 + $current_orderby = sanitize_text_field( wp_unslash( $_GET['orderby'] ) );
917 + } else {
918 + $current_orderby = '';
919 + }
970 920
921 + if ( isset( $_GET['order'] ) && 'desc' == $_GET['order'] ) {
922 + $current_order = 'desc';
923 + } else {
924 + $current_order = 'asc';
925 + }
926 +
971 927 if ( ! empty( $columns['cb'] ) ) {
972 928 static $cb_counter = 1;
973 - $columns['cb'] = '<label class="screen-reader-text" for="cb-select-all-' . $cb_counter . '">' . esc_html__( 'Select All', 'formidable' ) . '</label>';
974 - $columns['cb'] .= '<input id="cb-select-all-' . esc_attr( $cb_counter ) . '" type="checkbox" />';
975 - ++$cb_counter;
929 + $columns['cb'] = '<label class="screen-reader-text" for="cb-select-all-' . $cb_counter . '">' . __( 'Select All', 'formidable' ) . '</label>';
930 + $columns['cb'] .= '<input id="cb-select-all-' . esc_attr( $cb_counter ) . '" type="checkbox" />';
931 + $cb_counter ++;
976 932 }
977 933
978 934 foreach ( $columns as $column_key => $column_display_name ) {
979 - $class = array( 'manage-column', "column-$column_key" );
980 - $aria_sort_attr = '';
981 - $order_text = '';
935 + $class = array( 'manage-column', "column-$column_key" );
982 936
983 - // phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict
984 937 if ( in_array( $column_key, $hidden ) ) {
985 938 $class[] = 'hidden';
986 939 }
987 940
988 - if ( 'cb' === $column_key ) {
941 + if ( 'cb' == $column_key ) {
989 942 $class[] = 'check-column';
990 - } elseif ( in_array( $column_key, array( 'posts', 'comments', 'links' ), true ) ) {
943 + } elseif ( in_array( $column_key, array( 'posts', 'comments', 'links' ) ) ) {
991 944 $class[] = 'num';
992 945 }
993 946
994 - if ( $column_key === $primary || $column_key === 'name' ) {
947 + if ( $column_key === $primary ) {
995 948 $class[] = 'column-primary';
996 949 }
997 950
998 951 if ( isset( $sortable[ $column_key ] ) ) {
@@ -997,19 +950,10 @@
997 950
998 951 if ( isset( $sortable[ $column_key ] ) ) {
999 952 list( $orderby, $desc_first ) = $sortable[ $column_key ];
1000 953
1001 - // phpcs:ignore Universal.Operators.StrictComparisons
1002 954 if ( $current_orderby == $orderby ) {
1003 - // The sorted column. The `aria-sort` attribute must be set only on the sorted column.
1004 - if ( 'asc' === $current_order ) {
1005 - $order = 'desc';
1006 - $aria_sort_attr = ' aria-sort="ascending"';
1007 - } else {
1008 - $order = 'asc';
1009 - $aria_sort_attr = ' aria-sort="descending"';
1010 - }
1011 -
955 + $order = 'asc' == $current_order ? 'desc' : 'asc';
1012 956 $class[] = 'sorted';
1013 957 $class[] = $current_order;
1014 958 } else {
1015 959 $order = $desc_first ? 'desc' : 'asc';
@@ -1014,41 +958,19 @@
1014 958 } else {
1015 959 $order = $desc_first ? 'desc' : 'asc';
1016 960 $class[] = 'sortable';
1017 961 $class[] = $desc_first ? 'asc' : 'desc';
1018 -
1019 - /* translators: Hidden accessibility text. */
1020 - $asc_text = __( 'Sort ascending.', 'formidable' );
1021 - /* translators: Hidden accessibility text. */
1022 - $desc_text = __( 'Sort descending.', 'formidable' );
1023 - $order_text = 'asc' === $order ? $asc_text : $desc_text;
1024 - }//end if
1025 -
1026 - if ( '' !== $order_text ) {
1027 - $order_text = ' <span class="screen-reader-text">' . $order_text . '</span>';
1028 962 }
1029 963
1030 - $column_display_name = sprintf(
1031 - '<a href="%1$s">' .
1032 - '<span>%2$s</span>' .
1033 - '<span class="sorting-indicators">' .
1034 - '<span class="sorting-indicator asc" aria-hidden="true"></span>' .
1035 - '<span class="sorting-indicator desc" aria-hidden="true"></span>' .
1036 - '</span>' .
1037 - '%3$s' .
1038 - '</a>',
1039 - esc_url( add_query_arg( compact( 'orderby', 'order' ), $current_url ) ),
1040 - $column_display_name,
1041 - $order_text
1042 - );
1043 - }//end if
964 + $column_display_name = '<a href="' . esc_url( add_query_arg( compact( 'orderby', 'order' ), $current_url ) ) . '"><span>' . esc_html( $column_display_name ) . '</span><span class="sorting-indicator"></span></a>';
965 + }
1044 966
1045 - $tag = 'cb' === $column_key ? 'td' : 'th';
1046 - $scope = 'th' === $tag ? 'scope="col"' : '';
967 + $tag = ( 'cb' === $column_key ) ? 'td' : 'th';
968 + $scope = ( 'th' === $tag ) ? 'scope="col"' : '';
1047 969 $id = $with_id ? "id='" . esc_attr( $column_key ) . "'" : '';
1048 970
1049 - if ( $class ) {
1050 - $class = "class='" . esc_attr( implode( ' ', $class ) ) . "'";
971 + if ( ! empty( $class ) ) {
972 + $class = "class='" . esc_attr( join( ' ', $class ) ) . "'";
1051 973 }
1052 974
1053 975 if ( ! $this->has_min_items() && ! $with_id ) {
1054 976 // Hide the labels but show the border.
@@ -1053,10 +975,10 @@
1053 975 if ( ! $this->has_min_items() && ! $with_id ) {
1054 976 // Hide the labels but show the border.
1055 977 $column_display_name = '';
1056 978 }
1057 - echo "<$tag $scope $id $class $aria_sort_attr>$column_display_name</$tag>"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
1058 - }//end foreach
979 + echo "<$tag $scope $id $class>$column_display_name</$tag>"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
980 + }
1059 981 }
1060 982
1061 983 /**
1062 984 * Display the table
@@ -1061,27 +983,18 @@
1061 983 /**
1062 984 * Display the table
1063 985 *
1064 986 * @since 2.0.18
1065 - *
1066 - * @param array $args
1067 - *
1068 - * @return void
987 + * @access public
1069 988 */
1070 - public function display( $args = array() ) {
989 + public function display() {
1071 990 $singular = $this->_args['singular'];
1072 991 $tbody_params = array();
1073 -
1074 992 if ( $singular ) {
1075 993 $tbody_params['data-wp-lists'] = 'list:' . $singular;
1076 994 }
1077 995
1078 - if ( $this->should_display( $args, 'display-top-nav' ) ) {
1079 - $this->display_tablenav( 'top' );
1080 - }
1081 - $this->screen->render_screen_reader_content( 'heading_list' );
1082 -
1083 - // phpcs:disable Generic.WhiteSpace.ScopeIndent
996 + $this->display_tablenav( 'top' );
1084 997 ?>
1085 998 <table class="wp-list-table <?php echo esc_attr( implode( ' ', $this->get_table_classes() ) ); ?>">
1086 999 <?php if ( $this->has_min_items( 1 ) ) { ?>
1087 1000 <thead>
@@ -1094,9 +1007,9 @@
1094 1007 <tbody id="the-list"<?php FrmAppHelper::array_to_html_params( $tbody_params, true ); ?>>
1095 1008 <?php $this->display_rows_or_placeholder(); ?>
1096 1009 </tbody>
1097 1010
1098 - <?php if ( $this->has_min_items( 1 ) && $this->should_display( $args, 'display-bottom-headers' ) ) { ?>
1011 + <?php if ( $this->has_min_items( 1 ) ) { ?>
1099 1012 <tfoot>
1100 1013 <tr>
1101 1014 <?php $this->print_column_headers( false ); ?>
1102 1015 </tr>
@@ -1103,31 +1016,16 @@
1103 1016 </tfoot>
1104 1017 <?php } ?>
1105 1018 </table>
1106 1019 <?php
1107 - // phpcs:enable Generic.WhiteSpace.ScopeIndent
1108 -
1109 - if ( $this->should_display( $args, 'display-bottom-nav' ) ) {
1110 - $this->display_tablenav( 'bottom' );
1111 - }
1020 + $this->display_tablenav( 'bottom' );
1112 1021 }
1113 1022
1114 1023 /**
1115 - * Determines if a particular feature or element should be displayed.
1116 - *
1117 - * @param array $args An associative array of arguments.
1118 - * @param string $settings The specific setting key to check within the arguments array.
1119 - *
1120 - * @return bool Returns true if the setting is not set or if it is not false; otherwise, returns false.
1121 - */
1122 - protected function should_display( $args, $settings ) {
1123 - return ! isset( $args[ $settings ] ) || false !== $args[ $settings ];
1124 - }
1125 -
1126 - /**
1127 1024 * Get a list of CSS classes for the list table table tag.
1128 1025 *
1129 1026 * @since 2.0.18
1027 + * @access protected
1130 1028 *
1131 1029 * @return array List of CSS classes for the table tag.
1132 1030 */
1133 1031 protected function get_table_classes() {
@@ -1137,8 +1035,9 @@
1137 1035 /**
1138 1036 * Generate the table navigation above or below the table
1139 1037 *
1140 1038 * @since 2.0.18
1039 + * @access protected
1141 1040 *
1142 1041 * @param string $which
1143 1042 */
1144 1043 protected function display_tablenav( $which ) {
@@ -1143,18 +1042,16 @@
1143 1042 */
1144 1043 protected function display_tablenav( $which ) {
1145 1044 if ( 'top' === $which ) {
1146 1045 wp_nonce_field( 'bulk-' . $this->_args['plural'], '_wpnonce', false );
1147 -
1148 1046 if ( ! $this->has_min_items( 1 ) ) {
1149 1047 // Don't show bulk actions if no items.
1150 1048 return;
1151 1049 }
1152 1050 } elseif ( ! $this->has_min_items() ) {
1153 - // Don't show the bulk actions when there aren't many rows.
1051 + // don't show the bulk actions when there aren't many rows.
1154 1052 return;
1155 1053 }
1156 - // phpcs:disable Generic.WhiteSpace.ScopeIndent
1157 1054 ?>
1158 1055 <div class="tablenav <?php echo esc_attr( $which ); ?>">
1159 1056
1160 1057 <div class="alignleft actions bulkactions">
@@ -1167,9 +1064,8 @@
1167 1064
1168 1065 <br class="clear"/>
1169 1066 </div>
1170 1067 <?php
1171 - // phpcs:enable Generic.WhiteSpace.ScopeIndent
1172 1068 }
1173 1069
1174 1070 /**
1175 1071 * Use this to exclude the footer labels and bulk items.
@@ -1175,12 +1071,8 @@
1175 1071 * Use this to exclude the footer labels and bulk items.
1176 1072 * When close together, it feels like duplicates.
1177 1073 *
1178 1074 * @since 4.07
1179 - *
1180 - * @param int $limit
1181 - *
1182 - * @return bool
1183 1075 */
1184 1076 protected function has_min_items( $limit = 5 ) {
1185 1077 return $this->has_items() && ( $this->total_items === false || $this->total_items >= $limit );
1186 1078 }
@@ -1188,8 +1080,9 @@
1188 1080 /**
1189 1081 * Extra controls to be displayed between bulk actions and pagination
1190 1082 *
1191 1083 * @since 2.0.18
1084 + * @access protected
1192 1085 *
1193 1086 * @param string $which
1194 1087 */
1195 1088 protected function extra_tablenav( $which ) {
@@ -1198,8 +1091,9 @@
1198 1091 /**
1199 1092 * Generate the tbody element for the list table.
1200 1093 *
1201 1094 * @since 2.0.18
1095 + * @access public
1202 1096 */
1203 1097 public function display_rows_or_placeholder() {
1204 1098 if ( $this->has_items() ) {
1205 1099 $this->display_rows();
@@ -1213,10 +1107,11 @@
1213 1107 /**
1214 1108 * Generates content for a single row of the table
1215 1109 *
1216 1110 * @since 2.0.18
1111 + * @access public
1217 1112 *
1218 - * @param object $item The current item.
1113 + * @param object $item The current item
1219 1114 */
1220 1115 public function single_row( $item ) {
1221 1116 echo '<tr>';
1222 1117 $this->single_row_columns( $item );
@@ -1226,10 +1121,11 @@
1226 1121 /**
1227 1122 * Generates the columns for a single row of the table
1228 1123 *
1229 1124 * @since 2.0.18
1125 + * @access protected
1230 1126 *
1231 - * @param object $item The current item.
1127 + * @param object $item The current item
1232 1128 */
1233 1129 protected function single_row_columns( $item ) {
1234 1130 list( $columns, $hidden,, $primary ) = $this->get_column_info();
1235 1131
@@ -1234,14 +1130,12 @@
1234 1130 list( $columns, $hidden,, $primary ) = $this->get_column_info();
1235 1131
1236 1132 foreach ( $columns as $column_name => $column_display_name ) {
1237 1133 $classes = "$column_name column-$column_name";
1238 -
1239 1134 if ( $primary === $column_name ) {
1240 1135 $classes .= ' has-row-actions column-primary';
1241 1136 }
1242 1137
1243 - // phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict
1244 1138 if ( in_array( $column_name, $hidden ) ) {
1245 1139 $classes .= ' hidden';
1246 1140 }
1247 1141
@@ -1265,9 +1159,9 @@
1265 1159
1266 1160 echo $this->handle_row_actions( $item, $column_name, $primary ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
1267 1161 echo '</td>';
1268 1162 }
1269 - }//end foreach
1163 + }
1270 1164 }
1271 1165
1272 1166 /**
1273 1167 * Generates and display row actions links for the list table.
@@ -1272,8 +1166,9 @@
1272 1166 /**
1273 1167 * Generates and display row actions links for the list table.
1274 1168 *
1275 1169 * @since 4.3.0
1170 + * @access protected
1276 1171 *
1277 1172 * @param object $item The item being acted upon.
1278 1173 * @param string $column_name Current column name.
1279 1174 * @param string $primary Primary column name.
@@ -1280,9 +1175,9 @@
1280 1175 *
1281 1176 * @return string The row actions output. In this case, an empty string.
1282 1177 */
1283 1178 protected function handle_row_actions( $item, $column_name, $primary ) {
1284 - return $column_name == $primary ? '<button type="button" class="toggle-row"><span class="screen-reader-text">' . esc_html__( 'Show more details', 'formidable' ) . '</span></button>' : ''; // phpcs:ignore Universal.Operators.StrictComparisons, SlevomatCodingStandard.Files.LineLength.LineTooLong
1179 + return $column_name == $primary ? '<button type="button" class="toggle-row"><span class="screen-reader-text">' . esc_html__( 'Show more details', 'formidable' ) . '</span></button>' : '';
1285 1180 }
1286 1181
1287 1182 /**
1288 1183 * Handle an incoming ajax request (called from admin-ajax.php)
@@ -1287,14 +1182,14 @@
1287 1182 /**
1288 1183 * Handle an incoming ajax request (called from admin-ajax.php)
1289 1184 *
1290 1185 * @since 2.0.18
1186 + * @access public
1291 1187 */
1292 1188 public function ajax_response() {
1293 1189 $this->prepare_items();
1294 1190
1295 1191 ob_start();
1296 -
1297 1192 if ( ! empty( $_REQUEST['no_placeholder'] ) ) {
1298 1193 $this->display_rows();
1299 1194 } else {
1300 1195 $this->display_rows_or_placeholder();
@@ -1299,9 +1194,10 @@
1299 1194 } else {
1300 1195 $this->display_rows_or_placeholder();
1301 1196 }
1302 1197
1303 - $rows = ob_get_clean();
1198 + $rows = ob_get_clean();
1199 +
1304 1200 $response = array( 'rows' => $rows );
1305 1201
1306 1202 if ( isset( $this->_pagination_args['total_items'] ) ) {
1307 1203 $response['total_items_i18n'] = sprintf(
@@ -1309,9 +1205,8 @@
1309 1205 _n( '%s item', '%s items', $this->_pagination_args['total_items'], 'formidable' ),
1310 1206 number_format_i18n( $this->_pagination_args['total_items'] )
1311 1207 );
1312 1208 }
1313 -
1314 1209 if ( isset( $this->_pagination_args['total_pages'] ) ) {
1315 1210 $response['total_pages'] = $this->_pagination_args['total_pages'];
1316 1211 $response['total_pages_i18n'] = number_format_i18n( $this->_pagination_args['total_pages'] );
1317 1212 }
@@ -1321,9 +1216,9 @@
1321 1216
1322 1217 /**
1323 1218 * Send required variables to JavaScript land
1324 1219 *
1325 - * @return void
1220 + * @access public
1326 1221 */
1327 1222 public function _js_vars() {
1328 1223 $args = array(
1329 1224 'class' => get_class( $this ),
@@ -1333,13 +1228,6 @@
1333 1228 ),
1334 1229 );
1335 1230
1336 1231 printf( "<script type='text/javascript'>list_args = %s;</script>\n", wp_json_encode( $args ) );
1337 - }
1338 -
1339 - /**
1340 - * @return string
1341 - */
1342 - protected function loaded_from() {
1343 - return '';
1344 1232 }
1345 1233 }