Skip to content

Instantly share code, notes, and snippets.

Last active January 24, 2019 02:05
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Change the custom post types (CPT) slug for people in Event Espresso 4

Add the sample code below to your child theme's functions.php file or in a site specific plugin.

Change replaceme in the example below to the slug that you would like to use. For example, if you wanted to change people to organizers, then you should change replaceme to organizers and then save changes to your file.

Then be sure to browse to Settings --> Permalinks afterwards within your WP Dashboard to refresh your permalinks.

//* Do NOT include the opening php tag
//* Change the default people slug to something else in Event Espresso 4
add_filter( 'FHEE__EE_Register_CPTs__register_CPT__rewrite', 'ee_custom_people_slug', 10, 2 );
    function ee_custom_people_slug( $slug, $post_type ) {
    	if ( $post_type == 'espresso_people' ) {
    		$custom_slug = array( 'slug' => 'replaceme' );
    		return $custom_slug;
    	return $slug;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment