Tribe__Events__Main::action_expire_archive_slug_conflict_notice( string $new_status, string $old_status, int|WP_Post $post )
When a post transitions from a post_status to another, we remove the archive-slug-conflict notice
Contents
Parameters
- $new_status
-
(string) (Required) New Status on Post
- $old_status
-
(string) (Required) Old Status on Post
- $post
-
(int|WP_Post) (Required) A Post ID or Post Object
Return
(bool)
Source
File: src/Tribe/Main.php
public function action_expire_archive_slug_conflict_notice( $new_status, $old_status, $post ) {
// If there is no change we bail
if ( $new_status === $old_status ) {
return false;
}
$post = get_post( $post );
// translators: For compatibility with WPML and other multilingual plugins, not to be translated directly on .mo files.
$archive_slug = _x( Tribe__Settings_Manager::get_option( 'eventsSlug', 'events' ), 'Archive Events Slug', 'the-events-calendar' );
// is it a real post?
if ( ! $post instanceof WP_Post ) {
return false;
}
// Is it a conflict?
if ( $archive_slug !== $post->post_name ) {
return false;
}
return Tribe__Admin__Notices::instance()->undismiss( 'archive-slug-conflict' );
}