Title: attachment_category rewrite
Last modified: September 9, 2017

---

# attachment_category rewrite

 *  Resolved [alx359](https://wordpress.org/support/users/alx359/)
 * (@alx359)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/attachment_category-rewrite/)
 * I’ve modded `archive.php` for `attachment_category` and navigate it with `[mla_term_list]`.
   It looks great and works as intended so far.
 * But there’s a remaining little something that annoys me.
 * Links are now of this kind:
 * `http://mydomain.com/attachment_category/term`
 * I want them changed to something more meaningful to the project, like this:
 * `http://mydomain.com/craft-motifs/term`
 * `register_taxonomy` has a rewrite field, and [this piece](https://cnpagency.com/blog/the-right-way-to-do-wordpress-custom-taxonomy-rewrites/)
   for example explains how to fix certain oddities of the process. Anyway, `settings
   > permalinks` implies rewriting taxonomy slugs should be possible.
 * I’m not sure though how to approach this with MLA. Is it there something hardcoded
   that may interfere, for example?
 * Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [David Lingren](https://wordpress.org/support/users/dglingren/)
 * (@dglingren)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/attachment_category-rewrite/#post-9484122)
 * Thanks for working with me offline to investigate the effects of changing the
   slug associated with the attachment_category taxonomy. I have uploaded a new 
   MLA Development Version dates 20170910 that contains six new filters (hooks) 
   to control the way MLA registers its two custom taxonomies, Att. Categories and
   Att. Tags. You can use one of the hooks to implement the change you need for 
   your application by adding something like this to your theme’s `functions.php`
   file:
 *     ```
       add_filter( 'mla_attachment_category_arguments', 'mla_attachment_category_arguments', 10, 1 );
       function mla_attachment_category_arguments( $args ) {
       	// Example of a custom "base" value for the taxonomy URLs
       	$args['rewrite'] = array( 'slug' => 'craft-motifs' ); 
       	return $args;
       }
       ```
   
 * I decided to implement this enhancement with filters rather than change the Settings
   UI because there are many customizations that would make sense for the taxonomy
   registrations and the Settings/Media Library Assistant General tab is already
   quite complicated.
 * It would be great if you could install the Development Version and let me know
   how it works for you. Thanks for motivating this enhancement and for your help
   in testing it.
 *  Thread Starter [alx359](https://wordpress.org/support/users/alx359/)
 * (@alx359)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/attachment_category-rewrite/#post-9484581)
 * Seems to be working great. Thanks so much for implementing this improvement! 
   🙂
 *  Plugin Author [David Lingren](https://wordpress.org/support/users/dglingren/)
 * (@dglingren)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/attachment_category-rewrite/#post-9592781)
 * Thanks for confirming that the suggested solution works for you. I have released
   MLA version 2.61, which contains the new filters.
 * I am marking this topic resolved, but please update it if you have any problems
   or further questions regarding the new version. Thanks for working with me on
   this enhancement.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘attachment_category rewrite’ is closed to new replies.

 * ![](https://ps.w.org/media-library-assistant/assets/icon-256x256.png?rev=973502)
 * [Media Library Assistant](https://wordpress.org/plugins/media-library-assistant/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/media-library-assistant/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/media-library-assistant/)
 * [Active Topics](https://wordpress.org/support/plugin/media-library-assistant/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/media-library-assistant/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/media-library-assistant/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [David Lingren](https://wordpress.org/support/users/dglingren/)
 * Last activity: [8 years, 7 months ago](https://wordpress.org/support/topic/attachment_category-rewrite/#post-9592781)
 * Status: resolved