Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Design How to add menu_order in wordpress admin Column?

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #262321
    masum65
    Participant

    Hi Recently I am trying to developing a WordPress Theme and want to display menu order with sort. I added the column using below code but not sorting

    add_filter('manage_posts_columns', 'posts_columns_order', 5);
    add_action('manage_posts_custom_column', 'posts_custom_columns_order', 5, 2);
    function posts_columns_order($defaults){
        $defaults['menu_order'] = __('Order');
        return $defaults;
    }
    function posts_custom_columns_order($column_name, $id){
            global $post;
            if($column_name === 'menu_order'){
          $order = $post->menu_order;
          echo $order;
        }
    }
    
Viewing 1 post (of 1 total)
  • The forum ‘Design’ is closed to new topics and replies.