• 5 Subscribers
  • 114 Views
1

When this is placed inside functions.php, it works.

When in the plugin directory (building a plugin), the post type is registered but not seen in the admin menu.

// Create Analysis Post Type
function create_post_type_analysis() {
$args = array(
        'labels' => array(
            'name' => __( 'Analyses' ),
            'singular_name' => __( 'Analysis' )
        ),
        'public' => true,
        'rewrite' => array('slug' => 'analyses'),
        'menu_position'       => 10,
        'supports' => array(
            'title',
            'editor',
            'excerpt',
            'trackbacks',
            'custom-fields',
            'comments',
            'revisions',
            'thumbnail',
            'author',
            'page-attributes'
        )
    );

register_post_type( 'Analyses',$args);
}

add_action( 'init', 'create_post_type_analysis', 10);

Latest version of WP and no other plugins installed.


0 answers in total

Answer this questsion