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/wp-conte.../plugins/popup-ma.../classes
File: ListTable.php
}
[1000] Fix | Delete
[1001] Fix | Delete
return $column;
[1002] Fix | Delete
}
[1003] Fix | Delete
[1004] Fix | Delete
/**
[1005] Fix | Delete
* Get a list of all, hidden and sortable columns, with filter applied
[1006] Fix | Delete
*
[1007] Fix | Delete
* @since 3.1.0
[1008] Fix | Delete
*
[1009] Fix | Delete
* @return array
[1010] Fix | Delete
*/
[1011] Fix | Delete
protected function get_column_info() {
[1012] Fix | Delete
// $_column_headers is already set / cached
[1013] Fix | Delete
if ( isset( $this->_column_headers ) && is_array( $this->_column_headers ) ) {
[1014] Fix | Delete
// Back-compat for list tables that have been manually setting $_column_headers for horse reasons.
[1015] Fix | Delete
// In 4.3, we added a fourth argument for primary column.
[1016] Fix | Delete
$column_headers = [ [], [], [], $this->get_primary_column_name() ];
[1017] Fix | Delete
foreach ( $this->_column_headers as $key => $value ) {
[1018] Fix | Delete
$column_headers[ $key ] = $value;
[1019] Fix | Delete
}
[1020] Fix | Delete
[1021] Fix | Delete
return $column_headers;
[1022] Fix | Delete
}
[1023] Fix | Delete
[1024] Fix | Delete
$columns = get_column_headers( $this->screen );
[1025] Fix | Delete
$hidden = get_hidden_columns( $this->screen );
[1026] Fix | Delete
[1027] Fix | Delete
$sortable_columns = $this->get_sortable_columns();
[1028] Fix | Delete
/**
[1029] Fix | Delete
* Filters the list table sortable columns for a specific screen.
[1030] Fix | Delete
*
[1031] Fix | Delete
* The dynamic portion of the hook name, `$this->screen->id`, refers
[1032] Fix | Delete
* to the ID of the current screen, usually a string.
[1033] Fix | Delete
*
[1034] Fix | Delete
* @since 3.5.0
[1035] Fix | Delete
*
[1036] Fix | Delete
* @param array $sortable_columns An array of sortable columns.
[1037] Fix | Delete
*/
[1038] Fix | Delete
$_sortable = apply_filters( "manage_{$this->screen->id}_sortable_columns", $sortable_columns );
[1039] Fix | Delete
[1040] Fix | Delete
$sortable = [];
[1041] Fix | Delete
foreach ( $_sortable as $id => $data ) {
[1042] Fix | Delete
if ( empty( $data ) ) {
[1043] Fix | Delete
continue;
[1044] Fix | Delete
}
[1045] Fix | Delete
[1046] Fix | Delete
$data = (array) $data;
[1047] Fix | Delete
if ( ! isset( $data[1] ) ) {
[1048] Fix | Delete
$data[1] = false;
[1049] Fix | Delete
}
[1050] Fix | Delete
[1051] Fix | Delete
$sortable[ $id ] = $data;
[1052] Fix | Delete
}
[1053] Fix | Delete
[1054] Fix | Delete
$primary = $this->get_primary_column_name();
[1055] Fix | Delete
$this->_column_headers = [ $columns, $hidden, $sortable, $primary ];
[1056] Fix | Delete
[1057] Fix | Delete
return $this->_column_headers;
[1058] Fix | Delete
}
[1059] Fix | Delete
[1060] Fix | Delete
/**
[1061] Fix | Delete
* Return number of visible columns
[1062] Fix | Delete
*
[1063] Fix | Delete
* @since 3.1.0
[1064] Fix | Delete
*
[1065] Fix | Delete
* @return int
[1066] Fix | Delete
*/
[1067] Fix | Delete
public function get_column_count() {
[1068] Fix | Delete
list ( $columns, $hidden ) = $this->get_column_info();
[1069] Fix | Delete
$hidden = array_intersect( array_keys( $columns ), array_filter( $hidden ) );
[1070] Fix | Delete
return count( $columns ) - count( $hidden );
[1071] Fix | Delete
}
[1072] Fix | Delete
[1073] Fix | Delete
/**
[1074] Fix | Delete
* Print column headers, accounting for hidden and sortable columns.
[1075] Fix | Delete
*
[1076] Fix | Delete
* @since 3.1.0
[1077] Fix | Delete
*
[1078] Fix | Delete
* @staticvar int $cb_counter
[1079] Fix | Delete
*
[1080] Fix | Delete
* @param bool $with_id Whether to set the id attribute or not
[1081] Fix | Delete
*/
[1082] Fix | Delete
public function print_column_headers( $with_id = true ) {
[1083] Fix | Delete
list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();
[1084] Fix | Delete
[1085] Fix | Delete
$current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
[1086] Fix | Delete
$current_url = remove_query_arg( 'paged', $current_url );
[1087] Fix | Delete
[1088] Fix | Delete
if ( isset( $_GET['orderby'] ) ) {
[1089] Fix | Delete
$current_orderby = $_GET['orderby'];
[1090] Fix | Delete
} else {
[1091] Fix | Delete
$current_orderby = '';
[1092] Fix | Delete
}
[1093] Fix | Delete
[1094] Fix | Delete
if ( isset( $_GET['order'] ) && 'desc' === $_GET['order'] ) {
[1095] Fix | Delete
$current_order = 'desc';
[1096] Fix | Delete
} else {
[1097] Fix | Delete
$current_order = 'asc';
[1098] Fix | Delete
}
[1099] Fix | Delete
[1100] Fix | Delete
if ( ! empty( $columns['cb'] ) ) {
[1101] Fix | Delete
static $cb_counter = 1;
[1102] Fix | Delete
$columns['cb'] = '<label class="screen-reader-text" for="cb-select-all-' . $cb_counter . '">' . __( 'Select All' ) . '</label>'
[1103] Fix | Delete
. '<input id="cb-select-all-' . $cb_counter . '" type="checkbox" />';
[1104] Fix | Delete
$cb_counter++;
[1105] Fix | Delete
}
[1106] Fix | Delete
[1107] Fix | Delete
foreach ( $columns as $column_key => $column_display_name ) {
[1108] Fix | Delete
$class = [ 'manage-column', "column-$column_key" ];
[1109] Fix | Delete
[1110] Fix | Delete
if ( in_array( $column_key, $hidden ) ) {
[1111] Fix | Delete
$class[] = 'hidden';
[1112] Fix | Delete
}
[1113] Fix | Delete
[1114] Fix | Delete
if ( 'cb' === $column_key ) {
[1115] Fix | Delete
$class[] = 'check-column';
[1116] Fix | Delete
} elseif ( in_array( $column_key, [ 'posts', 'comments', 'links' ] ) ) {
[1117] Fix | Delete
$class[] = 'num';
[1118] Fix | Delete
}
[1119] Fix | Delete
[1120] Fix | Delete
if ( $column_key === $primary ) {
[1121] Fix | Delete
$class[] = 'column-primary';
[1122] Fix | Delete
}
[1123] Fix | Delete
[1124] Fix | Delete
if ( isset( $sortable[ $column_key ] ) ) {
[1125] Fix | Delete
list( $orderby, $desc_first ) = $sortable[ $column_key ];
[1126] Fix | Delete
[1127] Fix | Delete
if ( $current_orderby === $orderby ) {
[1128] Fix | Delete
$order = 'asc' === $current_order ? 'desc' : 'asc';
[1129] Fix | Delete
$class[] = 'sorted';
[1130] Fix | Delete
$class[] = $current_order;
[1131] Fix | Delete
} else {
[1132] Fix | Delete
$order = $desc_first ? 'desc' : 'asc';
[1133] Fix | Delete
$class[] = 'sortable';
[1134] Fix | Delete
$class[] = $desc_first ? 'asc' : 'desc';
[1135] Fix | Delete
}
[1136] Fix | Delete
[1137] Fix | Delete
$column_display_name = '<a href="' . esc_url( add_query_arg( compact( 'orderby', 'order' ), $current_url ) ) . '"><span>' . $column_display_name . '</span><span class="sorting-indicator"></span></a>';
[1138] Fix | Delete
}
[1139] Fix | Delete
[1140] Fix | Delete
$tag = ( 'cb' === $column_key ) ? 'td' : 'th';
[1141] Fix | Delete
$scope = ( 'th' === $tag ) ? 'scope="col"' : '';
[1142] Fix | Delete
$id = $with_id ? "id='$column_key'" : '';
[1143] Fix | Delete
[1144] Fix | Delete
if ( ! empty( $class ) ) {
[1145] Fix | Delete
$class = "class='" . join( ' ', $class ) . "'";
[1146] Fix | Delete
}
[1147] Fix | Delete
[1148] Fix | Delete
echo "<$tag $scope $id $class>$column_display_name</$tag>";
[1149] Fix | Delete
}
[1150] Fix | Delete
}
[1151] Fix | Delete
[1152] Fix | Delete
/**
[1153] Fix | Delete
* Display the table
[1154] Fix | Delete
*
[1155] Fix | Delete
* @since 3.1.0
[1156] Fix | Delete
*/
[1157] Fix | Delete
public function display() {
[1158] Fix | Delete
$singular = $this->_args['singular'];
[1159] Fix | Delete
[1160] Fix | Delete
$this->display_tablenav( 'top' );
[1161] Fix | Delete
[1162] Fix | Delete
$this->screen->render_screen_reader_content( 'heading_list' );
[1163] Fix | Delete
?>
[1164] Fix | Delete
<table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>">
[1165] Fix | Delete
<thead>
[1166] Fix | Delete
<tr>
[1167] Fix | Delete
<?php $this->print_column_headers(); ?>
[1168] Fix | Delete
</tr>
[1169] Fix | Delete
</thead>
[1170] Fix | Delete
[1171] Fix | Delete
<tbody id="the-list"
[1172] Fix | Delete
<?php
[1173] Fix | Delete
if ( $singular ) {
[1174] Fix | Delete
echo " data-wp-lists='list:$singular'";
[1175] Fix | Delete
}
[1176] Fix | Delete
?>
[1177] Fix | Delete
>
[1178] Fix | Delete
<?php $this->display_rows_or_placeholder(); ?>
[1179] Fix | Delete
</tbody>
[1180] Fix | Delete
[1181] Fix | Delete
<tfoot>
[1182] Fix | Delete
<tr>
[1183] Fix | Delete
<?php $this->print_column_headers( false ); ?>
[1184] Fix | Delete
</tr>
[1185] Fix | Delete
</tfoot>
[1186] Fix | Delete
[1187] Fix | Delete
</table>
[1188] Fix | Delete
<?php
[1189] Fix | Delete
$this->display_tablenav( 'bottom' );
[1190] Fix | Delete
}
[1191] Fix | Delete
[1192] Fix | Delete
/**
[1193] Fix | Delete
* Get a list of CSS classes for the PUM_ListTable table tag.
[1194] Fix | Delete
*
[1195] Fix | Delete
* @since 3.1.0
[1196] Fix | Delete
*
[1197] Fix | Delete
* @return array List of CSS classes for the table tag.
[1198] Fix | Delete
*/
[1199] Fix | Delete
protected function get_table_classes() {
[1200] Fix | Delete
return [ 'widefat', 'fixed', 'striped', $this->_args['plural'] ];
[1201] Fix | Delete
}
[1202] Fix | Delete
[1203] Fix | Delete
/**
[1204] Fix | Delete
* Generate the table navigation above or below the table
[1205] Fix | Delete
*
[1206] Fix | Delete
* @since 3.1.0
[1207] Fix | Delete
* @param string $which
[1208] Fix | Delete
*/
[1209] Fix | Delete
protected function display_tablenav( $which ) {
[1210] Fix | Delete
if ( 'top' === $which ) {
[1211] Fix | Delete
wp_nonce_field( 'bulk-' . $this->_args['plural'] );
[1212] Fix | Delete
}
[1213] Fix | Delete
?>
[1214] Fix | Delete
<div class="tablenav <?php echo esc_attr( $which ); ?>">
[1215] Fix | Delete
[1216] Fix | Delete
<?php if ( $this->has_items() ) : ?>
[1217] Fix | Delete
<div class="alignleft actions bulkactions">
[1218] Fix | Delete
<?php $this->bulk_actions( $which ); ?>
[1219] Fix | Delete
</div>
[1220] Fix | Delete
<?php
[1221] Fix | Delete
endif;
[1222] Fix | Delete
$this->extra_tablenav( $which );
[1223] Fix | Delete
$this->pagination( $which );
[1224] Fix | Delete
?>
[1225] Fix | Delete
[1226] Fix | Delete
<br class="clear" />
[1227] Fix | Delete
</div>
[1228] Fix | Delete
<?php
[1229] Fix | Delete
}
[1230] Fix | Delete
[1231] Fix | Delete
/**
[1232] Fix | Delete
* Extra controls to be displayed between bulk actions and pagination
[1233] Fix | Delete
*
[1234] Fix | Delete
* @since 3.1.0
[1235] Fix | Delete
*
[1236] Fix | Delete
* @param string $which
[1237] Fix | Delete
*/
[1238] Fix | Delete
protected function extra_tablenav( $which ) {}
[1239] Fix | Delete
[1240] Fix | Delete
/**
[1241] Fix | Delete
* Generate the tbody element for the list table.
[1242] Fix | Delete
*
[1243] Fix | Delete
* @since 3.1.0
[1244] Fix | Delete
*/
[1245] Fix | Delete
public function display_rows_or_placeholder() {
[1246] Fix | Delete
if ( $this->has_items() ) {
[1247] Fix | Delete
$this->display_rows();
[1248] Fix | Delete
} else {
[1249] Fix | Delete
echo '<tr class="no-items"><td class="colspanchange" colspan="' . $this->get_column_count() . '">';
[1250] Fix | Delete
$this->no_items();
[1251] Fix | Delete
echo '</td></tr>';
[1252] Fix | Delete
}
[1253] Fix | Delete
}
[1254] Fix | Delete
[1255] Fix | Delete
/**
[1256] Fix | Delete
* Generate the table rows
[1257] Fix | Delete
*
[1258] Fix | Delete
* @since 3.1.0
[1259] Fix | Delete
*/
[1260] Fix | Delete
public function display_rows() {
[1261] Fix | Delete
foreach ( $this->items as $item ) {
[1262] Fix | Delete
$this->single_row( $item );
[1263] Fix | Delete
}
[1264] Fix | Delete
}
[1265] Fix | Delete
[1266] Fix | Delete
/**
[1267] Fix | Delete
* Generates content for a single row of the table
[1268] Fix | Delete
*
[1269] Fix | Delete
* @since 3.1.0
[1270] Fix | Delete
*
[1271] Fix | Delete
* @param object $item The current item
[1272] Fix | Delete
*/
[1273] Fix | Delete
public function single_row( $item ) {
[1274] Fix | Delete
echo '<tr>';
[1275] Fix | Delete
$this->single_row_columns( $item );
[1276] Fix | Delete
echo '</tr>';
[1277] Fix | Delete
}
[1278] Fix | Delete
[1279] Fix | Delete
/**
[1280] Fix | Delete
*
[1281] Fix | Delete
* @param object $item
[1282] Fix | Delete
* @param string $column_name
[1283] Fix | Delete
*/
[1284] Fix | Delete
protected function column_default( $item, $column_name ) {}
[1285] Fix | Delete
[1286] Fix | Delete
/**
[1287] Fix | Delete
*
[1288] Fix | Delete
* @param object $item
[1289] Fix | Delete
*/
[1290] Fix | Delete
protected function column_cb( $item ) {}
[1291] Fix | Delete
[1292] Fix | Delete
/**
[1293] Fix | Delete
* Generates the columns for a single row of the table
[1294] Fix | Delete
*
[1295] Fix | Delete
* @since 3.1.0
[1296] Fix | Delete
*
[1297] Fix | Delete
* @param object $item The current item
[1298] Fix | Delete
*/
[1299] Fix | Delete
protected function single_row_columns( $item ) {
[1300] Fix | Delete
list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();
[1301] Fix | Delete
[1302] Fix | Delete
foreach ( $columns as $column_name => $column_display_name ) {
[1303] Fix | Delete
$classes = "$column_name column-$column_name";
[1304] Fix | Delete
if ( $primary === $column_name ) {
[1305] Fix | Delete
$classes .= ' has-row-actions column-primary';
[1306] Fix | Delete
}
[1307] Fix | Delete
[1308] Fix | Delete
if ( in_array( $column_name, $hidden ) ) {
[1309] Fix | Delete
$classes .= ' hidden';
[1310] Fix | Delete
}
[1311] Fix | Delete
[1312] Fix | Delete
// Comments column uses HTML in the display name with screen reader text.
[1313] Fix | Delete
// Instead of using esc_attr(), we strip tags to get closer to a user-friendly string.
[1314] Fix | Delete
$data = 'data-colname="' . wp_strip_all_tags( $column_display_name ) . '"';
[1315] Fix | Delete
[1316] Fix | Delete
$attributes = "class='$classes' $data";
[1317] Fix | Delete
[1318] Fix | Delete
if ( 'cb' === $column_name ) {
[1319] Fix | Delete
echo '<th scope="row" class="check-column">';
[1320] Fix | Delete
echo $this->column_cb( $item );
[1321] Fix | Delete
echo '</th>';
[1322] Fix | Delete
} elseif ( method_exists( $this, '_column_' . $column_name ) ) {
[1323] Fix | Delete
echo call_user_func(
[1324] Fix | Delete
[ $this, '_column_' . $column_name ],
[1325] Fix | Delete
$item,
[1326] Fix | Delete
$classes,
[1327] Fix | Delete
$data,
[1328] Fix | Delete
$primary
[1329] Fix | Delete
);
[1330] Fix | Delete
} elseif ( method_exists( $this, 'column_' . $column_name ) ) {
[1331] Fix | Delete
echo "<td $attributes>";
[1332] Fix | Delete
echo call_user_func( [ $this, 'column_' . $column_name ], $item );
[1333] Fix | Delete
echo $this->handle_row_actions( $item, $column_name, $primary );
[1334] Fix | Delete
echo '</td>';
[1335] Fix | Delete
} else {
[1336] Fix | Delete
echo "<td $attributes>";
[1337] Fix | Delete
echo $this->column_default( $item, $column_name );
[1338] Fix | Delete
echo $this->handle_row_actions( $item, $column_name, $primary );
[1339] Fix | Delete
echo '</td>';
[1340] Fix | Delete
}
[1341] Fix | Delete
}
[1342] Fix | Delete
}
[1343] Fix | Delete
[1344] Fix | Delete
/**
[1345] Fix | Delete
* Generates and display row actions links for the list table.
[1346] Fix | Delete
*
[1347] Fix | Delete
* @since 4.3.0
[1348] Fix | Delete
*
[1349] Fix | Delete
* @param object $item The item being acted upon.
[1350] Fix | Delete
* @param string $column_name Current column name.
[1351] Fix | Delete
* @param string $primary Primary column name.
[1352] Fix | Delete
* @return string The row actions HTML, or an empty string if the current column is the primary column.
[1353] Fix | Delete
*/
[1354] Fix | Delete
protected function handle_row_actions( $item, $column_name, $primary ) {
[1355] Fix | Delete
return $column_name === $primary ? '<button type="button" class="toggle-row"><span class="screen-reader-text">' . __( 'Show more details' ) . '</span></button>' : '';
[1356] Fix | Delete
}
[1357] Fix | Delete
[1358] Fix | Delete
/**
[1359] Fix | Delete
* Handle an incoming ajax request (called from admin-ajax.php)
[1360] Fix | Delete
*
[1361] Fix | Delete
* @since 3.1.0
[1362] Fix | Delete
*/
[1363] Fix | Delete
public function ajax_response() {
[1364] Fix | Delete
$this->prepare_items();
[1365] Fix | Delete
[1366] Fix | Delete
ob_start();
[1367] Fix | Delete
if ( ! empty( $_REQUEST['no_placeholder'] ) ) {
[1368] Fix | Delete
$this->display_rows();
[1369] Fix | Delete
} else {
[1370] Fix | Delete
$this->display_rows_or_placeholder();
[1371] Fix | Delete
}
[1372] Fix | Delete
[1373] Fix | Delete
$rows = ob_get_clean();
[1374] Fix | Delete
[1375] Fix | Delete
$response = [ 'rows' => $rows ];
[1376] Fix | Delete
[1377] Fix | Delete
if ( isset( $this->_pagination_args['total_items'] ) ) {
[1378] Fix | Delete
$response['total_items_i18n'] = sprintf(
[1379] Fix | Delete
_n( '%s item', '%s items', $this->_pagination_args['total_items'] ),
[1380] Fix | Delete
number_format_i18n( $this->_pagination_args['total_items'] )
[1381] Fix | Delete
);
[1382] Fix | Delete
}
[1383] Fix | Delete
if ( isset( $this->_pagination_args['total_pages'] ) ) {
[1384] Fix | Delete
$response['total_pages'] = $this->_pagination_args['total_pages'];
[1385] Fix | Delete
$response['total_pages_i18n'] = number_format_i18n( $this->_pagination_args['total_pages'] );
[1386] Fix | Delete
}
[1387] Fix | Delete
[1388] Fix | Delete
die( PUM_Utils_Array::safe_json_encode( $response ) );
[1389] Fix | Delete
}
[1390] Fix | Delete
[1391] Fix | Delete
/**
[1392] Fix | Delete
* Send required variables to JavaScript land
[1393] Fix | Delete
*/
[1394] Fix | Delete
public function _js_vars() {
[1395] Fix | Delete
$args = [
[1396] Fix | Delete
'class' => get_class( $this ),
[1397] Fix | Delete
'screen' => [
[1398] Fix | Delete
'id' => $this->screen->id,
[1399] Fix | Delete
'base' => $this->screen->base,
[1400] Fix | Delete
],
[1401] Fix | Delete
];
[1402] Fix | Delete
[1403] Fix | Delete
printf( "<script type='text/javascript'>list_args = %s;</script>\n", PUM_Utils_Array::safe_json_encode( $args ) );
[1404] Fix | Delete
}
[1405] Fix | Delete
}
[1406] Fix | Delete
[1407] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function