Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/popup-bu.../com/libs
File: ListTable.php
* @staticvar int $cb_counter
[1000] Fix | Delete
*
[1001] Fix | Delete
* @param bool $with_id Whether to set the id attribute or not
[1002] Fix | Delete
*/
[1003] Fix | Delete
public function print_column_headers( $with_id = true ) {
[1004] Fix | Delete
list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();
[1005] Fix | Delete
[1006] Fix | Delete
// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
[1007] Fix | Delete
$sbpb_server_host = isset($_SERVER['HTTP_HOST']) ? sanitize_text_field( $_SERVER['HTTP_HOST'] ) : '';
[1008] Fix | Delete
$sbpb_server_requesturi = isset($_SERVER['REQUEST_URI']) ? sanitize_text_field( $_SERVER['REQUEST_URI'] ) : '';
[1009] Fix | Delete
$current_url = set_url_scheme( 'http://' . $sbpb_server_host . $sbpb_server_requesturi );
[1010] Fix | Delete
$current_url = remove_query_arg( 'paged', $current_url );
[1011] Fix | Delete
[1012] Fix | Delete
if ( isset( $_GET['orderby'] ) )
[1013] Fix | Delete
$current_orderby = sanitize_text_field($_GET['orderby']);
[1014] Fix | Delete
else
[1015] Fix | Delete
$current_orderby = '';
[1016] Fix | Delete
[1017] Fix | Delete
if ( isset( $_GET['order'] ) && 'desc' == sanitize_text_field($_GET['order']) )
[1018] Fix | Delete
$current_order = 'desc';
[1019] Fix | Delete
else
[1020] Fix | Delete
$current_order = 'asc';
[1021] Fix | Delete
[1022] Fix | Delete
if ( ! empty( $columns['cb'] ) ) {
[1023] Fix | Delete
static $cb_counter = 1;
[1024] Fix | Delete
$columns['cb'] = '<label class="screen-reader-text" for="cb-select-all-' . $cb_counter . '">' . __( 'Select All' ) . '</label>'
[1025] Fix | Delete
. '<input id="cb-select-all-' . $cb_counter . '" type="checkbox" />';
[1026] Fix | Delete
$cb_counter++;
[1027] Fix | Delete
}
[1028] Fix | Delete
[1029] Fix | Delete
foreach ( $columns as $column_key => $column_display_name ) {
[1030] Fix | Delete
$class = array( 'manage-column', "column-$column_key", 'table__head' );
[1031] Fix | Delete
if ( in_array( $column_key, $hidden ) ) {
[1032] Fix | Delete
$class[] = 'hidden';
[1033] Fix | Delete
}
[1034] Fix | Delete
[1035] Fix | Delete
if ( 'cb' == $column_key )
[1036] Fix | Delete
$class[] = 'check-column';
[1037] Fix | Delete
elseif ( in_array( $column_key, array( 'posts', 'comments', 'links' ) ) )
[1038] Fix | Delete
$class[] = 'num';
[1039] Fix | Delete
[1040] Fix | Delete
if ( $column_key === $primary ) {
[1041] Fix | Delete
$class[] = 'column-primary';
[1042] Fix | Delete
}
[1043] Fix | Delete
[1044] Fix | Delete
if ( isset( $sortable[$column_key] ) ) {
[1045] Fix | Delete
list( $orderby, $desc_first ) = $sortable[$column_key];
[1046] Fix | Delete
[1047] Fix | Delete
if ( $current_orderby == $orderby ) {
[1048] Fix | Delete
$order = 'asc' == $current_order ? 'desc' : 'asc';
[1049] Fix | Delete
$class[] = 'sorted';
[1050] Fix | Delete
$class[] = $current_order;
[1051] Fix | Delete
} else {
[1052] Fix | Delete
$order = $desc_first ? 'desc' : 'asc';
[1053] Fix | Delete
$class[] = 'sortable';
[1054] Fix | Delete
$class[] = $desc_first ? 'asc' : 'desc';
[1055] Fix | Delete
}
[1056] Fix | Delete
[1057] Fix | Delete
$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>';
[1058] Fix | Delete
}
[1059] Fix | Delete
[1060] Fix | Delete
$tag = ( 'cb' === $column_key ) ? 'td' : 'th';
[1061] Fix | Delete
$tag = 'div';
[1062] Fix | Delete
$scope = ( 'th' === $tag ) ? 'scope="col"' : '';
[1063] Fix | Delete
$id = $with_id ? "id='$column_key'" : '';
[1064] Fix | Delete
[1065] Fix | Delete
if ( !empty( $class ) )
[1066] Fix | Delete
$class = "class='" . join( ' ', $class ) . "'";
[1067] Fix | Delete
echo wp_kses("<$tag $scope $id $class>$column_display_name</$tag>", AdminHelper::allowed_html_tags());
[1068] Fix | Delete
}
[1069] Fix | Delete
}
[1070] Fix | Delete
[1071] Fix | Delete
/**
[1072] Fix | Delete
* Display the table
[1073] Fix | Delete
*
[1074] Fix | Delete
* @since 3.1.0
[1075] Fix | Delete
* @access public
[1076] Fix | Delete
*/
[1077] Fix | Delete
public function display() {
[1078] Fix | Delete
$singular = $this->_args['singular'];
[1079] Fix | Delete
[1080] Fix | Delete
$this->display_tablenav( 'top' );
[1081] Fix | Delete
?>
[1082] Fix | Delete
<table class="wp-list-table <?php echo esc_attr(implode( ' ', $this->get_table_classes() )); ?>">
[1083] Fix | Delete
<thead>
[1084] Fix | Delete
<tr>
[1085] Fix | Delete
<?php $this->print_column_headers(); ?>
[1086] Fix | Delete
</tr>
[1087] Fix | Delete
</thead>
[1088] Fix | Delete
[1089] Fix | Delete
<tbody id="the-list"<?php
[1090] Fix | Delete
if ( $singular ) {
[1091] Fix | Delete
echo esc_attr(" data-wp-lists='list:$singular'");
[1092] Fix | Delete
} ?>>
[1093] Fix | Delete
<?php $this->display_rows_or_placeholder(); ?>
[1094] Fix | Delete
</tbody>
[1095] Fix | Delete
[1096] Fix | Delete
<tfoot>
[1097] Fix | Delete
<tr>
[1098] Fix | Delete
<?php $this->print_column_headers( false ); ?>
[1099] Fix | Delete
</tr>
[1100] Fix | Delete
</tfoot>
[1101] Fix | Delete
[1102] Fix | Delete
</table>
[1103] Fix | Delete
<?php
[1104] Fix | Delete
$this->display_tablenav( 'bottom' );
[1105] Fix | Delete
}
[1106] Fix | Delete
[1107] Fix | Delete
/**
[1108] Fix | Delete
* Get a list of CSS classes for the list table table tag.
[1109] Fix | Delete
*
[1110] Fix | Delete
* @since 3.1.0
[1111] Fix | Delete
* @access protected
[1112] Fix | Delete
*
[1113] Fix | Delete
* @return array List of CSS classes for the table tag.
[1114] Fix | Delete
*/
[1115] Fix | Delete
protected function get_table_classes() {
[1116] Fix | Delete
return array( 'widefat', 'fixed', 'striped', $this->_args['plural'] );
[1117] Fix | Delete
}
[1118] Fix | Delete
[1119] Fix | Delete
/**
[1120] Fix | Delete
* Generate the table navigation above or below the table
[1121] Fix | Delete
*
[1122] Fix | Delete
* @since 3.1.0
[1123] Fix | Delete
* @access protected
[1124] Fix | Delete
* @param string $which
[1125] Fix | Delete
*/
[1126] Fix | Delete
protected function display_tablenav( $which ) {
[1127] Fix | Delete
if ( 'top' == $which )
[1128] Fix | Delete
wp_nonce_field( 'bulk-' . $this->_args['plural'] );
[1129] Fix | Delete
?>
[1130] Fix | Delete
<div class="tablenav <?php echo esc_attr( $which ); ?>">
[1131] Fix | Delete
[1132] Fix | Delete
<div class="alignleft actions bulkactions">
[1133] Fix | Delete
<?php $this->bulk_actions( $which ); ?>
[1134] Fix | Delete
</div>
[1135] Fix | Delete
<?php
[1136] Fix | Delete
$this->extra_tablenav( $which );
[1137] Fix | Delete
$this->pagination( $which );
[1138] Fix | Delete
?>
[1139] Fix | Delete
[1140] Fix | Delete
<br class="clear" />
[1141] Fix | Delete
</div>
[1142] Fix | Delete
<?php
[1143] Fix | Delete
}
[1144] Fix | Delete
[1145] Fix | Delete
/**
[1146] Fix | Delete
* Extra controls to be displayed between bulk actions and pagination
[1147] Fix | Delete
*
[1148] Fix | Delete
* @since 3.1.0
[1149] Fix | Delete
* @access protected
[1150] Fix | Delete
*
[1151] Fix | Delete
* @param string $which
[1152] Fix | Delete
*/
[1153] Fix | Delete
protected function extra_tablenav( $which ) {}
[1154] Fix | Delete
[1155] Fix | Delete
/**
[1156] Fix | Delete
* Generate the tbody element for the list table.
[1157] Fix | Delete
*
[1158] Fix | Delete
* @since 3.1.0
[1159] Fix | Delete
* @access public
[1160] Fix | Delete
*/
[1161] Fix | Delete
public function display_rows_or_placeholder() {
[1162] Fix | Delete
if ( $this->has_items() ) {
[1163] Fix | Delete
$this->display_rows();
[1164] Fix | Delete
} else {
[1165] Fix | Delete
echo '<tr class="no-items"><td class="colspanchange" colspan="' . esc_attr($this->get_column_count()) . '">';
[1166] Fix | Delete
$this->no_items();
[1167] Fix | Delete
echo '</td></tr>';
[1168] Fix | Delete
}
[1169] Fix | Delete
}
[1170] Fix | Delete
[1171] Fix | Delete
/**
[1172] Fix | Delete
* Generate the table rows
[1173] Fix | Delete
*
[1174] Fix | Delete
* @since 3.1.0
[1175] Fix | Delete
* @access public
[1176] Fix | Delete
*/
[1177] Fix | Delete
public function display_rows() {
[1178] Fix | Delete
foreach ( $this->items as $item )
[1179] Fix | Delete
$this->single_row( $item );
[1180] Fix | Delete
}
[1181] Fix | Delete
[1182] Fix | Delete
/**
[1183] Fix | Delete
* Generates content for a single row of the table
[1184] Fix | Delete
*
[1185] Fix | Delete
* @since 3.1.0
[1186] Fix | Delete
* @access public
[1187] Fix | Delete
*
[1188] Fix | Delete
* @param object $item The current item
[1189] Fix | Delete
*/
[1190] Fix | Delete
public function single_row( $item ) {
[1191] Fix | Delete
echo '<tr>';
[1192] Fix | Delete
$this->single_row_columns( $item );
[1193] Fix | Delete
echo '</tr>';
[1194] Fix | Delete
}
[1195] Fix | Delete
[1196] Fix | Delete
/**
[1197] Fix | Delete
*
[1198] Fix | Delete
* @param object $item
[1199] Fix | Delete
* @param string $column_name
[1200] Fix | Delete
*/
[1201] Fix | Delete
protected function column_default( $item, $column_name ) {}
[1202] Fix | Delete
[1203] Fix | Delete
/**
[1204] Fix | Delete
*
[1205] Fix | Delete
* @param object $item
[1206] Fix | Delete
*/
[1207] Fix | Delete
protected function column_cb( $item ) {}
[1208] Fix | Delete
[1209] Fix | Delete
/**
[1210] Fix | Delete
* Generates the columns for a single row of the table
[1211] Fix | Delete
*
[1212] Fix | Delete
* @since 3.1.0
[1213] Fix | Delete
* @access protected
[1214] Fix | Delete
*
[1215] Fix | Delete
* @param object $item The current item
[1216] Fix | Delete
*/
[1217] Fix | Delete
protected function single_row_columns( $item ) {
[1218] Fix | Delete
list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();
[1219] Fix | Delete
[1220] Fix | Delete
foreach ( $columns as $column_name => $column_display_name ) {
[1221] Fix | Delete
$classes = "$column_name column-$column_name";
[1222] Fix | Delete
if ( $primary === $column_name ) {
[1223] Fix | Delete
$classes .= ' has-row-actions column-primary';
[1224] Fix | Delete
}
[1225] Fix | Delete
[1226] Fix | Delete
if ( in_array( $column_name, $hidden ) ) {
[1227] Fix | Delete
$classes .= ' hidden';
[1228] Fix | Delete
}
[1229] Fix | Delete
[1230] Fix | Delete
// Comments column uses HTML in the display name with screen reader text.
[1231] Fix | Delete
// Instead of using esc_attr(), we strip tags to get closer to a user-friendly string.
[1232] Fix | Delete
$data = 'data-colname="' . wp_strip_all_tags( $column_display_name ) . '"';
[1233] Fix | Delete
[1234] Fix | Delete
$attributes = "class='$classes' $data";
[1235] Fix | Delete
[1236] Fix | Delete
if ( 'cb' == $column_name ) {
[1237] Fix | Delete
echo '<th scope="row" class="check-column">';
[1238] Fix | Delete
echo wp_kses($this->column_cb( $item ), AdminHelper::allowed_html_tags());
[1239] Fix | Delete
echo '</th>';
[1240] Fix | Delete
} elseif ( method_exists( $this, '_column_' . $column_name ) ) {
[1241] Fix | Delete
echo wp_kses(call_user_func(
[1242] Fix | Delete
array( $this, '_column_' . $column_name ),
[1243] Fix | Delete
$item,
[1244] Fix | Delete
$classes,
[1245] Fix | Delete
$data,
[1246] Fix | Delete
$primary
[1247] Fix | Delete
), AdminHelper::allowed_html_tags());
[1248] Fix | Delete
} elseif ( method_exists( $this, 'column_' . $column_name ) ) {
[1249] Fix | Delete
//<div class="table__data">01</div>
[1250] Fix | Delete
echo "<td ".esc_attr($attributes).">";
[1251] Fix | Delete
echo wp_kses(call_user_func( array( $this, 'column_' . $column_name ), $item ), AdminHelper::allowed_html_tags());
[1252] Fix | Delete
echo wp_kses($this->handle_row_actions( $item, $column_name, $primary ), AdminHelper::allowed_html_tags());
[1253] Fix | Delete
echo '</td>';
[1254] Fix | Delete
} else {
[1255] Fix | Delete
echo "<td ".esc_attr($attributes).">";
[1256] Fix | Delete
echo wp_kses($this->column_default( $item, $column_name ), AdminHelper::allowed_html_tags());
[1257] Fix | Delete
echo wp_kses($this->handle_row_actions( $item, $column_name, $primary ), AdminHelper::allowed_html_tags());
[1258] Fix | Delete
echo '</td>';
[1259] Fix | Delete
}
[1260] Fix | Delete
}
[1261] Fix | Delete
}
[1262] Fix | Delete
[1263] Fix | Delete
/**
[1264] Fix | Delete
* Generates and display row actions links for the list table.
[1265] Fix | Delete
*
[1266] Fix | Delete
* @since 4.3.0
[1267] Fix | Delete
* @access protected
[1268] Fix | Delete
*
[1269] Fix | Delete
* @param object $item The item being acted upon.
[1270] Fix | Delete
* @param string $column_name Current column name.
[1271] Fix | Delete
* @param string $primary Primary column name.
[1272] Fix | Delete
* @return string The row actions output. In this case, an empty string.
[1273] Fix | Delete
*/
[1274] Fix | Delete
protected function handle_row_actions( $item, $column_name, $primary ) {
[1275] Fix | Delete
return $column_name == $primary ? '<button type="button" class="toggle-row"><span class="screen-reader-text">' . __( 'Show more details' ) . '</span></button>' : '';
[1276] Fix | Delete
}
[1277] Fix | Delete
[1278] Fix | Delete
/**
[1279] Fix | Delete
* Handle an incoming ajax request (called from admin-ajax.php)
[1280] Fix | Delete
*
[1281] Fix | Delete
* @since 3.1.0
[1282] Fix | Delete
* @access public
[1283] Fix | Delete
*/
[1284] Fix | Delete
public function ajax_response() {
[1285] Fix | Delete
$this->prepare_items();
[1286] Fix | Delete
[1287] Fix | Delete
ob_start();
[1288] Fix | Delete
if ( ! empty( $_REQUEST['no_placeholder'] ) ) {
[1289] Fix | Delete
$this->display_rows();
[1290] Fix | Delete
} else {
[1291] Fix | Delete
$this->display_rows_or_placeholder();
[1292] Fix | Delete
}
[1293] Fix | Delete
[1294] Fix | Delete
$rows = ob_get_clean();
[1295] Fix | Delete
[1296] Fix | Delete
$response = array( 'rows' => $rows );
[1297] Fix | Delete
[1298] Fix | Delete
if ( isset( $this->_pagination_args['total_items'] ) ) {
[1299] Fix | Delete
$response['total_items_i18n'] = sprintf(
[1300] Fix | Delete
/* translators: total item, total items */
[1301] Fix | Delete
_n( '%s item', '%s items', $this->_pagination_args['total_items'] ),
[1302] Fix | Delete
number_format_i18n( $this->_pagination_args['total_items'] )
[1303] Fix | Delete
);
[1304] Fix | Delete
}
[1305] Fix | Delete
if ( isset( $this->_pagination_args['total_pages'] ) ) {
[1306] Fix | Delete
$response['total_pages'] = $this->_pagination_args['total_pages'];
[1307] Fix | Delete
$response['total_pages_i18n'] = number_format_i18n( $this->_pagination_args['total_pages'] );
[1308] Fix | Delete
}
[1309] Fix | Delete
[1310] Fix | Delete
die( wp_json_encode( $response ) );
[1311] Fix | Delete
}
[1312] Fix | Delete
[1313] Fix | Delete
/**
[1314] Fix | Delete
* Send required variables to JavaScript land
[1315] Fix | Delete
*
[1316] Fix | Delete
* @access public
[1317] Fix | Delete
*/
[1318] Fix | Delete
public function _js_vars() {
[1319] Fix | Delete
$args = array(
[1320] Fix | Delete
'class' => get_class( $this ),
[1321] Fix | Delete
'screen' => array(
[1322] Fix | Delete
'id' => $this->screen->id,
[1323] Fix | Delete
'base' => $this->screen->base,
[1324] Fix | Delete
)
[1325] Fix | Delete
);
[1326] Fix | Delete
wp_register_script( 'sgpb-listtable-js-footer', '', array("jquery"), SGPB_POPUP_VERSION, true );
[1327] Fix | Delete
wp_enqueue_script( 'sgpb-listtable-js-footer' );
[1328] Fix | Delete
wp_add_inline_script( 'sgpb-listtable-js-footer', printf( "list_args = %s;", wp_json_encode( $args ) ));
[1329] Fix | Delete
}
[1330] Fix | Delete
}
[1331] Fix | Delete
[1332] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function