You can use the ACF plugin
for https://wordpress.org/plugins/advanced-custom-fields/.
Steps need to do:
- Download and installed ACF plugin.
- Click on
Custom Fields
link at the left side menu - Add custom field as:
- Select custom as and publish it:
- Now add this code in
functions.php
file as:
function acf_load_color_field_choices( $field ) { // reset choices $field['choices'] = array(); $blogusers = get_users(); $field['choices'][0] = "Select User"; foreach($blogusers as $user){ // append to choices $field['choices'][ $user->ID ] = $user->display_name; } // return the field return $field; } add_filter('acf/load_field/name=select_user_for_post', 'acf_load_color_field_choices');
- Now if you create
Groups
post you will see users list in a dropdown as:
Important details:
Related Posts:
- Custom post type for ‘staff’ versus using wordpress user profiles?
- Showing User’s Post Counts by Custom Post Type in the Admin’s User List?
- Prevent trash/delete action on specific post types
- Custom post type support for get_users(‘orderby=post_count’);
- Front end registration/login & publish/update 1 custom post
- User roles – enable custom posts disable posts
- Allow User to Edit Page Based on their Email
- How to restrict specific post types from being read or added by specific user roles (eg. author)?
- How can I get the last posts by user role?
- Assigning a role to a specific custom post type (and ignoring other post types)
- WordPress allow access only one custom post type “xyz” to custom user role but need to hide all admin panels
- How to show custom post type count in the users admin page
- Community and User Generated Content Website: Have been thinking about Drupal but leaning on WordPress heavily
- Delete Current Author Frontend user while delete custom post type
- WP-Admin edit.php & post.php slowdown after import of 10k users
- Link users to a custom post type
- Ajax Check Post Status
- Want to Add Custom Fields for Uploading video to WordPress Users from front end
- how to delete all users and posts based on ‘user_meta’?
- Roles for Custom Post Types
- Is using taxonomies the way to go here or would custom post types be better?
- Hiding posts by other users and non-logged in
- Users create/join groups
- Disable user from updating certain posts
- Query posts based on the meta key values of logged-in users?
- How to restrict author to only access one custom post type ?
- Create custom post with custom user rules
- Associate multiple users to custom post type
- How to assign permissions for a CPT to a user
- How can i display movies in profile page, added by an user?
- Custom User role not working with custom post type
- get comments by current user inside page template
- how to associate several authors to a custom post type
- Assign post type to many users
- Check if user has comment on current post
- Query within a foreach within a query (queryception)
- Showing User’s Post Counts by Custom Post Type in the Author.php?
- Add a custom post when inserting a new user in WordPress?
- Preventing role reading others posts
- Order users by number of posts (includes custom post type)
- Plugin needed to allow subscribers to post articles on the front end without admin approval [closed]
- Display custom post front end filter by ACF equals current user
- users post count
- Clone wp-admin/users.php (Users Admin Page)
- Link custom post type to users membership
- Show all post type posts in manage users posts column
- Limit 1 post by user in each custom post type
- Get all of a user’s posts (custom post type) then get cumulative value of a specific meta_key value from those posts
- Assign a Post to a User
- Custom Post Type Query by user id
- Autofill advanced custom field with user data
- connect users to Custom post types
- Reference field of users in custom post type
- Custom Post Hierarchy and users
- UPDATED: Save a custom_field value when automatically creating a post using wp_insert_post
- Creating multiple profiles under one user to assign to particular posts
- Allow viewing the edit screen for a post type, but not make/save/publish/update changes
- Control what custom posts a user can see
- Associate custom categories to different user IDs
- Display and Allow users to edit their own profiles
- Check in function on custom page
- WordPress and Unity high scores table
- how to show Author post type count
- Paginate_links in custom post type template
- Can custom fields be added without a meta box?
- Show custom post type inside a custom post type
- Not getting posts of custom post types
- Warning after create Custom post type with Roots theme
- custom post type search by reference id
- pagination not working for category.php (custom post types in categories)
- Adavnced custom fields relationship query plus query inside
- Query based on custom fields start and end date
- Can’t publish custom post type – “You are not allowed to edit this post.”
- Only show posts with date of today or in the future (i.e don’t show past posts)?
- Create a permalink structure with custom taxonomies and custom post types gives 404
- Display and register custom categories for custom post types
- How to add multiple markers on the google map, at a certain meta_key and meta_value
- Save custom post type to external database
- wp_dropdown_pages doesn’t work with post_type argument
- How can i create an custom post template for an specific post category? [closed]
- Why is my WP_Query outputting my entries twice?
- Meta Box on Custom Post Type not saving
- How do I control the output of a custom post type in the loop?
- How to display Related Posts based on number of taxonomy terms matched
- Different Category system needed for the Custom Post Type
- Not Able To Render Single-CustomPostType.php File
- How do you get the full size url of an attachment image
- Display custom post type posts first, then default posts
- Custom post type posts don’t show in archive widget
- Custom Post Types in the WordPress Navigation Menu
- Custom Post Type Category Link
- Problems wp_insert_post and save_posts filter
- How to specify a template for a path like http://example.com/something?
- Retrieve custom post types by custom taxonomies with WP_Query
- Add a permalink variable onto custom post type URL after post name slug
- Custom Post type category pages template and loop
- Custom templates for a specific category
- Custom fields for custom post type
- Archive for a Taxonomy of a Custom Post type
- Why does not this wp_redirect work in is_single()?