I've been browsing and reading and testing and can't seem to find a clean solution for my problem. A solution that doesn't affect all other post types, categories, custom taxonomies, etc. :(
Is there anyway to modify the default post permastructure only programmatically by prepending an hardcoded slug to it?
As of now, I've tried using $wp_rewrite
, add_permastruct
, set_permalink_structure
...
Thank you in advance for your help.
I've been browsing and reading and testing and can't seem to find a clean solution for my problem. A solution that doesn't affect all other post types, categories, custom taxonomies, etc. :(
Is there anyway to modify the default post permastructure only programmatically by prepending an hardcoded slug to it?
As of now, I've tried using $wp_rewrite
, add_permastruct
, set_permalink_structure
...
Thank you in advance for your help.
Share Improve this question asked May 17, 2019 at 7:49 user167290user167290 4 |1 Answer
Reset to default 0Literally found the answer 10 minutes after posting this question and spending a couple of hours on it before asking. Simply hook your function to post_link
!
post_link
. developer.wordpress/reference/hooks/post_link – user167290 Commented May 17, 2019 at 8:09post_link
filter, you change the links generated by WordPress, but these addresses may not be recognized. – nmr Commented May 17, 2019 at 8:22add_rewrite_rule
. wordpress.stackexchange/questions/337924/… – user167290 Commented May 17, 2019 at 9:06