I’m working on a real estate agent website which contains 100s of properties and over 16,000 Users (WordPress subscribers).
The Users are either property sellers or potential buyers.
We are using Advanced Custom Fields to store and organise the property details within a custom post type ‘property’.
We are using the User Field to record the property seller, and also to record which users view and make offers on the property using the Repeater field. This means that on an ‘Add Property’ page there are initially 3 User select menus. As the property gets viewings and offers the number of User select menus increases.
This was working great until we imported the 16,000 users. After the users were imported the add/edit property page is loading very slowly. It is apparent that building 3 select menus each with 16,000 options has caused the problem. The source for a blank ‘Add Property’ page is 2.3 mb (GET post.php?…).
Is there an alternative ‘User Search then select’ field type that would allow the page to load before the users need to be queried? It would also narrow down the list of users to select from.
Also it would be nice to have a link to the selected users profile, for example to quickly find the property sellers phone number.
Is there such a User Search Field available or is there another way to solve this problem?
Thank you for any help or advice.
Above setup as plugin. Tested on ACF v4 & WP 3.6 only
Works with repeater field
Will submit to http://wordpress.org/plugins/add/ when we get round to readme and screenshots
To use just start typing into user search field- results should appear below, then click on result to select.
Hope it works for you. Please let us know.
seems to work very nicely out of the box
although in the meanwhile I’ve opted to use P2P plugin because it has often a better handling of post relationships than ACF
it allows for reciprocal connections and stores data in its own tables, something that ACF doesn’t have
This is a different but related question. Is there a way to query the content of the custom fields that I have created when I perform a user search in the WordPress Dashboard (i.e. perform a search on the “/wp-admin/users.php” page)? For example, if I have created an “eye_color” custom field and type “brown” in my user search, is there a way to have ACF return all users with a “brown” eye color in my search results?
(I can create a new thread if this question is significantly different than the original question.)
The topic ‘User Field Type search’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!