Title: Filter parent posts
Last modified: August 31, 2016

---

# Filter parent posts

 *  Resolved [marcelo2605](https://wordpress.org/support/users/marcelo2605/)
 * (@marcelo2605)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/filter-parent-posts/)
 * I created a parent posts dropdown in a form and I would like to show only parents(
   not children) posts and only posts created by current user.
 * There is a filter to make this?
 * [https://wordpress.org/plugins/gravity-forms-custom-post-types/](https://wordpress.org/plugins/gravity-forms-custom-post-types/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [marcelo2605](https://wordpress.org/support/users/marcelo2605/)
 * (@marcelo2605)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/filter-parent-posts/#post-7309577)
 * Found the solution:
 *     ```
       add_filter('gfcpt_get_posts_args_3_3', function( $args ){
       	$args['post_parent'] = '0';
       	$args['author'] = get_current_user_id();
       	return $args;
       });
       ```
   
 * The first number is the form ID and the second is the filed ID.

Viewing 1 replies (of 1 total)

The topic ‘Filter parent posts’ is closed to new replies.

 * ![](https://ps.w.org/gravity-forms-custom-post-types/assets/icon-256x256.png?
   rev=2542252)
 * [Gravity Forms + Custom Post Types](https://wordpress.org/plugins/gravity-forms-custom-post-types/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/gravity-forms-custom-post-types/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/gravity-forms-custom-post-types/)
 * [Active Topics](https://wordpress.org/support/plugin/gravity-forms-custom-post-types/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/gravity-forms-custom-post-types/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/gravity-forms-custom-post-types/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [marcelo2605](https://wordpress.org/support/users/marcelo2605/)
 * Last activity: [10 years, 1 month ago](https://wordpress.org/support/topic/filter-parent-posts/#post-7309577)
 * Status: resolved