Carsten

Forum Replies Created

Viewing 5 posts - 31 through 35 (of 35 total)
  • Author
    Posts
  • Carsten
    Participant

    Hi,

    is there anything i can do to assist you with the problem?

    Thanks.
    Carsten

    Carsten
    Participant

    This reply is private.

    Carsten
    Participant

    This reply is private.

    in reply to: Deactivate Tribe Taxonomy #1314214
    Carsten
    Participant

    Hi,

    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

    in reply to: Deactivate Tribe Taxonomy #1311600
    Carsten
    Participant

    Hi 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

Viewing 5 posts - 31 through 35 (of 35 total)