• Resolved philippze

    (@philippze)


    How can I disable a Grid Metabox?

    A Metabox is a collection of grid boxes. The Metaboxes will be listed when we click on “Box” at the right top of the grid admin.

Viewing 1 replies (of 1 total)
  • Thread Starter philippze

    (@philippze)

    By using the action grid_metaboxes. Example:

    
    add_action( 'grid_metaboxes', function($result, $grid_id=null, $post_id=null) {
        $final_results = [];
        $allowed_types = ['static', 'abstract_list', 'post'];
        /* default: 'static', 'abstract_list', 'reference', 'post' */
        foreach($result as $item) {
            if (in_array($item['type'], $allowed_types)) {
                array_push($final_results, $item);
            }
        }
        return $final_results;
    });
    
    • This reply was modified 7 years, 6 months ago by philippze.
Viewing 1 replies (of 1 total)
  • The topic ‘How can I disable a Grid Metabox?’ is closed to new replies.