php aggiunge una colonna ordinabile nella vista sommario con la data dell'ultima modifica
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php aggiunge una colonna ordinabile nella vista sommario con la data dell'ultima modifica相关的知识,希望对你有一定的参考价值。
add_filter( 'manage_edit-post_columns', 'aco_last_modified_admin_column' );
// Create the last modified column
function aco_last_modified_admin_column( $columns ) {
$columns['modified-last'] =__( 'Last Modified', 'aco' );
return $columns;
}
add_filter( 'manage_edit-post_sortable_columns', 'aco_sortable_last_modified_column' );
// Allow that content to be sortable by modified time information
function aco_sortable_last_modified_column( $columns ) {
$columns['modified-last'] = 'modified';
return $columns;
}
add_action( 'manage_posts_custom_column', 'aco_last_modified_admin_column_content', 10, 2 );
// Format the output
function aco_last_modified_admin_column_content( $column_name, $post_id ) {
// Do not continue if this is not the modified column
if ( 'modified-last' != $column_name )
return;
$modified_date = the_modified_date( 'Y/m/d - g:i A' );
$modified_author = get_the_modified_author();
echo $modified_date;
echo '<br>';
echo '<strong>' . $modified_author . '</strong>';
}
以上是关于php aggiunge una colonna ordinabile nella vista sommario con la data dell'ultima modifica的主要内容,如果未能解决你的问题,请参考以下文章