WordPress.org

Ready to get started?Download WordPress

Forums

Codepress Admin Columns
[resolved] Some custom post types are not showing (4 posts)

  1. haleeben
    Member
    Posted 1 year ago #

    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/

  2. Tobias Schutter
    Member
    Plugin Author

    Posted 1 year ago #

    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' );
  3. haleeben
    Member
    Posted 1 year ago #

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

  4. Tobias Schutter
    Member
    Plugin Author

    Posted 1 year ago #

    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'),

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic