Change permalink structure hidden button edit
The post_link hook has a third parameter named $leavename: $leavename (bool) Whether to keep the post name. So what that means is, if $leavename is true, then the post name/slug should be kept in the permalink and thus it needs to contain %postname% (or %pagename% for the page post type) instead of being replaced with … Read more