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