admin管理员组

文章数量:1326338

)

I found (for example in Set default (auto) slug prefix for Tags) that it is possible for example add my-taxonomy prefix in front of all taxonomy slugs (permalinks). The post is outdated now since such prefix can be now specified in WP settings.

What can't be done in settings it to specify slug prefix (=> modify slug) for a specific/custom post type. There are some plugins that can do that but they usually do a lot of things and I'd prefer to write a couple of lines of code that I can add to functions.php/custom plugin/mu-plugin...

In other words I'm trying to write PHP that gets fired just after a post (with defined type) is created and that alters slug from my-new-post to my-prefix/my-new-post.

I spent two days of googling / testing but I haven't been able to make it work. At least not for post_type attachment.

Could you please help me with that?

Thank you.

Best regards,

Mat

本文标签: pluginsAlter post slug by a filter that is fired just after a post is created