| @@ -390,18 +390,11 @@ | ||
| 390 | 390 | echo "<select name='action" . esc_attr( $two ) . "' id='bulk-action-selector-" . esc_attr( $which ) . "'>\n"; |
| 391 | 391 | echo "<option value='-1' selected='selected'>" . esc_attr__( 'Bulk Actions', 'formidable' ) . "</option>\n"; |
| 392 | 392 | |
| 393 | 393 | foreach ( $this->_actions as $name => $title ) { |
| 394 | - $params = array( | |
| 395 | - 'value' => $name, | |
| 396 | - ); | |
| 397 | - if ( 'edit' === $name ) { | |
| 398 | - $params['class'] = 'hide-if-no-js'; | |
| 399 | - } | |
| 394 | + $class = 'edit' == $name ? ' class="hide-if-no-js"' : ''; | |
| 400 | 395 | |
| 401 | - echo "\t<option "; | |
| 402 | - FrmAppHelper::array_to_html_params( $params, true ); | |
| 403 | - echo '>' . esc_html( $title ) . '</option>' . "\n"; | |
| 396 | + echo "\t<option value='" . esc_attr( $name ) . "'$class>" . esc_html( $title ) . "</option>\n"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 404 | 397 | } |
| 405 | 398 | |
| 406 | 399 | echo "</select>\n"; |
| 407 | 400 | |
| @@ -408,9 +401,9 @@ | ||
| 408 | 401 | if ( isset( $this->_actions['bulk_delete'] ) ) { |
| 409 | 402 | $verify = $this->confirm_bulk_delete(); |
| 410 | 403 | |
| 411 | 404 | if ( $verify ) { |
| 412 | - echo "<a id='confirm-bulk-delete-" . esc_attr( $which ) . "' class='frm-hidden' href='confirm-bulk-delete' data-frmverify='" . esc_attr( $verify ) . "' data-frmverify-btn='frm-button-red'></a>"; | |
| 405 | + 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>"; | |
| 413 | 406 | } |
| 414 | 407 | } |
| 415 | 408 | |
| 416 | 409 | submit_button( __( 'Apply', 'formidable' ), 'action', '', false, array( 'id' => "doaction$two" ) ); |
| @@ -943,9 +936,9 @@ | ||
| 943 | 936 | } elseif ( in_array( $column_key, array( 'posts', 'comments', 'links' ) ) ) { |
| 944 | 937 | $class[] = 'num'; |
| 945 | 938 | } |
| 946 | 939 | |
| 947 | - if ( $column_key === $primary || $column_key === 'name' ) { | |
| 940 | + if ( $column_key === $primary ) { | |
| 948 | 941 | $class[] = 'column-primary'; |
| 949 | 942 | } |
| 950 | 943 | |
| 951 | 944 | if ( isset( $sortable[ $column_key ] ) ) { |
| @@ -986,13 +979,9 @@ | ||
| 986 | 979 | * @since 2.0.18 |
| 987 | 980 | * @access public |
| 988 | 981 | */ |
| 989 | 982 | public function display() { |
| 990 | - $singular = $this->_args['singular']; | |
| 991 | - $tbody_params = array(); | |
| 992 | - if ( $singular ) { | |
| 993 | - $tbody_params['data-wp-lists'] = 'list:' . $singular; | |
| 994 | - } | |
| 983 | + $singular = $this->_args['singular']; | |
| 995 | 984 | |
| 996 | 985 | $this->display_tablenav( 'top' ); |
| 997 | 986 | ?> |
| 998 | 987 | <table class="wp-list-table <?php echo esc_attr( implode( ' ', $this->get_table_classes() ) ); ?>"> |
| @@ -1003,9 +992,9 @@ | ||
| 1003 | 992 | </tr> |
| 1004 | 993 | </thead> |
| 1005 | 994 | <?php } ?> |
| 1006 | 995 | |
| 1007 | - <tbody id="the-list"<?php FrmAppHelper::array_to_html_params( $tbody_params, true ); ?>> | |
| 996 | + <tbody id="the-list"<?php echo( $singular ? " data-wp-lists='list:" . esc_attr( $singular ) . "'" : '' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>> | |
| 1008 | 997 | <?php $this->display_rows_or_placeholder(); ?> |
| 1009 | 998 | </tbody> |
| 1010 | 999 | |
| 1011 | 1000 | <?php if ( $this->has_min_items( 1 ) ) { ?> |
| @@ -1138,26 +1127,31 @@ | ||
| 1138 | 1127 | if ( in_array( $column_name, $hidden ) ) { |
| 1139 | 1128 | $classes .= ' hidden'; |
| 1140 | 1129 | } |
| 1141 | 1130 | |
| 1142 | - $params = array( | |
| 1143 | - 'class' => $classes, | |
| 1144 | - // Comments column uses HTML in the display name with screen reader text. | |
| 1145 | - // Instead of using esc_attr(), we strip tags to get closer to a user-friendly string. | |
| 1146 | - 'data-colname' => $column_display_name, | |
| 1147 | - ); | |
| 1131 | + // Comments column uses HTML in the display name with screen reader text. | |
| 1132 | + // Instead of using esc_attr(), we strip tags to get closer to a user-friendly string. | |
| 1133 | + $data = 'data-colname="' . esc_attr( $column_display_name ) . '"'; | |
| 1148 | 1134 | |
| 1149 | - if ( 'cb' === $column_name ) { | |
| 1135 | + $attributes = 'class="' . esc_attr( $classes ) . '" ' . $data; | |
| 1136 | + | |
| 1137 | + if ( 'cb' == $column_name ) { | |
| 1150 | 1138 | echo '<th scope="row" class="check-column"></th>'; |
| 1139 | + } elseif ( method_exists( $this, '_column_' . $column_name ) ) { | |
| 1140 | + echo call_user_func( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 1141 | + array( $this, '_column_' . $column_name ), | |
| 1142 | + $item, | |
| 1143 | + $classes, | |
| 1144 | + $data, | |
| 1145 | + $primary | |
| 1146 | + ); | |
| 1147 | + } elseif ( method_exists( $this, 'column_' . $column_name ) ) { | |
| 1148 | + echo "<td $attributes>"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 1149 | + echo call_user_func( array( $this, 'column_' . $column_name ), $item ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 1150 | + echo $this->handle_row_actions( $item, $column_name, $primary ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 1151 | + echo '</td>'; | |
| 1151 | 1152 | } else { |
| 1152 | - echo '<td '; | |
| 1153 | - FrmAppHelper::array_to_html_params( $params, true ); | |
| 1154 | - echo '>'; | |
| 1155 | - | |
| 1156 | - if ( method_exists( $this, 'column_' . $column_name ) ) { | |
| 1157 | - echo call_user_func( array( $this, 'column_' . $column_name ), $item ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 1158 | - } | |
| 1159 | - | |
| 1153 | + echo "<td $attributes>"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 1160 | 1154 | echo $this->handle_row_actions( $item, $column_name, $primary ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 1161 | 1155 | echo '</td>'; |
| 1162 | 1156 | } |
| 1163 | 1157 | } |