# wp-ultimate-post-grid/2.8.0/helpers/meta_box_post.php

WP Ultimate Post Grid, version 2.8.0. 38 lines.

- Page: https://pluginprobe.com/plugins/wp-ultimate-post-grid/2.8.0/code/helpers/meta_box_post.php
- Raw: https://pluginprobe.com/plugins/wp-ultimate-post-grid/2.8.0/raw/helpers/meta_box_post.php
- Modified: 2018-11-13T13:03:14+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/wp-ultimate-post-grid/2.8.0/code/helpers/meta_box_post.php#L10-L20`.

```php
<?php

class WPUPG_Meta_Box_Post {

    public function __construct()
    {
        add_action( 'admin_init', array( $this, 'add_meta_box' ), 10 );
    }

    public function add_meta_box()
    {
        $post_types = get_post_types( '', 'objects' );

        unset( $post_types[WPUPG_POST_TYPE] );
        unset( $post_types['revision'] );
        unset( $post_types['nav_menu_item'] );

        foreach( $post_types as $post_type => $options ) {

            if( !in_array( $post_type, WPUltimatePostGrid::option( 'meta_box_hide', array() ) ) ) {
                add_meta_box(
                    'wpupg_meta_box_post',
                    'WP Ultimate Post Grid',
                    array( $this, 'meta_box_post' ),
                    $post_type,
                    'normal',
                    'high'
                );
            }
        }

    }

    public function meta_box_post( $post )
    {
        include( WPUltimatePostGrid::get()->coreDir . '/helpers/meta_boxes/meta_box_post.php' );
    }
}
```
