How to suppress the error for 'events' already being a page slug?

Home Forums Calendar Products Events Calendar PRO How to suppress the error for 'events' already being a page slug?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1011567
    Tim
    Participant

    I have a similar issue to the one at https://theeventscalendar.com/support/forums/topic/suddenly-an-error-message/ but in my case everything is working fine, I just don’t want my clients to get shown the error message:

    The page “Events” uses the “/events” slug: the Events Calendar plugin will show its calendar in place of the page.
    Edit the page slug or edit The Events Calendar settings.

    I did deliberately create a page with the slug ‘events’, in order to have that link appear in the automatically generated menu on the site. So it does have to have the same slug as the page that the calendar is displaying on.

    (This is only needed because the ‘ghost’ page for the calendar does not cause a link to be added to the automatic menu of top-level pages on my site.)

    Is there a way I can suppress that error (since the calendar and that page link are working fine as they are) or to get the calendar’s ‘ghost’ page to appear in my menu (without any manual menu editing, since I still need new or changed pages to automatically be reflected in the menu)

    #1011711
    Nico
    Member

    Howdy Sam,

    Welcome to our support forums and thanks for reaching out to us. Hopefully there’s a little snippet to achieve what you are looking for:


    if (class_exists('Tribe__Events__Admin__Notice__Archive_Slug_Conflict')) {
    remove_action( 'admin_init', array( Tribe__Events__Admin__Notice__Archive_Slug_Conflict::instance(), 'maybe_add_admin_notice' ) );
    }

    Just add this code to your functions.php file – located at wp-content/themes/your_theme/ – and it should do the trick,

    Please let me know if this works for you,
    Best,
    Nico

    #1011929
    Tim
    Participant

    Great, thanks Nico, that was what I was looking for.

    #1012178
    Nico
    Member

    Hey Sam,

    Glad I could help you out 🙂

    I’ll go ahead and close out this thread, but if you need help with anything else please don’t hesitate to create a new one and we will be happy to assist you.

    Best,
    Nico

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘How to suppress the error for 'events' already being a page slug?’ is closed to new replies.