Could you please help me to prefix attachment
permalinks with a custom string (for example attachment
)
Such that example/attachment-slug
becomes example/attachment/slug
?
- Apply only to posts with
post_type
attachment
- Using PHP that can be added to a custom plugin / mu-plugin / functions.php
- Don’t worry about existing attachments – the code should alter the permalinks of new attachments
Thank you.
Kind regards, Mat
P.S. Related question here