To fetch users with certain meta field, you can use WP_User_Query
class. Check codex manual for it.
So you can create a custom shortcode like this:
add_shortcode( 'listusers', 'wpse8170_listusers' );
function wpse8170_listusers( $atts, $content="" ) {
$atts = shortcode_atts( array( 'company' => false ), $atts );
if ( empty( $atts['company'] ) ) return $content;
$query = new WP_User_Query( array(
'meta_key' => 'company',
'meta_value' => $atts['company'],
) );
ob_start();
// render your users list here
return ob_get_clean();
}
Related Posts:
- How to display the names of users from a specific group with a shortcode?
- How to display some selected user meta data on a specific page with a shortcode?
- Register visits of my pages in wordpresss
- create shortcode to list users with specific meta key value
- Create a shortcode that creates a form for users to edit their information
- Shortcode to update user meta
- Change user meta value with shortcode
- Parsing a shortcode through an author meta textfield
- SImple Example To Update User Info From Front End [duplicate]
- How to insert current user ID/entry ID into a shortcode?
- How to display content if user meta data isn’t empty with shortcode
- How to display total user count by specific role in WordPress as statistics?
- Display current user metadata on WordPress page
- shortcode display metainformation as linked image
- How to avoid one code multiple times instead do that through some function? Shortcode, but I think shortcode is not used in main theme’s core files?
- Check if Page=current user page via shortcode
- Shortcode for displaying the user’s first name?
- convert it into short code & explan how? [closed]
- Enqueue Scripts / Styles when shortcode is present
- Conditionally Loading JavaScript/CSS for Shortcodes
- What does extract( shortcode_atts( array( do?
- How do I escape a ‘]’ in a short code?
- Pass boolean value in shortcode
- Show shortcode without executing it
- user_login vs. user_nicename
- Shortcode always displaying at the top of the page
- Redirect function inside a Shortcode
- Adding fields to the “Add New User” screen in the dashboard
- How to create a shortcode with 1 parameter (atts)
- Difference between update_user_meta and update_user_option
- how to show the syntax of a shortcode
- How to filter users on admin users page by custom meta field?
- Custom shortcode being executed when saving page in wp-admin
- Change appearance of shortcode text inside editor
- current_shortcode() – detect currently used shortcode
- get_user_meta() doesn’t include user email?
- shortcodes output before content [duplicate]
- WordPress plugin shortcode not working
- How to add stylesheets only to pages with specific shortcode?
- Using get_option() in JavaScript
- Automatically delete inactive users after 2 months
- Shortcode empty attribute
- Check if user is admin by user ID
- How does a shortcode work?
- Shortcode outputs at the top of the_content
- the_excerpt and shortcodes
- Using wp_editor in shortcode
- Remove wpautop from shortcode content / remove whitespace in buffering
- Get current post id witout passing in shortcode
- Why are you using add_action for shortcode?
- How to get URL param to shortcode?
- How to add multiple buttons to TinyMCE?
- Check if post/page has gallery?
- Get first video from the post (both embed and video shortcodes)
- Get shortcode name from within it’s callback function? [duplicate]
- Return all users with a specific meta key
- Wordspress add into my javascripts
- Making a Shortcode [NEXT] and [PREVIOUS] to place into specific posts for post navigation
- How do I create a Shortcode that returns text if domain is .com, not .co.uk
- Using preg_replace to separate gallery from the_content?
- Remove specific shortcode from get_the_content()
- How to display the site name in a WordPress page, or post
- Hide/show content starting in the middle of a paragraph
- Combining shortcode and get_template_part
- How can I put a wp_redirect into a shortcode?
- Where the Nickname is being used in WordPress
- Escaping quotes from shortcode attributes
- Run visual composer code in php page
- short code output too early
- Shortcode in shortcode: How to append variable?
- How to display custom user meta from registration in backend?
- Remove wptexturize from a shortcode?
- Allowing an email as the username?
- How can i put an array as variable in shortcode_atts?
- Autoembeds don’t work with paragraphs
- Table of Contents with a shortcode
- Grouping users under parent user
- Create custom [sourcecode] shortcode, the right way?
- TED talks shortcode not working
- Allowing shortcodes inside attributes
- What is the best way to enable nested shortcodes?
- get_users is expecting unserialized meta_value
- Tinymce – How to hook before or after live shortcodes rendering?
- How to customize a shortcode using the customizer
- Native “playlist” shortcode random playing… How?
- How to Output HTML tags in do_shortcode?
- List of all inbuilt WordPress shortcodes
- Nested Shortcode Detection
- Shortcode output always showing at top of page
- Organizing shortcodes. How to display all of them and their attributes?
- How to detect if a Shortcode is being called on a page?
- How to get current page title inside a page itself in a shortcode and in page content
- How to get users by a custom field / by user meta data?
- Show content only if member left a comment
- how to have the gallery shortcode output one single UL list instead of several DL?
- Implement If-ElseIf-Else-EndIf with short codes
- Short code to display a loop
- Using shortcode in Post title
- How to display random users with avatars
- How to create a template for a custom URI associated with the user