Respostas:
Se você não deseja clicar sempre na coluna "Título" para classificar suas postagens por título, pode inserir esse código no functions.phparquivo do seu tema WordPress atualmente ativo ou em um plug-in. Isso sempre ordenará automaticamente suas postagens para você, para que você não precise clicar na coluna do título todas as vezes.
Você pode usar isso para definir a ordem de classificação padrão nos tipos de postagem.
/* Sort posts in wp_list_table by column in ascending or descending order. */
function custom_post_order($query){
/*
Set post types.
_builtin => true returns WordPress default post types.
_builtin => false returns custom registered post types.
*/
$post_types = get_post_types(array('_builtin' => true), 'names');
/* The current post type. */
$post_type = $query->get('post_type');
/* Check post types. */
if(in_array($post_type, $post_types)){
/* Post Column: e.g. title */
if($query->get('orderby') == ''){
$query->set('orderby', 'title');
}
/* Post Order: ASC / DESC */
if($query->get('order') == ''){
$query->set('order', 'ASC');
}
}
}
if(is_admin()){
add_action('pre_get_posts', 'custom_post_order');
}
Você pode usar algumas dessas condições de exemplo ...
/* Effects all post types in the array. */
if(in_array($post_type, $post_types)){
}
/* Effects only a specific post type in the array of post types. */
if(in_array($post_type, $post_types) && $post_type == 'your_post_type_name'){
}
/* Effects all post types in the array of post types, except a specific post type. */
if(in_array($post_type, $post_types) && $post_type != 'your_post_type_name'){
}
Se você deseja aplicar essa classificação em TODOS os tipos de postagem, independentemente de serem ou não "incorporados" ...
Mude isso:
$post_types = get_post_types(array('_builtin' => true), 'names');
Para isso:
$post_types = get_post_types('', 'names');
Ah, clique nesse pequeno título para alternar a classificação alfabética ....

if ( ! is_admin ) { return; }