sp-post-tree widget: limit posts to direct parent category

Issue #43 resolved
Rafi Yagi created an issue

Added the following to buildCatDynaTree() to limit posts to their direct parent categories:

                $child_cats = (array) get_term_children($category->term_id, 'category');
                $postArgs = array_merge( $postArgs, array( 'category' => $category->term_id, 'category__not_in' => array_merge( $child_cats ) ) );

Comments (1)

  1. Rafi Yagi reporter
                    $child_cats = (array) get_term_children($category->term_id, 'category');
                    $postArgs = array_merge( $postArgs, array( 'category' => $category->term_id, 'category__not_in' => array_merge( $child_cats ) ) );
    
  2. Log in to comment