Forums

Bug with register_post_type(order) (3 posts)

  1. bridge2web
    Member
    Posted 1 year ago #

    I found a bug in the registration custom type

    <?php register_post_type('order', $args);?>
    is successful

    but in wp admin all posts not listed
    /wp-admin/edit.php
    /wp-admin/edit.php?post_type=order

    I think it's because
    'order' is "stopword"
    it is used in query_posts()

    Please fix in next releases…

  2. 123milliseconds
    Member
    Posted 1 year ago #

  3. keesiemeijer
    moderator
    Posted 1 year ago #

    You can still register the post type with :

    register_post_type( 'my_order',
    		array(
    			'labels' => array(
    				'name' => __( 'Order' ),
    				'singular_name' => __( 'Order' )
    			),
    		'public' => true,
                    'rewrite' => array('slug' => 'order')
    
    		)
    	);

    This will show the post type as "Order" in the wp-admin and use "order" in your urls.

Topic Closed

This topic has been closed to new replies.

About this Topic