WordPress includes a new filter, register_post_type_args, which lets you hook into the arguments of a registered post type.
1 2 3 4 5 6 7 8 9 10 |
function wp1482371_custom_post_type_args( $args, $post_type ) { if ( $post_type == "animal-species" ) { $args['rewrite'] = array( 'slug' => 'animal' ); } return $args; } add_filter( 'register_post_type_args', 'wp1482371_custom_post_type_args', 20, 2 ); |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.