I have created couple custom meta fields like Language, Author, etc… these custom meta fields are included in the post creation page and they will be one of the tools for categorization / organization of my posts. With these custom meta fields, I want my users to be able to filter out the content they will see (thats not related to this plugin)
Anyways, what I need to do is, to let my users choose couple options during the registration. My registration form is populated by User Meta Pro plugin. In the form, I want to include the custom meta field values in dropdown.
For example: in Dropdown for Language, I want it to display all the languages I have created in backend. In Author Drop down, I want it to display the list of all author user accounts. I also have one DropDown “Categories” and I want it to display the list of ALL the parent categories.
Can you help me with this please? What hooks should I use to make it work with your plugin?
You can use same hook (user_meta_field_config) to populate dropdown with any data. you can pass array with key and value to or string (e.g key1=value1,key2=value2) to $field[‘options’]
“16” << is the id of my drop down field in User Meta Pro, categories list does show up now, is it possible to exclude some specific categories from the drop down list?
Also, how can I add a first option to say “Choose a Category” ?
As for custom meta fields, Im a bit confused with this, Can you please give an example for Custom meta fields?
“You can use same hook (user_meta_field_config) to populate dropdown with any data. you can pass array with key and value to or string (e.g key1=value1,key2=value2) to $field[‘options’] ”
How would the code look, if lets say my custom meta field is called “languages”?
For more custom options:
$field[‘options’] = “English,German,French”;
Thanks.
Author
Posts
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic.
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.AcceptRead More
Privacy & Cookies Policy
Privacy Overview
This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.