how can sort my column

Question

How can I add order?

add_filter('manage_articles_posts_columns', 
function ( $columns ) 
{
    if( is_array( $columns ) && ! isset( $columns['post_views'] ) )
        $columns['post_views'] = __( 'views' );     
     if(current_user_can('administrator'))
    return $columns;
},  );

add_action( 'manage_articles_posts_custom_column', 
function ( $column_name, $post_id ) 
{
    if ( $column_name == 'post_views') {
        $post_view_count = get_post_meta($post_id, 'views', true);
        $count = $post_view_count ? $post_view_count : 0;
        if(current_user_can('administrator'))
            echo $count;
    }
 
}, 10, 2);
0
Mohammad Kamali 2 months 0 Answers 7 views 0

Leave an answer