• Hi Munir!

    Thanks for the cool plugin.

    I’m wondering if you’d be willing to add “Category Exclude” support to the Posts block in the next release?

    I created a “acfb_category_exclude” Taxonomy field to the field group and then added the following to acfblocks-templates/free/acfb-posts.php:

    // BEGIN Exclude support
    $acfb_exclude = get_field( 'acfb_category_exclude' );
    
    $acfb_exclude_names = array();  
    if(is_array($acfb_exclude)){
    	foreach($acfb_exclude as $catskey => $catsval){
    		$acfb_exclude_names[] = $catsval;
    	}
    }
    // END Exclude support
    
    $args = array(
    	'post_type' => 'post',
    	'post_status' => 'publish',
    	'posts_per_page' => $acfb_number_of_posts, 
    	'cat' => $acfb_cat_names,
    	'category__not_in' => $acfb_exclude_names, // ADDED for Exclude Support
    );

    Thanks for your consideration!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @johnleblanc – thanks for reaching out. I’m sorry for the delayed reply. I’ll share this suggestion with Munir and team as we do some future product planning. Please let us know if you have any other ideas (and we’ll be sure to respond quicker). Your feedback is very valuable!

    Thread Starter John LeBlanc

    (@johnleblanc)

    Aloha @clubkert!

    Curious is Munir reviewed & considered the addition?

    Mahalo!
    John

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Posts Block: Category Exclude Support’ is closed to new replies.