Title: Problem with attributes parent
Last modified: November 30, 2021

---

# Problem with attributes parent

 *  Resolved [gabrieluno](https://wordpress.org/support/users/gabrieluno/)
 * (@gabrieluno)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/problem-with-attributes-parent/)
 * Hello, I have been facing the problem for days and I finished all my options 
   without success, the following happens:
 * I have a Post Type> Hierarchical created, from the Post Field> Attributes field
   I can correctly change the parent post, but it shows the posts of other users
   and I need it to show only posts from the same user.
 * I’m trying to combine the Forms module and the Post Object field to create post
   children from the main publication, but I can’t do it and I don’t know if it 
   would be possible either.
 * I would appreciate your help since there is no information about this on the 
   internet, you are my last option. Greetings

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

 *  Plugin Author [Konrad Chmielewski](https://wordpress.org/support/users/hwk-fr/)
 * (@hwk-fr)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/problem-with-attributes-parent/#post-15118200)
 * Hello,
 * Thanks for the feedback!
 * I’m sorry, but I’m not sure to fully understand what you’re trying to achieve.
   Can you please provide some screenshots and example of your use case?
 * Are you trying to use the [ACFE Post Field](https://www.acf-extended.com/features/fields/post-field)?
   This is is reserved for back-end usage. On the other end the [ACFE Form module](https://www.acf-extended.com/features/modules/dynamic-forms)
   is for front-end usage.
 * Which feature of the ACF Post Object field are you trying to use? Do you have
   any code to share?
 * Thanks!
 * Regards.
 *  Thread Starter [gabrieluno](https://wordpress.org/support/users/gabrieluno/)
 * (@gabrieluno)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/problem-with-attributes-parent/#post-15118937)
 * For summarizing too much, I did not express myself well, sorry.
 * I need users to create publications with the parent-child structure, it is for
   a page that makes series reviews and the chapters will be the child posts. I 
   have already created the Hierarchical Post Type.
 * At the time of creating the post, the problem is with the “attributes > parent”
   field, since I do not know how to prevent users from choosing parent publications
   created by other users. If only it were a drop-down that shows the publications
   of the current user, it would work!
 * I’m testing the “Dynamic Forms” module, I see that it seems to have an option
   for what I need> [https://ibb.co/pZh3rXM](https://ibb.co/pZh3rXM), but I don’t
   know how to use it. I’m combining it with the “Post Object” field to try and 
   create the child posts, but I can’t get the parent to automatically assign the
   post.
 * I hope I have expressed myself better, thank you for your time ♥
 *  Plugin Author [Konrad Chmielewski](https://wordpress.org/support/users/hwk-fr/)
 * (@hwk-fr)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/problem-with-attributes-parent/#post-15122297)
 * Hello,
 * Okay I think I understand better now.
 * You can use the native `acf/fields/post_object/query` hook in order to customize
   the posts that are displayed within the ACF Post Object field. [See documentation](https://www.advancedcustomfields.com/resources/acf-fields-post_object-query/).
 * Here is a usage example to only display posts from the currently logged user:
 *     ```
       add_filter('acf/fields/post_object/query/name=my_post_object', 'my_acf_fields_post_object_query', 10, 3);
       function my_acf_fields_post_object_query($args, $field, $post_id){
   
           // display only posts of the currently logged user
           $args['author'] = get_current_user_id();
   
           return $args;
   
       }
       ```
   
 * Regarding the ACFE Form “Post Action”, you’ll have to make sure to select your
   Post Type that is hierarchical, and select the Post Object field in the “Post
   Parent” setting. [See screenshot](https://i.imgur.com/8BKucpq.jpg).
 * Once configured, the Post will be created as a child of the selected post on 
   the front-end.
 * You’ll find the [documentation of the Post Action here](https://www.acf-extended.com/features/modules/dynamic-forms/post-action)
   if you need further customization examples using PHP hooks.
 * Hope it helps!
 * Have a nice day!
 * Regards.
 *  Thread Starter [gabrieluno](https://wordpress.org/support/users/gabrieluno/)
 * (@gabrieluno)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/problem-with-attributes-parent/#post-15167935)
 * [@hwk-fr](https://wordpress.org/support/users/hwk-fr/) I am using this code and
   it is still loading the posts of all users, code:
 *     ```
       add_filter('acf/fields/post_object/query', 'my_acf_fields_post_object_query', 10, 3);
       function my_acf_fields_post_object_query( $args, $field, $post_id ) {
   
           // display only posts of the currently logged user
           $args['author'] = get_current_user_id();
           return $args;
       }
       ```
   
 * I’ve been with this for days and it’s driving me crazy, could you make a custom
   code for me that works for me? I am willing to pay you, thank you !!
    -  This reply was modified 4 years, 5 months ago by [gabrieluno](https://wordpress.org/support/users/gabrieluno/).
 *  Plugin Author [Konrad Chmielewski](https://wordpress.org/support/users/hwk-fr/)
 * (@hwk-fr)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/problem-with-attributes-parent/#post-15170550)
 * Hello,
 * I just tested again the code, and it works fine. [Here is the video of my test](https://i.imgur.com/p95bwRT.mp4).
 * Note that it is important to target your field name in the hook, like this:
 *     ```
       acf/fields/post_object/query/name=my_post_object
       ```
   
 * Otherwise it will target _all_ post objects. Also note that this code will filter
   the field to display posts of the currently logged user. If the current visitor
   is not logged, then it will display all posts. You can tweak that with a `if/
   else` condition if needed.
 * Hope it helps!
 * Have a nice day!
 * Regards.
 *  Thread Starter [gabrieluno](https://wordpress.org/support/users/gabrieluno/)
 * (@gabrieluno)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/problem-with-attributes-parent/#post-15175511)
 * That is what I need, but for the parents selection field, as in this image:
 * [⌊grD3P⌉⌊grD3P⌉[
 * Remember it is for a custom post type created with ACF Extended. Thanks for everything
   great [@hwk-fr](https://wordpress.org/support/users/hwk-fr/) ♥
    -  This reply was modified 4 years, 5 months ago by [gabrieluno](https://wordpress.org/support/users/gabrieluno/).
 *  Thread Starter [gabrieluno](https://wordpress.org/support/users/gabrieluno/)
 * (@gabrieluno)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/problem-with-attributes-parent/#post-15189593)
 * up
 *  Plugin Author [Konrad Chmielewski](https://wordpress.org/support/users/hwk-fr/)
 * (@hwk-fr)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/problem-with-attributes-parent/#post-15189876)
 * Hello,
 * The metabox you’re showing is managed by WordPress, not by ACF.
 * I would recommend to make some research about “wordpress parent page attribute
   select query”. [Here is one stackoverflow topic](https://wordpress.stackexchange.com/questions/331417/i-need-a-way-to-filter-the-titles-in-the-page-parent-dropdown-on-the-editor-page).
 * Hope it helps!
 * Regards.

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

The topic ‘Problem with attributes parent’ is closed to new replies.

 * ![](https://ps.w.org/acf-extended/assets/icon-256x256.png?rev=2071550)
 * [Advanced Custom Fields: Extended](https://wordpress.org/plugins/acf-extended/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/acf-extended/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/acf-extended/)
 * [Active Topics](https://wordpress.org/support/plugin/acf-extended/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/acf-extended/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/acf-extended/reviews/)

 * 8 replies
 * 2 participants
 * Last reply from: [Konrad Chmielewski](https://wordpress.org/support/users/hwk-fr/)
 * Last activity: [4 years, 5 months ago](https://wordpress.org/support/topic/problem-with-attributes-parent/#post-15189876)
 * Status: resolved