Home › Forums › Calendar Products › Events Calendar PRO › Broken: removal of slug warning
- This topic has 4 replies, 4 voices, and was last updated 9 years, 5 months ago by
Allen Presher.
-
AuthorPosts
-
October 13, 2016 at 1:54 pm #1176248
Allen Presher
ParticipantLet me preface this by saying we have asked, and others have asked, this same question multiple times before. And each time updates to the Events Calendar break the solution we had been given, thus messing up every single site we developers have deployed the fix to. So here we go for a third solution to the same problem, with a third time of clients under our developers license not understanding why this erroneous error notice is showing:
We need removed the slug conflict warning when a page exists at the calendar’s URL. It used to be the following code did the trick:
if ( class_exists( 'Tribe__Admin__Notice__Archive_Slug_Conflict' ) ) { remove_action( 'admin_init', array( Tribe__Admin__Notice__Archive_Slug_Conflict::instance(), 'maybe_add_admin_notice' ) ); }Unfortunately this action was removed, breaking the code we had deployed to get rid of this annoying, erroneous error that confuses our clients. The offending lines of code that generate this slug conflict warning are now 612-614, in src/Tribe/Main.php
if ( function_exists( 'tribe_notice' ) ) { tribe_notice( 'archive-slug-conflict', array( $this, 'render_notice_archive_slug_conflict' ), 'dismiss=1&type=error' ); }Please provide us with a new workaround for disabling this notice. In the past we’ve suggested a simple checkbox be built into the settings for developers, there are so many reasons in advanced that we need a page at the same URL (for instance a banner image for the page, other content items on the page, sidebar options, etc. — to the client the fact that a calendar also exists is not rationale for breaking the entire metaphor of “I edit content on pages that exist”).
Thank you!
October 17, 2016 at 3:39 pm #1177991Nico
MemberHi there @stratejusinc,
Thanks for getting in touch and for the sugestions! Sorry for the delay in my reply, this thread drop out of my radar shortly after I assigned it to myself last week.
You are right about the change in the way we do notices. This was refactored and will hopefully stay like this for a long time!
I could confirm what you state about the apparent inability to create a similar snippet now. I’ll reach out to the dev team on this and will be back with my findings.
Best,
NicoOctober 18, 2016 at 2:44 pm #1178691Nico
MemberThanks for the patience @stratejusinc!
Use this updated snippet instead fo the old one:
/* Tribe, prevent the slug conflict notice from being displayed */
function tribe_remove_slug_conflict_notice ( ) {if ( ! function_exists( 'tribe_notice' ) ) return;
tribe_notice( 'archive-slug-conflict', '__return_null' );
}
add_action( 'admin_init', 'tribe_remove_slug_conflict_notice' );
Please let me know if that works for you,
Best,
NicoNovember 9, 2016 at 8:35 am #1189692Support Droid
KeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
AuthorPosts
- The topic ‘Broken: removal of slug warning’ is closed to new replies.
