Support

Home Forums Pre-Sales Events CPT – Potential Conflicts

Events CPT – Potential Conflicts

Posted: May 29, 2014 at 4:24 pm


Kassie Monsees

May 29, 2014 at 4:24 pm

I’m using the Events Manager plugin for the calendar on my website, and it uses an Events CPT. Is yours named differently so there won’t be any conflicts? Do we have the ability to not use the CPT?

Thanks!


Lorenzo Orlando Caum

  • Support Staff

May 29, 2014 at 5:40 pm

Hi Kassie,

This can be changed by using a filter:

add_filter( 'FHEE__EE_Register_CPTs__register_CPT__rewrite', 'my_custom_event_slug', 10, 2 );
    function my_custom_event_slug( $slug, $post_type ) {
    	if ( $post_type == 'espresso_events' ) {
    		$custom_slug = array( 'slug' => 'workshops' );
    		return $custom_slug;
    	}
    	return $slug;
    }

The example above will change the defaults events to workshops.

Be sure to refresh your permalinks after applying the filter above.


Lorenzo


Kassie Monsees

May 30, 2014 at 1:33 pm

Thanks! That’s very helpful.
I was leaning towards the actual NAME of the CPT, though. When you register the post type, do you just use “events” or do you have some kind of identifier to prevent conflicts with another CPT probably named “events”? For example: ee_events?


Kassie Monsees

May 30, 2014 at 1:34 pm

I guess in reading your script more closely, it looks like you’ve named the CPT “espresso_events”… Is this correct?


Lorenzo Orlando Caum

  • Support Staff

May 30, 2014 at 2:00 pm

It is espresso_events and the default slug for the event list page is ‘events’.

Are you having trouble getting the filter to work?


Lorenzo

The support post ‘Events CPT – Potential Conflicts’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso