I understand how to register a custom post type, customize the slug and decide whether to add the 'front' (the WP permalink settings) or not.
What I'd like to do is customize the permalink by adding
?username
At the end of the custom post type's url. Now I know the cleaned up Author Name can be added in the WP permalink settings but I don't want that - I'm looking for the username used to login.
For example: I create a custom post type called 'Home' (singular) with the custom slug 'homes.' The url would be:
www.mydomain.com/homes/postname
I want the url to look like this instead:
www.mydomain.com/homes/postname?username
I'm not sure how to do it by modifying the usual method of registering a content type:
add_action( 'init', 'create_posttype' );
function create_posttype() {
register_post_type( 'home',
array(
'labels' => array(
'name' => __( 'Homes' ),
'singular_name' => __( 'Home' )
),
'public' => true,
'has_archive' => true,
'rewrite' => array('slug' => 'homes'),
)
);
}
I experimented a bit and ended up making my site completely inaccessible so I decided some help would be worth asking for :P