PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 5.1
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v5.1
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 +93 -118 6.255.1 View file →
@@ -8,14 +8,14 @@
8 8 * The current list of items
9 9 *
10 10 * @since 2.0.18
11 11 * @var array
12 + * @access public
12 13 */
13 14 public $items;
14 15
15 16 /**
16 17 * @since 4.07
17 - * @var bool|int
18 18 */
19 19 public $total_items = false;
20 20
21 21 /**
@@ -22,8 +22,9 @@
22 22 * Various information about the current table
23 23 *
24 24 * @since 2.0.18
25 25 * @var array
26 + * @access protected
26 27 */
27 28 protected $_args;
28 29
29 30 /**
@@ -37,10 +38,10 @@
37 38 /**
38 39 * The current screen
39 40 *
40 41 * @since 2.0.18
41 - *
42 - * @var \WP_Screen
42 + * @var object
43 + * @access protected
43 44 */
44 45 protected $screen;
45 46
46 47 /**
@@ -47,8 +48,9 @@
47 48 * Cached bulk actions
48 49 *
49 50 * @since 2.0.18
50 51 * @var array
52 + * @access private
51 53 */
52 54 private $_actions;
53 55
54 56 /**
@@ -55,8 +57,9 @@
55 57 * Cached pagination output
56 58 *
57 59 * @since 2.0.18
58 60 * @var string
61 + * @access private
59 62 */
60 63 private $_pagination;
61 64
62 65 /**
@@ -63,12 +66,14 @@
63 66 * The view switcher modes.
64 67 *
65 68 * @since 2.0.18
66 69 * @var array
70 + * @access protected
67 71 */
68 72 protected $modes = array();
69 73
70 74 /**
75 + *
71 76 * @var array
72 77 */
73 78 protected $params;
74 79
@@ -160,8 +165,9 @@
160 165 *
161 166 * @uses FrmListHelper::set_pagination_args()
162 167 *
163 168 * @since 2.0.18
169 + * @access public
164 170 * @abstract
165 171 */
166 172 public function prepare_items() {
167 173 die( 'function FrmListHelper::prepare_items() must be over-ridden in a sub-class.' );
@@ -173,10 +179,10 @@
173 179 protected function get_param( $args ) {
174 180 return FrmAppHelper::get_simple_request(
175 181 array(
176 182 'param' => $args['param'],
177 - 'default' => $args['default'] ?? '',
178 - 'sanitize' => $args['sanitize'] ?? 'sanitize_title',
183 + 'default' => isset( $args['default'] ) ? $args['default'] : '',
184 + 'sanitize' => isset( $args['sanitize'] ) ? $args['sanitize'] : 'sanitize_title',
179 185 'type' => 'request',
180 186 )
181 187 );
182 188 }
@@ -183,9 +189,13 @@
183 189
184 190 /**
185 191 * An internal method that sets all the necessary pagination arguments
186 192 *
187 - * @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
188 198 */
189 199 protected function set_pagination_args( $args ) {
190 200 $args = wp_parse_args(
191 201 $args,
@@ -212,8 +222,9 @@
212 222 /**
213 223 * Access the pagination args.
214 224 *
215 225 * @since 2.0.18
226 + * @access public
216 227 *
217 228 * @param string $key Pagination argument to retrieve. Common values include 'total_items',
218 229 * 'total_pages', 'per_page', or 'infinite_scroll'.
219 230 *
@@ -232,8 +243,9 @@
232 243 /**
233 244 * Whether the table has items to display or not
234 245 *
235 246 * @since 2.0.18
247 + * @access public
236 248 *
237 249 * @return bool
238 250 */
239 251 public function has_items() {
@@ -243,8 +255,9 @@
243 255 /**
244 256 * Message to be displayed when there are no items
245 257 *
246 258 * @since 2.0.18
259 + * @access public
247 260 */
248 261 public function no_items() {
249 262 esc_html_e( 'No items found.', 'formidable' );
250 263 }
@@ -252,11 +265,12 @@
252 265 /**
253 266 * Display the search box.
254 267 *
255 268 * @since 2.0.18
269 + * @access public
256 270 *
257 - * @param string $text The search button text.
258 - * @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
259 273 */
260 274 public function search_box( $text, $input_id ) {
261 275 if ( empty( $_REQUEST['s'] ) && ! $this->has_items() ) {
262 276 return;
@@ -280,8 +294,9 @@
280 294 * Get an associative array ( id => link ) with the list
281 295 * of views available on this table.
282 296 *
283 297 * @since 2.0.18
298 + * @access protected
284 299 *
285 300 * @return array
286 301 */
287 302 protected function get_views() {
@@ -291,8 +306,9 @@
291 306 /**
292 307 * Display the list of views available on this table.
293 308 *
294 309 * @since 2.0.18
310 + * @access public
295 311 */
296 312 public function views() {
297 313 $views = $this->get_views();
298 314 /**
@@ -323,8 +339,9 @@
323 339 * Get an associative array ( option_name => option_title ) with the list
324 340 * of bulk actions available on this table.
325 341 *
326 342 * @since 2.0.18
343 + * @access protected
327 344 *
328 345 * @return array
329 346 */
330 347 protected function get_bulk_actions() {
@@ -334,8 +351,9 @@
334 351 /**
335 352 * Display the bulk actions dropdown.
336 353 *
337 354 * @since 2.0.18
355 + * @access protected
338 356 *
339 357 * @param string $which The location of the bulk actions: 'top' or 'bottom'.
340 358 * This is designated as optional for backwards-compatibility.
341 359 */
@@ -361,17 +379,17 @@
361 379
362 380 $two = '';
363 381 } else {
364 382 $two = '2';
365 - }//end if
383 + }
366 384
367 385 if ( empty( $this->_actions ) ) {
368 386 return;
369 387 }
370 388
371 - 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>';
372 390 echo "<select name='action" . esc_attr( $two ) . "' id='bulk-action-selector-" . esc_attr( $which ) . "'>\n";
373 - 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";
374 392
375 393 foreach ( $this->_actions as $name => $title ) {
376 394 $params = array(
377 395 'value' => $name,
@@ -390,21 +408,9 @@
390 408 if ( isset( $this->_actions['bulk_delete'] ) ) {
391 409 $verify = $this->confirm_bulk_delete();
392 410
393 411 if ( $verify ) {
394 - $confirm_delete_attributes = array(
395 - 'id' => 'confirm-bulk-delete-' . $which,
396 - 'class' => 'frm-hidden',
397 - 'tabindex' => '-1',
398 - 'aria-hidden' => 'true',
399 - 'href' => 'confirm-bulk-delete',
400 - 'data-loaded-from' => $this->loaded_from(),
401 - 'data-frmverify' => $verify,
402 - 'data-frmverify-btn' => 'frm-button-red',
403 - );
404 -
405 - // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
406 - 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>";
407 413 }
408 414 }
409 415
410 416 submit_button( __( 'Apply', 'formidable' ), 'action', '', false, array( 'id' => "doaction$two" ) );
@@ -421,13 +427,14 @@
421 427 /**
422 428 * Get the current action selected from the bulk actions dropdown.
423 429 *
424 430 * @since 2.0.18
431 + * @access public
425 432 *
426 - * @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
427 434 */
428 435 public function current_action() {
429 - if ( ! empty( $_REQUEST['filter_action'] ) ) {
436 + if ( isset( $_REQUEST['filter_action'] ) && ! empty( $_REQUEST['filter_action'] ) ) {
430 437 return false;
431 438 }
432 439
433 440 $action = $this->get_bulk_action( 'action' );
@@ -456,11 +463,12 @@
456 463 /**
457 464 * Generate row actions div
458 465 *
459 466 * @since 2.0.18
467 + * @access protected
460 468 *
461 - * @param array $actions The list of actions.
462 - * @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
463 471 *
464 472 * @return string
465 473 */
466 474 protected function row_actions( $actions, $always_visible = false ) {
@@ -473,10 +481,10 @@
473 481 }
474 482
475 483 $out = '<div class="' . ( $always_visible ? 'row-actions visible' : 'row-actions' ) . '">';
476 484 foreach ( $actions as $action => $link ) {
477 - ++$i;
478 - $sep = $i == $action_count ? '' : ' | ';
485 + ++ $i;
486 + ( $i == $action_count ) ? $sep = '' : $sep = ' | ';
479 487 $out .= "<span class='$action'>$link$sep</span>";
480 488 }
481 489 $out .= '</div>';
482 490
@@ -488,8 +496,9 @@
488 496 /**
489 497 * Display a view switcher
490 498 *
491 499 * @since 2.0.18
500 + * @access protected
492 501 *
493 502 * @param string $current_mode
494 503 */
495 504 protected function view_switcher( $current_mode ) {
@@ -518,8 +527,9 @@
518 527 /**
519 528 * Get the current page number
520 529 *
521 530 * @since 2.0.18
531 + * @access public
522 532 *
523 533 * @return int
524 534 */
525 535 public function get_pagenum() {
@@ -535,11 +545,12 @@
535 545 /**
536 546 * Get number of items to display on a single page
537 547 *
538 548 * @since 2.0.18
549 + * @access protected
539 550 *
540 551 * @param string $option
541 - * @param int $default
552 + * @param int $default
542 553 *
543 554 * @return int
544 555 */
545 556 protected function get_items_per_page( $option, $default = 20 ) {
@@ -567,8 +578,9 @@
567 578 /**
568 579 * Display the pagination.
569 580 *
570 581 * @since 2.0.18
582 + * @access protected
571 583 *
572 584 * @param string $which
573 585 */
574 586 protected function pagination( $which ) {
@@ -650,9 +662,9 @@
650 662 $pagination_links_class = 'pagination-links';
651 663 if ( ! empty( $infinite_scroll ) ) {
652 664 $pagination_links_class = ' hide-if-js';
653 665 }
654 - $output .= "\n" . '<span class="' . esc_attr( $pagination_links_class ) . '">' . implode( "\n", $page_links ) . '</span>';
666 + $output .= "\n" . '<span class="' . esc_attr( $pagination_links_class ) . '">' . join( "\n", $page_links ) . '</span>';
655 667
656 668 if ( $total_pages ) {
657 669 $page_class = $total_pages < 2 ? ' one-page' : '';
658 670 } else {
@@ -741,8 +753,9 @@
741 753 *
742 754 * The second format will make the initial sorting order be descending
743 755 *
744 756 * @since 2.0.18
757 + * @access protected
745 758 *
746 759 * @return array
747 760 */
748 761 protected function get_sortable_columns() {
@@ -752,8 +765,9 @@
752 765 /**
753 766 * Gets the name of the default primary column.
754 767 *
755 768 * @since 4.3.0
769 + * @access protected
756 770 *
757 771 * @return string Name of the default primary column, in this case, an empty string.
758 772 */
759 773 protected function get_default_primary_column_name() {
@@ -777,8 +791,9 @@
777 791 /**
778 792 * Gets the name of the primary column.
779 793 *
780 794 * @since 4.3.0
795 + * @access protected
781 796 *
782 797 * @return string The name of the primary column.
783 798 */
784 799 protected function get_primary_column_name() {
@@ -811,14 +826,15 @@
811 826 /**
812 827 * Get a list of all, hidden and sortable columns, with filter applied
813 828 *
814 829 * @since 2.0.18
830 + * @access protected
815 831 *
816 832 * @return array
817 833 */
818 834 protected function get_column_info() {
819 835 // $_column_headers is already set / cached
820 - if ( is_array( $this->_column_headers ) ) {
836 + if ( isset( $this->_column_headers ) && is_array( $this->_column_headers ) ) {
821 837 // Back-compat for list tables that have been manually setting $_column_headers for horse reasons.
822 838 // In 4.3, we added a fourth argument for primary column.
823 839 $column_headers = array( array(), array(), array(), $this->get_primary_column_name() );
824 840 foreach ( $this->_column_headers as $key => $value ) {
@@ -868,14 +884,15 @@
868 884 /**
869 885 * Return number of visible columns
870 886 *
871 887 * @since 2.0.18
888 + * @access public
872 889 *
873 890 * @return int
874 891 */
875 892 public function get_column_count() {
876 893 list ( $columns, $hidden ) = $this->get_column_info();
877 - $hidden = array_intersect( array_keys( $columns ), array_filter( $hidden ) );
894 + $hidden = array_intersect( array_keys( $columns ), array_filter( $hidden ) );
878 895
879 896 return count( $columns ) - count( $hidden );
880 897 }
881 898
@@ -882,13 +899,13 @@
882 899 /**
883 900 * Print column headers, accounting for hidden and sortable columns.
884 901 *
885 902 * @since 2.0.18
903 + * @access public
886 904 *
887 905 * @staticvar int $cb_counter
888 906 *
889 - * @param bool $with_id Whether to set the id attribute or not.
890 - * @return void
907 + * @param bool $with_id Whether to set the id attribute or not
891 908 */
892 909 public function print_column_headers( $with_id = true ) {
893 910 list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();
894 911
@@ -906,33 +923,29 @@
906 923 } else {
907 924 $current_order = 'asc';
908 925 }
909 926
910 - FrmAppController::apply_saved_sort_preference( $current_orderby, $current_order );
911 -
912 927 if ( ! empty( $columns['cb'] ) ) {
913 928 static $cb_counter = 1;
914 - $columns['cb'] = '<label class="screen-reader-text" for="cb-select-all-' . $cb_counter . '">' . __( 'Select All', 'formidable' ) . '</label>';
915 - $columns['cb'] .= '<input id="cb-select-all-' . esc_attr( $cb_counter ) . '" type="checkbox" />';
916 - ++$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 ++;
917 932 }
918 933
919 934 foreach ( $columns as $column_key => $column_display_name ) {
920 - $class = array( 'manage-column', "column-$column_key" );
921 - $aria_sort_attr = '';
922 - $order_text = '';
935 + $class = array( 'manage-column', "column-$column_key" );
923 936
924 937 if ( in_array( $column_key, $hidden ) ) {
925 938 $class[] = 'hidden';
926 939 }
927 940
928 - if ( 'cb' === $column_key ) {
941 + if ( 'cb' == $column_key ) {
929 942 $class[] = 'check-column';
930 - } elseif ( in_array( $column_key, array( 'posts', 'comments', 'links' ), true ) ) {
943 + } elseif ( in_array( $column_key, array( 'posts', 'comments', 'links' ) ) ) {
931 944 $class[] = 'num';
932 945 }
933 946
934 - if ( $column_key === $primary || $column_key === 'name' ) {
947 + if ( $column_key === $primary ) {
935 948 $class[] = 'column-primary';
936 949 }
937 950
938 951 if ( isset( $sortable[ $column_key ] ) ) {
@@ -938,17 +951,9 @@
938 951 if ( isset( $sortable[ $column_key ] ) ) {
939 952 list( $orderby, $desc_first ) = $sortable[ $column_key ];
940 953
941 954 if ( $current_orderby == $orderby ) {
942 - // The sorted column. The `aria-sort` attribute must be set only on the sorted column.
943 - if ( 'asc' === $current_order ) {
944 - $order = 'desc';
945 - $aria_sort_attr = ' aria-sort="ascending"';
946 - } else {
947 - $order = 'asc';
948 - $aria_sort_attr = ' aria-sort="descending"';
949 - }
950 -
955 + $order = 'asc' == $current_order ? 'desc' : 'asc';
951 956 $class[] = 'sorted';
952 957 $class[] = $current_order;
953 958 } else {
954 959 $order = $desc_first ? 'desc' : 'asc';
@@ -953,41 +958,19 @@
953 958 } else {
954 959 $order = $desc_first ? 'desc' : 'asc';
955 960 $class[] = 'sortable';
956 961 $class[] = $desc_first ? 'asc' : 'desc';
957 -
958 - /* translators: Hidden accessibility text. */
959 - $asc_text = __( 'Sort ascending.', 'formidable' );
960 - /* translators: Hidden accessibility text. */
961 - $desc_text = __( 'Sort descending.', 'formidable' );
962 - $order_text = 'asc' === $order ? $asc_text : $desc_text;
963 - }//end if
964 -
965 - if ( '' !== $order_text ) {
966 - $order_text = ' <span class="screen-reader-text">' . $order_text . '</span>';
967 962 }
968 963
969 - $column_display_name = sprintf(
970 - '<a href="%1$s">' .
971 - '<span>%2$s</span>' .
972 - '<span class="sorting-indicators">' .
973 - '<span class="sorting-indicator asc" aria-hidden="true"></span>' .
974 - '<span class="sorting-indicator desc" aria-hidden="true"></span>' .
975 - '</span>' .
976 - '%3$s' .
977 - '</a>',
978 - esc_url( add_query_arg( compact( 'orderby', 'order' ), $current_url ) ),
979 - $column_display_name,
980 - $order_text
981 - );
982 - }//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 + }
983 966
984 - $tag = 'cb' === $column_key ? 'td' : 'th';
985 - $scope = 'th' === $tag ? 'scope="col"' : '';
967 + $tag = ( 'cb' === $column_key ) ? 'td' : 'th';
968 + $scope = ( 'th' === $tag ) ? 'scope="col"' : '';
986 969 $id = $with_id ? "id='" . esc_attr( $column_key ) . "'" : '';
987 970
988 971 if ( ! empty( $class ) ) {
989 - $class = "class='" . esc_attr( implode( ' ', $class ) ) . "'";
972 + $class = "class='" . esc_attr( join( ' ', $class ) ) . "'";
990 973 }
991 974
992 975 if ( ! $this->has_min_items() && ! $with_id ) {
993 976 // Hide the labels but show the border.
@@ -992,10 +975,10 @@
992 975 if ( ! $this->has_min_items() && ! $with_id ) {
993 976 // Hide the labels but show the border.
994 977 $column_display_name = '';
995 978 }
996 - echo "<$tag $scope $id $class $aria_sort_attr>$column_display_name</$tag>"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
997 - }//end foreach
979 + echo "<$tag $scope $id $class>$column_display_name</$tag>"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
980 + }
998 981 }
999 982
1000 983 /**
1001 984 * Display the table
@@ -1000,21 +983,18 @@
1000 983 /**
1001 984 * Display the table
1002 985 *
1003 986 * @since 2.0.18
1004 - * @param array $args
987 + * @access public
1005 988 */
1006 - public function display( $args = array() ) {
989 + public function display() {
1007 990 $singular = $this->_args['singular'];
1008 991 $tbody_params = array();
1009 992 if ( $singular ) {
1010 993 $tbody_params['data-wp-lists'] = 'list:' . $singular;
1011 994 }
1012 - if ( $this->should_display( $args, 'display-top-nav' ) ) {
1013 - $this->display_tablenav( 'top' );
1014 - }
1015 - $this->screen->render_screen_reader_content( 'heading_list' );
1016 995
996 + $this->display_tablenav( 'top' );
1017 997 ?>
1018 998 <table class="wp-list-table <?php echo esc_attr( implode( ' ', $this->get_table_classes() ) ); ?>">
1019 999 <?php if ( $this->has_min_items( 1 ) ) { ?>
1020 1000 <thead>
@@ -1027,9 +1007,9 @@
1027 1007 <tbody id="the-list"<?php FrmAppHelper::array_to_html_params( $tbody_params, true ); ?>>
1028 1008 <?php $this->display_rows_or_placeholder(); ?>
1029 1009 </tbody>
1030 1010
1031 - <?php if ( $this->has_min_items( 1 ) && $this->should_display( $args, 'display-bottom-headers' ) ) { ?>
1011 + <?php if ( $this->has_min_items( 1 ) ) { ?>
1032 1012 <tfoot>
1033 1013 <tr>
1034 1014 <?php $this->print_column_headers( false ); ?>
1035 1015 </tr>
@@ -1036,29 +1016,16 @@
1036 1016 </tfoot>
1037 1017 <?php } ?>
1038 1018 </table>
1039 1019 <?php
1040 - if ( $this->should_display( $args, 'display-bottom-nav' ) ) {
1041 - $this->display_tablenav( 'bottom' );
1042 - }
1020 + $this->display_tablenav( 'bottom' );
1043 1021 }
1044 1022
1045 1023 /**
1046 - * Determines if a particular feature or element should be displayed.
1047 - *
1048 - * @param array $args An associative array of arguments.
1049 - * @param string $settings The specific setting key to check within the arguments array.
1050 - *
1051 - * @return bool Returns true if the setting is not set or if it is not false; otherwise, returns false.
1052 - */
1053 - protected function should_display( $args, $settings ) {
1054 - return ! isset( $args[ $settings ] ) || false !== $args[ $settings ];
1055 - }
1056 -
1057 - /**
1058 1024 * Get a list of CSS classes for the list table table tag.
1059 1025 *
1060 1026 * @since 2.0.18
1027 + * @access protected
1061 1028 *
1062 1029 * @return array List of CSS classes for the table tag.
1063 1030 */
1064 1031 protected function get_table_classes() {
@@ -1068,8 +1035,9 @@
1068 1035 /**
1069 1036 * Generate the table navigation above or below the table
1070 1037 *
1071 1038 * @since 2.0.18
1039 + * @access protected
1072 1040 *
1073 1041 * @param string $which
1074 1042 */
1075 1043 protected function display_tablenav( $which ) {
@@ -1112,8 +1080,9 @@
1112 1080 /**
1113 1081 * Extra controls to be displayed between bulk actions and pagination
1114 1082 *
1115 1083 * @since 2.0.18
1084 + * @access protected
1116 1085 *
1117 1086 * @param string $which
1118 1087 */
1119 1088 protected function extra_tablenav( $which ) {
@@ -1122,8 +1091,9 @@
1122 1091 /**
1123 1092 * Generate the tbody element for the list table.
1124 1093 *
1125 1094 * @since 2.0.18
1095 + * @access public
1126 1096 */
1127 1097 public function display_rows_or_placeholder() {
1128 1098 if ( $this->has_items() ) {
1129 1099 $this->display_rows();
@@ -1137,10 +1107,11 @@
1137 1107 /**
1138 1108 * Generates content for a single row of the table
1139 1109 *
1140 1110 * @since 2.0.18
1111 + * @access public
1141 1112 *
1142 - * @param object $item The current item.
1113 + * @param object $item The current item
1143 1114 */
1144 1115 public function single_row( $item ) {
1145 1116 echo '<tr>';
1146 1117 $this->single_row_columns( $item );
@@ -1150,10 +1121,11 @@
1150 1121 /**
1151 1122 * Generates the columns for a single row of the table
1152 1123 *
1153 1124 * @since 2.0.18
1125 + * @access protected
1154 1126 *
1155 - * @param object $item The current item.
1127 + * @param object $item The current item
1156 1128 */
1157 1129 protected function single_row_columns( $item ) {
1158 1130 list( $columns, $hidden,, $primary ) = $this->get_column_info();
1159 1131
@@ -1175,8 +1147,16 @@
1175 1147 );
1176 1148
1177 1149 if ( 'cb' === $column_name ) {
1178 1150 echo '<th scope="row" class="check-column"></th>';
1151 + } elseif ( method_exists( $this, '_column_' . $column_name ) ) {
1152 + echo call_user_func( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
1153 + array( $this, '_column_' . $column_name ),
1154 + $item,
1155 + $classes,
1156 + $data,
1157 + $primary
1158 + );
1179 1159 } else {
1180 1160 echo '<td ';
1181 1161 FrmAppHelper::array_to_html_params( $params, true );
1182 1162 echo '>';
@@ -1187,9 +1167,9 @@
1187 1167
1188 1168 echo $this->handle_row_actions( $item, $column_name, $primary ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
1189 1169 echo '</td>';
1190 1170 }
1191 - }//end foreach
1171 + }
1192 1172 }
1193 1173
1194 1174 /**
1195 1175 * Generates and display row actions links for the list table.
@@ -1194,8 +1174,9 @@
1194 1174 /**
1195 1175 * Generates and display row actions links for the list table.
1196 1176 *
1197 1177 * @since 4.3.0
1178 + * @access protected
1198 1179 *
1199 1180 * @param object $item The item being acted upon.
1200 1181 * @param string $column_name Current column name.
1201 1182 * @param string $primary Primary column name.
@@ -1209,8 +1190,9 @@
1209 1190 /**
1210 1191 * Handle an incoming ajax request (called from admin-ajax.php)
1211 1192 *
1212 1193 * @since 2.0.18
1194 + * @access public
1213 1195 */
1214 1196 public function ajax_response() {
1215 1197 $this->prepare_items();
1216 1198
@@ -1242,9 +1224,9 @@
1242 1224
1243 1225 /**
1244 1226 * Send required variables to JavaScript land
1245 1227 *
1246 - * @return void
1228 + * @access public
1247 1229 */
1248 1230 public function _js_vars() {
1249 1231 $args = array(
1250 1232 'class' => get_class( $this ),
@@ -1254,13 +1236,6 @@
1254 1236 ),
1255 1237 );
1256 1238
1257 1239 printf( "<script type='text/javascript'>list_args = %s;</script>\n", wp_json_encode( $args ) );
1258 - }
1259 -
1260 - /**
1261 - * @return string
1262 - */
1263 - protected function loaded_from() {
1264 - return '';
1265 1240 }
1266 1241 }