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
foreach ( $actions as $action => $link ) {
[500] Fix | Delete
++$i;
[501] Fix | Delete
( $i == $action_count ) ? $sep = '' : $sep = ' | ';
[502] Fix | Delete
$out .= "<span class='$action'>$link$sep</span>";
[503] Fix | Delete
}
[504] Fix | Delete
$out .= '</div>';
[505] Fix | Delete
[506] Fix | Delete
$out .= '<button type="button" class="toggle-row"><span class="screen-reader-text">' . __( 'Show more details' ) . '</span></button>';
[507] Fix | Delete
[508] Fix | Delete
return $out;
[509] Fix | Delete
}
[510] Fix | Delete
[511] Fix | Delete
/**
[512] Fix | Delete
* Display a monthly dropdown for filtering items
[513] Fix | Delete
*
[514] Fix | Delete
* @since 3.1.0
[515] Fix | Delete
* @access protected
[516] Fix | Delete
*
[517] Fix | Delete
* @global wpdb $wpdb
[518] Fix | Delete
* @global WP_Locale $wp_locale
[519] Fix | Delete
*
[520] Fix | Delete
* @param string $post_type
[521] Fix | Delete
*/
[522] Fix | Delete
protected function months_dropdown( $post_type ) {
[523] Fix | Delete
global $wpdb, $wp_locale;
[524] Fix | Delete
[525] Fix | Delete
/**
[526] Fix | Delete
* Filter whether to remove the 'Months' drop-down from the post list table.
[527] Fix | Delete
*
[528] Fix | Delete
* @since 4.2.0
[529] Fix | Delete
*
[530] Fix | Delete
* @param bool $disable Whether to disable the drop-down. Default false.
[531] Fix | Delete
* @param string $post_type The post type.
[532] Fix | Delete
*/
[533] Fix | Delete
if ( apply_filters( 'disable_months_dropdown', false, $post_type ) ) {
[534] Fix | Delete
return;
[535] Fix | Delete
}
[536] Fix | Delete
[537] Fix | Delete
$months = $wpdb->get_results( $wpdb->prepare( "
[538] Fix | Delete
SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month
[539] Fix | Delete
FROM $wpdb->posts
[540] Fix | Delete
WHERE post_type = %s
[541] Fix | Delete
ORDER BY post_date DESC
[542] Fix | Delete
", $post_type ) );
[543] Fix | Delete
[544] Fix | Delete
/**
[545] Fix | Delete
* Filter the 'Months' drop-down results.
[546] Fix | Delete
*
[547] Fix | Delete
* @since 3.7.0
[548] Fix | Delete
*
[549] Fix | Delete
* @param object $months The months drop-down query results.
[550] Fix | Delete
* @param string $post_type The post type.
[551] Fix | Delete
*/
[552] Fix | Delete
$months = apply_filters( 'months_dropdown_results', $months, $post_type );
[553] Fix | Delete
[554] Fix | Delete
$month_count = count( $months );
[555] Fix | Delete
[556] Fix | Delete
if ( !$month_count || ( 1 == $month_count && 0 == $months[0]->month ) )
[557] Fix | Delete
return;
[558] Fix | Delete
[559] Fix | Delete
$m = isset( $_GET['m'] ) ? (int) sanitize_text_field($_GET['m']) : 0;
[560] Fix | Delete
?>
[561] Fix | Delete
<label for="filter-by-date" class="screen-reader-text"><?php esc_html_e( 'Filter by date' ); ?></label>
[562] Fix | Delete
<select name="m" id="filter-by-date">
[563] Fix | Delete
<option<?php selected( $m, 0 ); ?> value="0"><?php esc_html_e( 'All dates' ); ?></option>
[564] Fix | Delete
<?php
[565] Fix | Delete
foreach ( $months as $arc_row ) {
[566] Fix | Delete
if ( 0 == $arc_row->year )
[567] Fix | Delete
continue;
[568] Fix | Delete
[569] Fix | Delete
$month = zeroise( $arc_row->month, 2 );
[570] Fix | Delete
$year = $arc_row->year;
[571] Fix | Delete
[572] Fix | Delete
printf( "<option %s value='%s'>%s</option>\n",
[573] Fix | Delete
selected( $m, $year . $month, false ),
[574] Fix | Delete
esc_attr( $arc_row->year . $month ),
[575] Fix | Delete
/* translators: 1: month name, 2: 4-digit year */
[576] Fix | Delete
sprintf( esc_html__( '%1$s %2$d' ), esc_html($wp_locale->get_month( $month )), esc_html($year) )
[577] Fix | Delete
);
[578] Fix | Delete
}
[579] Fix | Delete
?>
[580] Fix | Delete
</select>
[581] Fix | Delete
<?php
[582] Fix | Delete
}
[583] Fix | Delete
[584] Fix | Delete
/**
[585] Fix | Delete
* Display a view switcher
[586] Fix | Delete
*
[587] Fix | Delete
* @since 3.1.0
[588] Fix | Delete
* @access protected
[589] Fix | Delete
*
[590] Fix | Delete
* @param string $current_mode
[591] Fix | Delete
*/
[592] Fix | Delete
protected function view_switcher( $current_mode ) {
[593] Fix | Delete
?>
[594] Fix | Delete
<input type="hidden" name="mode" value="<?php echo esc_attr( $current_mode ); ?>" />
[595] Fix | Delete
<div class="view-switch">
[596] Fix | Delete
<?php
[597] Fix | Delete
foreach ( $this->modes as $mode => $title ) {
[598] Fix | Delete
$classes = array( 'view-' . $mode );
[599] Fix | Delete
if ( $current_mode == $mode )
[600] Fix | Delete
$classes[] = 'current';
[601] Fix | Delete
printf(
[602] Fix | Delete
wp_kses_post( "<a href='%s' class='%s' id='view-switch-$mode'><span class='screen-reader-text'>%s</span></a>\n" ),
[603] Fix | Delete
esc_url( add_query_arg( 'mode', $mode ) ),
[604] Fix | Delete
esc_html(implode( ' ', $classes )),
[605] Fix | Delete
esc_html($title)
[606] Fix | Delete
);
[607] Fix | Delete
}
[608] Fix | Delete
?>
[609] Fix | Delete
</div>
[610] Fix | Delete
<?php
[611] Fix | Delete
}
[612] Fix | Delete
[613] Fix | Delete
/**
[614] Fix | Delete
* Display a comment count bubble
[615] Fix | Delete
*
[616] Fix | Delete
* @since 3.1.0
[617] Fix | Delete
* @access protected
[618] Fix | Delete
*
[619] Fix | Delete
* @param int $post_id The post ID.
[620] Fix | Delete
* @param int $pending_comments Number of pending comments.
[621] Fix | Delete
*/
[622] Fix | Delete
protected function comments_bubble( $post_id, $pending_comments ) {
[623] Fix | Delete
$approved_comments = get_comments_number();
[624] Fix | Delete
[625] Fix | Delete
$approved_comments_number = number_format_i18n( $approved_comments );
[626] Fix | Delete
$pending_comments_number = number_format_i18n( $pending_comments );
[627] Fix | Delete
/* translators: numner comments, numner approved comments */
[628] Fix | Delete
$approved_only_phrase = sprintf( _n( '%s comment', '%s comments', $approved_comments ), $approved_comments_number );
[629] Fix | Delete
/* translators: numner comments, numner approved comments */
[630] Fix | Delete
$approved_phrase = sprintf( _n( '%s approved comment', '%s approved comments', $approved_comments ), $approved_comments_number );
[631] Fix | Delete
/* translators: numner comments, numner pending comments */
[632] Fix | Delete
$pending_phrase = sprintf( _n( '%s pending comment', '%s pending comments', $pending_comments ), $pending_comments_number );
[633] Fix | Delete
[634] Fix | Delete
// No comments at all.
[635] Fix | Delete
if ( ! $approved_comments && ! $pending_comments ) {
[636] Fix | Delete
printf( '<span aria-hidden="true">—</span><span class="screen-reader-text">%s</span>',
[637] Fix | Delete
esc_html__( 'No comments' )
[638] Fix | Delete
);
[639] Fix | Delete
// Approved comments have different display depending on some conditions.
[640] Fix | Delete
} elseif ( $approved_comments ) {
[641] Fix | Delete
printf( wp_kses_post('<a href="%s" class="post-com-count post-com-count-approved"><span class="comment-count-approved" aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></a>' ),
[642] Fix | Delete
esc_url( add_query_arg( array( 'p' => $post_id, 'comment_status' => 'approved' ), admin_url( 'edit-comments.php' ) ) ),
[643] Fix | Delete
esc_html($approved_comments_number),
[644] Fix | Delete
$pending_comments ? esc_html($approved_phrase) : esc_html($approved_only_phrase)
[645] Fix | Delete
);
[646] Fix | Delete
} else {
[647] Fix | Delete
printf( wp_kses_post( '<span class="post-com-count post-com-count-no-comments"><span class="comment-count comment-count-no-comments" aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></span>'),
[648] Fix | Delete
esc_html($approved_comments_number),
[649] Fix | Delete
$pending_comments ? esc_html__( 'No approved comments' ) : esc_html__( 'No comments' )
[650] Fix | Delete
);
[651] Fix | Delete
}
[652] Fix | Delete
[653] Fix | Delete
if ( $pending_comments ) {
[654] Fix | Delete
printf( '<a href="%s" class="post-com-count post-com-count-pending"><span class="comment-count-pending" aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></a>',
[655] Fix | Delete
esc_url( add_query_arg( array( 'p' => $post_id, 'comment_status' => 'moderated' ), admin_url( 'edit-comments.php' ) ) ),
[656] Fix | Delete
esc_html($pending_comments_number),
[657] Fix | Delete
esc_html($pending_phrase)
[658] Fix | Delete
);
[659] Fix | Delete
}
[660] Fix | Delete
}
[661] Fix | Delete
[662] Fix | Delete
/**
[663] Fix | Delete
* Get the current page number
[664] Fix | Delete
*
[665] Fix | Delete
* @since 3.1.0
[666] Fix | Delete
* @access public
[667] Fix | Delete
*
[668] Fix | Delete
* @return int
[669] Fix | Delete
*/
[670] Fix | Delete
public function get_pagenum() {
[671] Fix | Delete
$pagenum = isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 0;
[672] Fix | Delete
[673] Fix | Delete
if ( isset( $this->_pagination_args['total_pages'] ) && $pagenum > $this->_pagination_args['total_pages'] )
[674] Fix | Delete
$pagenum = $this->_pagination_args['total_pages'];
[675] Fix | Delete
[676] Fix | Delete
return max( 1, $pagenum );
[677] Fix | Delete
}
[678] Fix | Delete
[679] Fix | Delete
/**
[680] Fix | Delete
* Get number of items to display on a single page
[681] Fix | Delete
*
[682] Fix | Delete
* @since 3.1.0
[683] Fix | Delete
* @access protected
[684] Fix | Delete
*
[685] Fix | Delete
* @param string $option
[686] Fix | Delete
* @param int $default
[687] Fix | Delete
* @return int
[688] Fix | Delete
*/
[689] Fix | Delete
protected function get_items_per_page( $option, $default = 20 ) {
[690] Fix | Delete
$per_page = (int) get_user_option( $option );
[691] Fix | Delete
if ( empty( $per_page ) || $per_page < 1 )
[692] Fix | Delete
$per_page = $default;
[693] Fix | Delete
[694] Fix | Delete
/**
[695] Fix | Delete
* Filter the number of items to be displayed on each page of the list table.
[696] Fix | Delete
*
[697] Fix | Delete
* The dynamic hook name, $option, refers to the `per_page` option depending
[698] Fix | Delete
* on the type of list table in use. Possible values include: 'edit_comments_per_page',
[699] Fix | Delete
* 'sites_network_per_page', 'site_themes_network_per_page', 'themes_network_per_page',
[700] Fix | Delete
* 'users_network_per_page', 'edit_post_per_page', 'edit_page_per_page',
[701] Fix | Delete
* 'edit_{$post_type}_per_page', etc.
[702] Fix | Delete
*
[703] Fix | Delete
* @since 2.9.0
[704] Fix | Delete
*
[705] Fix | Delete
* @param int $per_page Number of items to be displayed. Default 20.
[706] Fix | Delete
*/
[707] Fix | Delete
return (int) apply_filters( $option, $per_page );
[708] Fix | Delete
}
[709] Fix | Delete
[710] Fix | Delete
/**
[711] Fix | Delete
* Display the pagination.
[712] Fix | Delete
*
[713] Fix | Delete
* @since 3.1.0
[714] Fix | Delete
* @access protected
[715] Fix | Delete
*
[716] Fix | Delete
* @param string $which
[717] Fix | Delete
*/
[718] Fix | Delete
protected function pagination( $which ) {
[719] Fix | Delete
if ( empty( $this->_pagination_args ) ) {
[720] Fix | Delete
return;
[721] Fix | Delete
}
[722] Fix | Delete
[723] Fix | Delete
$total_items = $this->_pagination_args['total_items'];
[724] Fix | Delete
$total_pages = $this->_pagination_args['total_pages'];
[725] Fix | Delete
$infinite_scroll = false;
[726] Fix | Delete
if ( isset( $this->_pagination_args['infinite_scroll'] ) ) {
[727] Fix | Delete
$infinite_scroll = $this->_pagination_args['infinite_scroll'];
[728] Fix | Delete
}
[729] Fix | Delete
/* translators: total items */
[730] Fix | Delete
$output = '<span class="displaying-num">' . sprintf( _n( '%s item', '%s items', $total_items ), number_format_i18n( $total_items ) ) . '</span>';
[731] Fix | Delete
[732] Fix | Delete
$current = $this->get_pagenum();
[733] Fix | Delete
[734] Fix | Delete
// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
[735] Fix | Delete
$sbpb_server_host = isset($_SERVER['HTTP_HOST']) ? sanitize_text_field( $_SERVER['HTTP_HOST'] ) : '';
[736] Fix | Delete
$sbpb_server_requesturi = isset($_SERVER['REQUEST_URI']) ? sanitize_text_field( $_SERVER['REQUEST_URI'] ) : '';
[737] Fix | Delete
$current_url = set_url_scheme( 'http://' . $sbpb_server_host . $sbpb_server_requesturi );
[738] Fix | Delete
$current_url = remove_query_arg( array( 'hotkeys_highlight_last', 'hotkeys_highlight_first' ), $current_url );
[739] Fix | Delete
[740] Fix | Delete
$page_links = array();
[741] Fix | Delete
[742] Fix | Delete
$total_pages_before = '<span class="paging-input">';
[743] Fix | Delete
$total_pages_after = '</span>';
[744] Fix | Delete
[745] Fix | Delete
$disable_first = $disable_last = $disable_prev = $disable_next = false;
[746] Fix | Delete
[747] Fix | Delete
if ( $current == 1 ) {
[748] Fix | Delete
$disable_first = true;
[749] Fix | Delete
$disable_prev = true;
[750] Fix | Delete
}
[751] Fix | Delete
if ( $current == 2 ) {
[752] Fix | Delete
$disable_first = true;
[753] Fix | Delete
}
[754] Fix | Delete
if ( $current == $total_pages ) {
[755] Fix | Delete
$disable_last = true;
[756] Fix | Delete
$disable_next = true;
[757] Fix | Delete
}
[758] Fix | Delete
if ( $current == $total_pages - 1 ) {
[759] Fix | Delete
$disable_last = true;
[760] Fix | Delete
}
[761] Fix | Delete
[762] Fix | Delete
if ( $disable_first ) {
[763] Fix | Delete
$page_links[] = '<span class="tablenav-pages-navspan disabled" aria-hidden="true">&laquo;</span>';
[764] Fix | Delete
} else {
[765] Fix | Delete
$page_links[] = sprintf( "<a class='first-page button' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
[766] Fix | Delete
esc_url( remove_query_arg( 'paged', $current_url ) ),
[767] Fix | Delete
__( 'First page' ),
[768] Fix | Delete
'&laquo;'
[769] Fix | Delete
);
[770] Fix | Delete
}
[771] Fix | Delete
[772] Fix | Delete
if ( $disable_prev ) {
[773] Fix | Delete
$page_links[] = '<span class="tablenav-pages-navspan disabled" aria-hidden="true">&lsaquo;</span>';
[774] Fix | Delete
} else {
[775] Fix | Delete
$page_links[] = sprintf( "<a class='prev-page button' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
[776] Fix | Delete
esc_url( add_query_arg( 'paged', max( 1, $current-1 ), $current_url ) ),
[777] Fix | Delete
__( 'Previous page' ),
[778] Fix | Delete
'&lsaquo;'
[779] Fix | Delete
);
[780] Fix | Delete
}
[781] Fix | Delete
[782] Fix | Delete
if ( 'bottom' == $which ) {
[783] Fix | Delete
$html_current_page = $current;
[784] Fix | Delete
$total_pages_before = '<span class="screen-reader-text">' . __( 'Current Page' ) . '</span><span id="table-paging" class="paging-input">';
[785] Fix | Delete
} else {
[786] Fix | Delete
$html_current_page = sprintf( "%s<input class='current-page' id='current-page-selector' type='text' name='paged' value='%s' size='%d' aria-describedby='table-paging' />",
[787] Fix | Delete
'<label for="current-page-selector" class="screen-reader-text">' . __( 'Current Page' ) . '</label>',
[788] Fix | Delete
$current,
[789] Fix | Delete
strlen( $total_pages )
[790] Fix | Delete
);
[791] Fix | Delete
}
[792] Fix | Delete
$html_total_pages = sprintf( "<span class='total-pages'>%s</span>", number_format_i18n( $total_pages ) );
[793] Fix | Delete
/* translators: current page, total pages */
[794] Fix | Delete
$page_links[] = $total_pages_before . sprintf( _x( '%1$s of %2$s', 'paging' ), $html_current_page, $html_total_pages ) . $total_pages_after;
[795] Fix | Delete
[796] Fix | Delete
if ( $disable_next ) {
[797] Fix | Delete
$page_links[] = '<span class="tablenav-pages-navspan disabled" aria-hidden="true">&rsaquo;</span>';
[798] Fix | Delete
} else {
[799] Fix | Delete
$page_links[] = sprintf( "<a class='next-page button' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
[800] Fix | Delete
esc_url( add_query_arg( 'paged', min( $total_pages, $current+1 ), $current_url ) ),
[801] Fix | Delete
__( 'Next page' ),
[802] Fix | Delete
'&rsaquo;'
[803] Fix | Delete
);
[804] Fix | Delete
}
[805] Fix | Delete
[806] Fix | Delete
if ( $disable_last ) {
[807] Fix | Delete
$page_links[] = '<span class="tablenav-pages-navspan disabled" aria-hidden="true">&raquo;</span>';
[808] Fix | Delete
} else {
[809] Fix | Delete
$page_links[] = sprintf( "<a class='last-page button' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
[810] Fix | Delete
esc_url( add_query_arg( 'paged', $total_pages, $current_url ) ),
[811] Fix | Delete
__( 'Last page' ),
[812] Fix | Delete
'&raquo;'
[813] Fix | Delete
);
[814] Fix | Delete
}
[815] Fix | Delete
[816] Fix | Delete
$pagination_links_class = 'pagination-links';
[817] Fix | Delete
if ( ! empty( $infinite_scroll ) ) {
[818] Fix | Delete
$pagination_links_class = ' hide-if-js';
[819] Fix | Delete
}
[820] Fix | Delete
$output .= "\n<span class='$pagination_links_class'>" . join( "\n", $page_links ) . '</span>';
[821] Fix | Delete
[822] Fix | Delete
if ( $total_pages ) {
[823] Fix | Delete
$page_class = $total_pages < 2 ? ' one-page' : '';
[824] Fix | Delete
} else {
[825] Fix | Delete
$page_class = ' no-pages';
[826] Fix | Delete
}
[827] Fix | Delete
$this->_pagination = "<div class='tablenav-pages{$page_class}'>$output</div>";
[828] Fix | Delete
[829] Fix | Delete
echo wp_kses($this->_pagination, AdminHelper::allowed_html_tags());
[830] Fix | Delete
}
[831] Fix | Delete
[832] Fix | Delete
/**
[833] Fix | Delete
* Get a list of columns. The format is:
[834] Fix | Delete
* 'internal-name' => 'Title'
[835] Fix | Delete
*
[836] Fix | Delete
* @since 3.1.0
[837] Fix | Delete
* @access public
[838] Fix | Delete
* @abstract
[839] Fix | Delete
*
[840] Fix | Delete
* @return array
[841] Fix | Delete
*/
[842] Fix | Delete
public function get_columns() {
[843] Fix | Delete
die( 'function WPCListTable::get_columns() must be over-ridden in a sub-class.' );
[844] Fix | Delete
}
[845] Fix | Delete
[846] Fix | Delete
/**
[847] Fix | Delete
* Get a list of sortable columns. The format is:
[848] Fix | Delete
* 'internal-name' => 'orderby'
[849] Fix | Delete
* or
[850] Fix | Delete
* 'internal-name' => array( 'orderby', true )
[851] Fix | Delete
*
[852] Fix | Delete
* The second format will make the initial sorting order be descending
[853] Fix | Delete
*
[854] Fix | Delete
* @since 3.1.0
[855] Fix | Delete
* @access protected
[856] Fix | Delete
*
[857] Fix | Delete
* @return array
[858] Fix | Delete
*/
[859] Fix | Delete
protected function get_sortable_columns() {
[860] Fix | Delete
return array();
[861] Fix | Delete
}
[862] Fix | Delete
[863] Fix | Delete
/**
[864] Fix | Delete
* Gets the name of the default primary column.
[865] Fix | Delete
*
[866] Fix | Delete
* @since 4.3.0
[867] Fix | Delete
* @access protected
[868] Fix | Delete
*
[869] Fix | Delete
* @return string Name of the default primary column, in this case, an empty string.
[870] Fix | Delete
*/
[871] Fix | Delete
protected function get_default_primary_column_name() {
[872] Fix | Delete
$columns = $this->get_columns();
[873] Fix | Delete
$column = '';
[874] Fix | Delete
[875] Fix | Delete
// We need a primary defined so responsive views show something,
[876] Fix | Delete
// so let's fall back to the first non-checkbox column.
[877] Fix | Delete
foreach( $columns as $col => $column_name ) {
[878] Fix | Delete
if ( 'bulk' === $col ) {
[879] Fix | Delete
continue;
[880] Fix | Delete
}
[881] Fix | Delete
[882] Fix | Delete
$column = $col;
[883] Fix | Delete
break;
[884] Fix | Delete
}
[885] Fix | Delete
[886] Fix | Delete
return $column;
[887] Fix | Delete
}
[888] Fix | Delete
[889] Fix | Delete
/**
[890] Fix | Delete
* Gets the name of the primary column.
[891] Fix | Delete
*
[892] Fix | Delete
* @since 4.3.0
[893] Fix | Delete
* @access protected
[894] Fix | Delete
*
[895] Fix | Delete
* @return string The name of the primary column.
[896] Fix | Delete
*/
[897] Fix | Delete
protected function get_primary_column_name() {
[898] Fix | Delete
$columns = $this->get_columns();
[899] Fix | Delete
$default = $this->get_default_primary_column_name();
[900] Fix | Delete
[901] Fix | Delete
// If the primary column doesn't exist fall back to the
[902] Fix | Delete
// first non-checkbox column.
[903] Fix | Delete
if ( ! isset( $columns[ $default ] ) ) {
[904] Fix | Delete
$default = $this->get_default_primary_column_name();
[905] Fix | Delete
}
[906] Fix | Delete
[907] Fix | Delete
/**
[908] Fix | Delete
* Filter the name of the primary column for the current list table.
[909] Fix | Delete
*
[910] Fix | Delete
* @since 4.3.0
[911] Fix | Delete
*
[912] Fix | Delete
* @param string $default Column name default for the specific list table, e.g. 'name'.
[913] Fix | Delete
* @param string $context Screen ID for specific list table, e.g. 'plugins'.
[914] Fix | Delete
*/
[915] Fix | Delete
$column = apply_filters( 'list_table_primary_column', $default, $this->screen->id );
[916] Fix | Delete
[917] Fix | Delete
if ( empty( $column ) || ! isset( $columns[ $column ] ) ) {
[918] Fix | Delete
$column = $default;
[919] Fix | Delete
}
[920] Fix | Delete
[921] Fix | Delete
return $column;
[922] Fix | Delete
}
[923] Fix | Delete
[924] Fix | Delete
/**
[925] Fix | Delete
* Get a list of all, hidden and sortable columns, with filter applied
[926] Fix | Delete
*
[927] Fix | Delete
* @since 3.1.0
[928] Fix | Delete
* @access protected
[929] Fix | Delete
*
[930] Fix | Delete
* @return array
[931] Fix | Delete
*/
[932] Fix | Delete
protected function get_column_info() {
[933] Fix | Delete
// $_column_headers is already set / cached
[934] Fix | Delete
if ( isset( $this->_column_headers ) && is_array( $this->_column_headers ) ) {
[935] Fix | Delete
// Back-compat for list tables that have been manually setting $_column_headers for horse reasons.
[936] Fix | Delete
// In 4.3, we added a fourth argument for primary column.
[937] Fix | Delete
$column_headers = array( array(), array(), array(), $this->get_primary_column_name() );
[938] Fix | Delete
foreach ( $this->_column_headers as $key => $value ) {
[939] Fix | Delete
$column_headers[ $key ] = $value;
[940] Fix | Delete
}
[941] Fix | Delete
[942] Fix | Delete
return $column_headers;
[943] Fix | Delete
}
[944] Fix | Delete
[945] Fix | Delete
$columns = get_column_headers( $this->screen );
[946] Fix | Delete
$hidden = get_hidden_columns( $this->screen );
[947] Fix | Delete
[948] Fix | Delete
$sortable_columns = $this->get_sortable_columns();
[949] Fix | Delete
/**
[950] Fix | Delete
* Filter the list table sortable columns for a specific screen.
[951] Fix | Delete
*
[952] Fix | Delete
* The dynamic portion of the hook name, `$this->screen->id`, refers
[953] Fix | Delete
* to the ID of the current screen, usually a string.
[954] Fix | Delete
*
[955] Fix | Delete
* @since 3.5.0
[956] Fix | Delete
*
[957] Fix | Delete
* @param array $sortable_columns An array of sortable columns.
[958] Fix | Delete
*/
[959] Fix | Delete
$_sortable = apply_filters( "manage_{$this->screen->id}_sortable_columns", $sortable_columns );
[960] Fix | Delete
[961] Fix | Delete
$sortable = array();
[962] Fix | Delete
foreach ( $_sortable as $id => $data ) {
[963] Fix | Delete
if ( empty( $data ) )
[964] Fix | Delete
continue;
[965] Fix | Delete
[966] Fix | Delete
$data = (array) $data;
[967] Fix | Delete
if ( !isset( $data[1] ) )
[968] Fix | Delete
$data[1] = false;
[969] Fix | Delete
[970] Fix | Delete
$sortable[$id] = $data;
[971] Fix | Delete
}
[972] Fix | Delete
[973] Fix | Delete
$primary = $this->get_primary_column_name();
[974] Fix | Delete
$this->_column_headers = array( $columns, $hidden, $sortable, $primary );
[975] Fix | Delete
[976] Fix | Delete
return $this->_column_headers;
[977] Fix | Delete
}
[978] Fix | Delete
[979] Fix | Delete
/**
[980] Fix | Delete
* Return number of visible columns
[981] Fix | Delete
*
[982] Fix | Delete
* @since 3.1.0
[983] Fix | Delete
* @access public
[984] Fix | Delete
*
[985] Fix | Delete
* @return int
[986] Fix | Delete
*/
[987] Fix | Delete
public function get_column_count() {
[988] Fix | Delete
list ( $columns, $hidden ) = $this->get_column_info();
[989] Fix | Delete
$hidden = array_intersect( array_keys( $columns ), array_filter( $hidden ) );
[990] Fix | Delete
return count( $columns ) - count( $hidden );
[991] Fix | Delete
}
[992] Fix | Delete
[993] Fix | Delete
/**
[994] Fix | Delete
* Print column headers, accounting for hidden and sortable columns.
[995] Fix | Delete
*
[996] Fix | Delete
* @since 3.1.0
[997] Fix | Delete
* @access public
[998] Fix | Delete
*
[999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function