WordPress.org

Support

Support » Plugins and Hacks » Custom Upload Dir » multiple taxonomies are duplicated in the path

multiple taxonomies are duplicated in the path

  • When an image’s post belongs to multiple sub-categories (or other taxonomies), the top category is duplicated in the resulting path. Example:

    Dir Path: /%category%/%type%

    Post belongs to:

    Tech & Blue and Tech & Red

    Resulting path is:

    /tech-tech/blue-red

    A better result is:

    /tech/blue-red

    Code fix (in function cud_build_term_path; line 208):

    Old: $path .= implode('-', wp_list_pluck($terms, 'slug')) . '/';
    
    New: $path .= implode('-', array_unique(wp_list_pluck($terms, 'slug'))) . '/';

    http://wordpress.org/extend/plugins/custom-upload-dir/

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘multiple taxonomies are duplicated in the path’ is closed to new replies.
Skip to toolbar