Skip to content

Instantly share code, notes, and snippets.

@amdrew
Last active December 26, 2015 00:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amdrew/7065236 to your computer and use it in GitHub Desktop.
Save amdrew/7065236 to your computer and use it in GitHub Desktop.
Changing the /category/ label in the URL. Eg http://mywebsite.com/downloads/category/ebooks/ to http://mywebsite.com/downloads/cat/ebooks/. Replace "the-new-category-label" with what you'd like.
<?php
function my_child_theme_edd_download_category_args( $category_labels ) {
$slug = defined( 'EDD_SLUG' ) ? EDD_SLUG : 'downloads';
// modify the "the-new-category-label" below to your liking
$category_labels['rewrite'] = array('slug' => $slug . '/the-new-category-label', 'with_front' => false, 'hierarchical' => true );
return $category_labels;
}
add_filter( 'edd_download_category_args', 'my_child_theme_edd_download_category_args' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment