Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // File Security Check
- if ( ! defined( 'ABSPATH' ) ) {
- exit;
- }
- class ShapeCustomPosts {
- function __construct()
- {
- add_action( 'init', array( $this, 'shape_mega_menu') );
- }
- /**
- *
- * Shape Services Custom Post Type
- *
- */
- public function shape_mega_menu()
- {
- $labels = array(
- 'name' => _x( 'MegaMenu' , 'post type general name', 'one' ),
- 'singular_name' => _x( 'MegaMenu', 'post type singular name', 'one' ),
- 'menu_name' => _x( 'MegaMenu' , 'admin menu', 'one' ),
- 'name_admin_bar' => _x( 'MegaMenu', 'add new on admin bar', 'one' ),
- 'add_new' => _x( 'Add New', 'MegaMenu', 'one' ),
- 'add_new_item' => __( 'Add New ' . 'MegaMenu', 'one' ),
- 'new_item' => __( 'New ' . 'MegaMenu', 'one' ),
- 'edit_item' => __( 'Edit ' . 'MegaMenu', 'one' ),
- 'view_item' => __( 'View ' . 'MegaMenu', 'one' ),
- 'all_items' => __( 'MegaMenus', 'one' ),
- 'search_items' => __( 'Search MegaMenus', 'one' ),
- 'parent_item_colon' => __( 'Parent :', 'one' ),
- 'not_found' => __( 'No Services found.', 'one' ),
- 'not_found_in_trash' => __( 'No Services found in Trash.', 'one' )
- );
- $args = array(
- 'labels' => $labels,
- 'description' => __( 'Description.', 'one' ),
- 'public' => true,
- 'publicly_queryable' => true,
- 'show_ui' => true,
- 'show_in_menu' => true,
- 'query_var' => true,
- 'menu_icon' => 'dashicons-businessman',
- 'rewrite' => array( 'slug' => 'mega-menu', 'with_front' => true, 'pages' => true, 'feeds' => true ),
- 'capability_type' => 'post',
- 'has_archive' => true,
- 'hierarchical' => false,
- 'menu_position' => null,
- 'supports' => array( 'title', 'editor' )
- );
- register_post_type('mega_menu', $args);
- }
- }
- $shapeCustomPostInstance = new ShapeCustomPosts;
Advertisement
Add Comment
Please, Sign In to add comment