Title: Add shortcode attribute for include_children
Last modified: August 31, 2016

---

# Add shortcode attribute for include_children

 *  Resolved [John](https://wordpress.org/support/users/jhob/)
 * (@jhob)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/add-shortcode-attribute-for-include_children/)
 * Would it be possible to include a dg shortcode attribute for include_children
   to be passed through to the taxonomy parameters gereneration for the WP Query?
 * For the project I’m currently working on I’ve had to hack the plugin adding this
   line within the DGGallery->setTaxa() function to acheive this:
 *     ```
       $taxa[] = array(
       	'taxonomy' => $taxon,
       	'field'    => 'id',
       	'include_children' => false,
       	'terms'    => $terms,
       	'operator' => isset( $operator[ $taxon ] ) ? $operator[ $taxon ] : 'IN'
       );
       ```
   
 * Thanks!
    John
 * [https://wordpress.org/plugins/document-gallery/](https://wordpress.org/plugins/document-gallery/)

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Author [Dan Rossiter](https://wordpress.org/support/users/danrossiter/)
 * (@danrossiter)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/add-shortcode-attribute-for-include_children/#post-7077147)
 * Interesting! Yes, that is a very reasonable request. I’ll plan to include this
   in the next release.
 * Thanks for the suggestion!
 * -Dan
 *  Thread Starter [John](https://wordpress.org/support/users/jhob/)
 * (@jhob)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/add-shortcode-attribute-for-include_children/#post-7077170)
 * That would be fantastic, thanks loads!
 * Could you update this thread once implemented so that I can make sure I update
   the plugin as I’ve disabled updates for now?
 * cheers
    John
 *  Plugin Author [Dan Rossiter](https://wordpress.org/support/users/danrossiter/)
 * (@danrossiter)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/add-shortcode-attribute-for-include_children/#post-7077257)
 * Will do!
 * -Dan
 *  Plugin Author [Dan Rossiter](https://wordpress.org/support/users/danrossiter/)
 * (@danrossiter)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/add-shortcode-attribute-for-include_children/#post-7077361)
 * Hi John,
 * Version `4.2` includes this change. You’ll want to include `tax_name`_include_children
   =false as an attribute in your shortcode.
 * Thanks for the suggestion and enjoy!
 * -Dan
 *  Thread Starter [John](https://wordpress.org/support/users/jhob/)
 * (@jhob)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/add-shortcode-attribute-for-include_children/#post-7077362)
 * Cheers for adding the feature, most appreciated!
 * However… something doesn’t seem quite right!
 * I get the error:
 * The taxon value entered, “tax_name_include_children”, is not valid when including
   it in the shortcode.
 * I also tried include_children=false but with the same result.
 * Is it me doing something wrong?
 *  Thread Starter [John](https://wordpress.org/support/users/jhob/)
 * (@jhob)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/add-shortcode-attribute-for-include_children/#post-7077363)
 * Sorry, me being thick. More haste, less speed!
 * category_media_include_children=false works just fine.
 * As you were!
 *  Plugin Author [Dan Rossiter](https://wordpress.org/support/users/danrossiter/)
 * (@danrossiter)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/add-shortcode-attribute-for-include_children/#post-7077365)
 * Haha! Glad you got it working!
 * -Dan

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Add shortcode attribute for include_children’ is closed to new replies.

 * ![](https://ps.w.org/document-gallery/assets/icon.svg?rev=983329)
 * [Document Gallery](https://wordpress.org/plugins/document-gallery/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/document-gallery/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/document-gallery/)
 * [Active Topics](https://wordpress.org/support/plugin/document-gallery/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/document-gallery/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/document-gallery/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [Dan Rossiter](https://wordpress.org/support/users/danrossiter/)
 * Last activity: [10 years, 2 months ago](https://wordpress.org/support/topic/add-shortcode-attribute-for-include_children/#post-7077365)
 * Status: resolved