Skip to content

Instantly share code, notes, and snippets.

@barrykooij
Created December 4, 2015 12:17
Show Gist options
  • Save barrykooij/12fc9184f96dadb08f60 to your computer and use it in GitHub Desktop.
Save barrykooij/12fc9184f96dadb08f60 to your computer and use it in GitHub Desktop.
// WP Car Manager change slug - Add this to your theme's functions.php
function wpcm_change_slug( $translated, $text, $context, $domain ) {
if ( 'wp-car-manager' == $domain ) {
if ( 'vehicle' == $text && 'post type slug' == $context ) {
$translated = 'my-cars'; // change slug of vehicle
}
}
return $translated;
}
add_filter( 'gettext_with_context', 'wpcm_change_slug', 10, 4 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment