| 1 |
<?php |
| 2 |
|
| 3 |
class WPUPG_Post_Type { |
| 4 |
|
| 5 |
public function __construct() |
| 6 |
{ |
| 7 |
add_action( 'init', array( $this, 'register_post_type' ), 1); |
| 8 |
} |
| 9 |
|
| 10 |
public function register_post_type() |
| 11 |
{ |
| 12 |
$name = __( 'Grids', 'wp-ultimate-post-grid' ); |
| 13 |
$singular = __( 'Grid', 'wp-ultimate-post-grid' ); |
| 14 |
|
| 15 |
$args = apply_filters( 'wpupg_register_post_type', |
| 16 |
array( |
| 17 |
'labels' => array( |
| 18 |
'name' => $name, |
| 19 |
'singular_name' => $singular, |
| 20 |
'add_new' => __( 'Add New', 'wp-ultimate-post-grid' ), |
| 21 |
'add_new_item' => __( 'Add New', 'wp-ultimate-post-grid' ) . ' ' . $singular, |
| 22 |
'edit' => __( 'Edit', 'wp-ultimate-post-grid' ), |
| 23 |
'edit_item' => __( 'Edit', 'wp-ultimate-post-grid' ) . ' ' . $singular, |
| 24 |
'new_item' => __( 'New', 'wp-ultimate-post-grid' ) . ' ' . $singular, |
| 25 |
'view' => __( 'View', 'wp-ultimate-post-grid' ), |
| 26 |
'view_item' => __( 'View', 'wp-ultimate-post-grid' ) . ' ' . $singular, |
| 27 |
'search_items' => __( 'Search', 'wp-ultimate-post-grid' ) . ' ' . $name, |
| 28 |
'not_found' => __( 'No', 'wp-ultimate-post-grid' ) . ' ' . $name . ' ' . __( 'found.', 'wp-ultimate-post-grid' ), |
| 29 |
'not_found_in_trash' => __( 'No', 'wp-ultimate-post-grid' ) . ' ' . $name . ' ' . __( 'found in trash.', 'wp-ultimate-post-grid' ), |
| 30 |
'parent' => __( 'Parent', 'wp-ultimate-post-grid' ) . ' ' . $singular, |
| 31 |
), |
| 32 |
'public' => true, |
| 33 |
'exclude_from_search' => true, |
| 34 |
'show_ui' => true, |
| 35 |
'menu_position' => 20, |
| 36 |
'supports' => array( 'title' ), |
| 37 |
'taxonomies' => array(), |
| 38 |
'menu_icon' => 'dashicons-grid-view', //WPUltimatePostGrid::get()->coreUrl . '/img/icon_16.png', |
| 39 |
'has_archive' => false, |
| 40 |
'rewrite' => false, |
| 41 |
) |
| 42 |
); |
| 43 |
|
| 44 |
register_post_type( WPUPG_POST_TYPE, $args ); |
| 45 |
} |
| 46 |
} |