Forum Replies Created
-
AuthorPosts
-
Carsten
ParticipantHi,
is there anything i can do to assist you with the problem?
Thanks.
CarstenCarsten
ParticipantThis reply is private.
Carsten
ParticipantThis reply is private.
Carsten
ParticipantHi,
of course. Seems to work.
But one thought: Just because of my Support-Ticket here, i was contacted by 2 Users via WordPress-Slack asking how i removed the tribe-event-category. So it seems to me not just me 😉
But my case is perfectly solved i think!
Carsten
Carsten
ParticipantHi Cliff,
my Code for removing the Tribe__Events__Main::TAXONOMY was alright. I tried your Snippet, but it is the same overall. The Problem is in the Tribe__Events__Main Claas (Line 1552)
public function post_class( $classes ) { global $post; if ( is_object( $post ) && isset( $post->post_type ) && $post->post_type == self::POSTTYPE && $terms = get_the_terms( $post->ID, self::TAXONOMY ) ) { foreach ( $terms as $term ) { $classes[] = 'cat_' . sanitize_html_class( $term->slug, $term->term_taxonomy_id ); } } return $classes; }get_the_terms( $post->ID, self::TAXONOMY ) results in a php-warning because the Taxonomy was already deleted.
So if you added something like taxonomy_exists( self::TAXONOMY ) in the if-Statement:
public function post_class( $classes ) { global $post; if ( is_object( $post ) && isset( $post->post_type ) && $post->post_type == self::POSTTYPE && taxonomy_exists( self::TAXONOMY ) && $terms = get_the_terms( $post->ID, self::TAXONOMY ) ) { foreach ( $terms as $term ) { $classes[] = 'cat_' . sanitize_html_class( $term->slug, $term->term_taxonomy_id ); } } return $classes; }It would resolve my problem.
Or do you have an alternative idea to achieve this?
Thanks & Best Regards,
Carsten -
AuthorPosts
