• if i have two categories with custom fields, eg 2 and 21, and I want to remove category #2 function delete_term() will delete in both categories!

    fix

    function delete_term( $term, $tt_id, $taxonomy, $deleted_term )
    	{
    		global $wpdb;
    
    		$values = $wpdb->query($wpdb->prepare(
    			"DELETE FROM $wpdb->options WHERE option_name LIKE %s",
    			'%' . $taxonomy . '_' . $term . '\_%'
    		));
    	}

    https://ww.wp.xz.cn/plugins/advanced-custom-fields/

The topic ‘bug delete_term’ is closed to new replies.