Hi @priscillamc,
That is correct, we created a custom admin settings page that allows users to change the slug for a custom post type.
Example is a post type called ‘programs’ which would have a slug of ‘programs’. On the settings page users can change the slug to something like ‘academic-programs’ so the slug would be ‘www.site.com/academic-programs’. The slug value is saved the the DB using register_settings(). We fire flush_rewrite_rules() whenever the settings page is saved/updated. Using register_post_type_args() $args[‘rewrite’][‘slug’] we are able to use our new slug value from the DB for the rewrite slug.
Currently all permalinks for the custom post type update exactly as expected where ever they are in use but for one instance: Yoast breadcrumbs.
The Yoast issue we are experiencing directly relates to custom breadcrumbs not updating with the new permalink for the custom post type.
We had expected that the permalink saved in the indexables table would be updated when flush_rewrite_rules() is run, but that is not what is happening.
I have found that after changing and saving the slug on our settings page, we then go to the Yoast settings page /admin.php?page=wpseo_titles#top#post-types and click ‘save’ the breadcrumb permalink will be updated with the correct slug.
If we do not perform this manual step, the breadcrumbs will continue to use the old version of the slug.
Our hope is there is a function that allows us to programmatically trigger this permalink update whenever our settings page is updated.
Thank you for your help.
-
This reply was modified 3 years, 9 months ago by Mike.
-
This reply was modified 3 years, 9 months ago by Mike.