Bug in WordPress 3.0 Custom Post Types

Well this one threw me!

I was trying out the new custom post types in WordPress 3.0 RC1 and could not work out why mine wasn’t working even when I copied an example from the web and only changed a few things.

It turns out that there is a limitation in the naming of post types – they cannot have a name longer than 20 characters!

If you use more than 20 characters, the “Publish” button becomes “Submit for Review” and if you submit, you get the dreaded:

Are you sure you want to do this?
Please try again.

error.

  • Sorry Mukul, I’m not sure what is going on for you. Clearly not quite the same issue as mine as your name is short enough.

    I’m guessing that there is an error in your syntax somewhere that is triggering the same message. Maybe try comparing your code against an example from the internet.

  • Mukul

    Hello Julian,
    I’m using following code and still getting the error/ issue

    public static function register_chunk_post_type_simple() { register_post_type( ‘chunk’, array( ‘label’ => ‘Chunks’, ‘labels’ => array( ‘add_new’ => ‘Add New’, ‘add_new_item’ => ‘Add New Chunk’, ‘edit_item’ => ‘Edit Chunk’, ‘new_item’ => ‘New Chunk’, ‘view_item’ => ‘View Chunk’, ‘search_items’ => ‘Search Chunks’, ‘not_found’ => ‘No chunks Found’, ‘not_found_in_trash’=> ‘Not Found in Trash’, ), ‘description’ => ‘Reusable chunks’, ‘public’ => true, ‘show_ui’ => true, ‘menu_position’ => 5, ‘supports’ => array(‘title’,’editor’,’custom’), ) ); }

    using WP 3.4.1 on xampp 1.7.0

    Can you please suggest the reason?