admin管理员组

文章数量:1326093

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

本文标签: pluginsHow to prefix attachment permalinks with attachment