Solution for permalink issue
-
I’ve been looking at how to help with the permalink issue with this plugin.
One way is for existing users to add this piece of code to your functions.php file
function ontrapage_custom_post_type_mod( $args, $post_type ) { if ( $post_type == "ontrapage" ) { $args['rewrite'] = array( 'slug' => '/' ); } return $args; } add_filter( 'register_post_type_args', 'ontrapage_custom_post_type_mod', 10, 2 );
This will allow any type of permalink structures you have.
For developers of this plugin, please update the way you register the ontrapage post type.
Instead of
'rewrite' => array( 'slug' => 'o' )
change it to
'rewrite' => array( 'slug' => '/' )
This will make things so much simpler for what you are trying to achieve to make ontrapage custom post type behave like a wordpress page.
Once this is done, the removeSlug() and interceptRequestTrickery() functions can be removed from the plugin.
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Solution for permalink issue’ is closed to new replies.