Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author mooberrydreams

    (@mooberrydreams)

    You’ll have to choose which one you want to use the book URL and which one to change. If you want to change the Mooberry Book Manager URLs or if you are unable to change the Sermon Manager URL, add this code to either a custom plugin you have made or in your child theme’s functions.php file :

    add_filter( 'mbdb_book_cpt', 'mbdb_change_book_slug' );
    function mbdb_change_book_slug( $args ) {
    	$args['rewrite']['slug'] = 'mbdb_book';
    	return $args;
    }

    ( change the mbdb_book in the 3rd line to whatever you want to set the URL to )

    Once the code is in place, you will need to reset your permalinks by going to Settings -> Permalinks and clicking the save button. You do not need to make any changes on this page. You only need to reset your permalinks once after adding this code.

    Hey @mooberrydreams,

    I am the developer of Sermon Manager.

    I am wondering how can we prevent this from happening in future, do you have any ideas?

    Thread Starter petitphp

    (@petitphp)

    Sorry for not replying sooner.

    Thank for your quick response and for providing a fix !

    Plugin Author mooberrydreams

    (@mooberrydreams)

    Nikola,

    One fix would be to make the slug a setting using the Options API, so that users could change it without code.

    A more complicated fix would be to somehow detect if another plugin is using the same slug and change the slug if so.

    Personally I like giving the users the option of what the slug should since it’s going to be in their URLs and possibly affect SEO.

    Plugin Author mooberrydreams

    (@mooberrydreams)

    How to get slugs of all registered post types: https://wordpress.stackexchange.com/questions/34410/get-list-of-all-registered-post-types-slugs

    Another alternative would be to detect there’s a conflict and alert the user and let them change one or both slugs.

    This would be a good thing for WP Core to do rather than put the responsibility on every plugin.

    One fix would be to make the slug a setting using the Options API, so that users could change it without code.

    […]

    Personally I like giving the users the option of what the slug should since it’s going to be in their URLs and possibly affect SEO.

    Good idea. I’ll certainly add the option in the next minor release.

    Another alternative would be to detect there’s a conflict and alert the user and let them change one or both slugs.

    I’ll implement both. 😉
    Allow users to change the slugs while alerting them if there’s a conflict. (and alert them if there’s a conflict in future if they install some other plugin)

    This would be a good thing for WP Core to do rather than put the responsibility on every plugin.

    Agreed. Maybe we should open an issue for it?

    Anyway, thanks for your insight. 🙂

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Rewrite rule conflict with Sermon Manager’ is closed to new replies.