Support » Plugin: Block Pattern Builder » Blockmeister disables the deletion of all custom taxonomies

  • Resolved 1benk1

    (@1benk1)


    Hello,
    you should change the Method allow_delete_only_for_user_added_terms within wp-content/plugins/blockmeister/includes/Pattern_Builder/BlockMeister_Pattern_Category_Taxonomy.php like following:

    public function allow_delete_only_for_user_added_terms( $caps, $cap, $user_id, $args ) { //allow_delete_term_filter
    	if ( $cap === 'delete_term' && $args ) {
    		$term_id          = $args[0];
    		$term = get_term( $term_id );
    		if ( $term->taxonomy === 'pattern_category' ) {
    			$term_meta_source = get_term_meta( $term_id, 'source', true );
    			if ( $term_meta_source !== 'user' ) {
    				$caps = [ 'do_not_allow' ];
    			}
    		}
    	}
    
    	return $caps;
    }

    Otherwise Blockmeister disables the deletion of all custom taxonomies 🙂

    Best regards,
    Ben

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author BlockMeister

    (@blockmeister)

    Hello Ben,

    Thank you very much for your clear report and your time!

    I just released version 2.0.4. with the suggested fix.

    Best regards,
    Benny

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.