| 1 |
<?php |
| 2 |
|
| 3 |
class WPUPG_Meta_Box_Post { |
| 4 |
|
| 5 |
public function __construct() |
| 6 |
{ |
| 7 |
add_action( 'admin_init', array( $this, 'add_meta_box' ), 10 ); |
| 8 |
} |
| 9 |
|
| 10 |
public function add_meta_box() |
| 11 |
{ |
| 12 |
$post_types = get_post_types( '', 'objects' ); |
| 13 |
|
| 14 |
unset( $post_types[WPUPG_POST_TYPE] ); |
| 15 |
unset( $post_types['revision'] ); |
| 16 |
unset( $post_types['nav_menu_item'] ); |
| 17 |
|
| 18 |
foreach( $post_types as $post_type => $options ) { |
| 19 |
|
| 20 |
if( !in_array( $post_type, WPUltimatePostGrid::option( 'meta_box_hide', array() ) ) ) { |
| 21 |
add_meta_box( |
| 22 |
'wpupg_meta_box_post', |
| 23 |
'WP Ultimate Post Grid', |
| 24 |
array( $this, 'meta_box_post' ), |
| 25 |
$post_type, |
| 26 |
'normal', |
| 27 |
'high' |
| 28 |
); |
| 29 |
} |
| 30 |
} |
| 31 |
|
| 32 |
} |
| 33 |
|
| 34 |
public function meta_box_post( $post ) |
| 35 |
{ |
| 36 |
include( WPUltimatePostGrid::get()->coreDir . '/helpers/meta_boxes/meta_box_post.php' ); |
| 37 |
} |
| 38 |
} |