User “none” role
User “none” role
User “none” role
You can use jQuery to disable the display name select. function disable_display_name() { global $pagenow; if ( $pagenow == ‘profile.php’ ) { ?> <script> jQuery( document ).ready(function() { jQuery(‘#display_name’).prop(‘disabled’, ‘disabled’); }); </script> <?php } } add_action( ‘admin_head’, ‘disable_display_name’, 15 );
You could use Buddypress to achieve this along with this plugin: https://wordpress.org/plugins/bp-redirect-to-profile/ Hope that helps.
If you are using this on author pages or in loop then you can simply use this. echo the_author_meta( ‘user_registered’ ); This will output registration date of author. So your function will become. if ( is_author() ) { $curauth = ( isset($_GET[‘author_name’]) ) ? get_user_by( ‘slug’, $author_name ) : get_userdata( intval($author) ); $date = the_author_meta( … Read more
Try this: if ( !empty( $user->roles ) && is_array( $user->roles ) ) { $first_role = array_shift($user->roles); echo $first_role; } Function array_shift obtains the first element of the $user->roles array.
Ok, solved this. I had to use the posts_clausesfilter and the following code: function assigned_to_orderby( $clauses, $wp_query ) { global $wpdb; $clauses[‘join’] .= ” LEFT OUTER JOIN {$wpdb->postmeta} ON {$wpdb->posts}.ID={$wpdb->postmeta}.post_id LEFT OUTER JOIN {$wpdb->users} ON {$wpdb->users}.ID={$wpdb->postmeta}.meta_value “; $clauses[‘where’] .= ” AND ({$wpdb->postmeta}.meta_key = ‘assignee’)”; $clauses[‘groupby’] = “{$wpdb->postmeta}.post_id”; $clauses[‘orderby’] = “GROUP_CONCAT({$wpdb->users}.user_login ORDER BY {$wpdb->users}.user_login ASC) “; … Read more
You’r following an bad idea. What you would like to reallize is, displaying a few profiles, not all. It doesn’t matter if the role is named “king” or “queen” even if your specific roles called so. There is an better way to reallize such Kind of requirements: Capabilities. Add an capabilitie to WordPress and just … Read more
WP_User_Query has an ‘exclude’ argument, which is designed to accept an array of user IDs to exclude. Since it will accept an empty array, when that’s the only parameter, the resulting object will contain all registered users. The most direct path to the IDs is via the $results property. We can reduce $results to just … Read more
As mentioned by @PieterGoosen in the comments, all I had to do was shift my code to a custom author.php and the rest was solved.
As you are going to enter all data by yourself you can make use of Custom Post Types. Create 3 CPTs for each user type, Trustee, Alumni, Scholar. And with that create custom fields as per your need for each CPT. Once all data is in, then you need is to create Custom Page templates … Read more