WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Some custom post types are not showing

[Resolved] Some custom post types are not showing

  • Hi

    I have some custom post types that are not showing in the Codepress Admin Columns admin section, other custom post types are showing like woocommerce products, coupons, but the custom post types that I created are not showing. Is there something I have to do when registering a custom post type for your plugin to recognise it. Any idea why this may be happening? Here is the code I used for creating my custom post type

    $presslabels = array(
            'name' => _x('Press', 'press'),
            'singular_name' => _x('Image', 'press'),
            'add_new' => _x('Add New', 'press'),
            'add_new_item' => __('Press'),
            'edit_item' => __('Edit Press'),
            'new_item' => __('New press'),
            'all_items' => __('Press'),
            'view_item' => __('View Press'),
            'search_items' => __('Search Press'),
            'not_found' =>  __('No Press found'),
            'not_found_in_trash' => __('No press found in Trash'),
            'parent_item_colon' => '',
            'menu_name' => 'Press'
            );
    
        $preassargs = array(
            'labels' => $presslabels,
            'public' => true,
            'show_ui' => true,
            'capability_type' => 'post',
            'hierarchical' => false,
            'rewrite' => true,
            'supports' => array('title','thumbnail','editor')
           );  
    
        register_post_type( 'press' , $preassargs );

    Any help would be great….Thanks

    http://wordpress.org/extend/plugins/codepress-admin-columns/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Tobias Schutter
    Participant

    @tschutter

    Maybe you forgot to place your register_post_type into an action hook?

    Example:

    function my_posttypes() {
         $preassargs = array(<bunch of arguments>);
         register_post_type( 'press' , $preassargs );
    }
    add_action( 'init', 'my_posttypes' );

    My custom post types are registered and I’m using them with no problem but Codepress Admin Columns is not seeing them.

    Plugin Author Tobias Schutter
    Participant

    @tschutter

    I think you have a small typo in your labels… so your post type is called ‘Image’ instead of ‘Press’. Try replacing:

    'singular_name' => _x('Image', 'press'),

    with

    'singular_name' => _x('Press', 'press'),

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Some custom post types are not showing’ is closed to new replies.