Skip to content

Instantly share code, notes, and snippets.

@bhubbard
Created August 18, 2014 17:19
Show Gist options
  • Save bhubbard/683f7ed6c3566a3ee57f to your computer and use it in GitHub Desktop.
Save bhubbard/683f7ed6c3566a3ee57f to your computer and use it in GitHub Desktop.
Here are php examples on how to rename slugs for WooCommerce Our Team Plugin.
<?php
/* Change 'Our Team' Archive Slug */
function woothemes_our_team_custom_archive_slug( $archive_slug ) {
$new_archive_slug = _x( 'agents', 'post archive url slug', 'our-team-by-woothemes' );
return $new_archive_slug;
}
add_filter( 'woothemes_our_team_archive_slug', 'woothemes_our_team_custom_archive_slug' );
<?php
// NEEDED - Yoast Breadcrumbs name rewrite
<?php
/* Change 'Our Team' Single Slug */
function woothemes_our_team_custom_single_slug( $single_slug ) {
$new_single_slug = _x( 'agent', 'single post url slug', 'our-team-by-woothemes' );
return $new_single_slug;
}
add_filter( 'woothemes_our_team_single_slug', 'woothemes_our_team_custom_single_slug' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment