Allow user access to Dashboard only!

You can put this in your functions.php : function remove_menu_items() { global $menu; global $user_ID; if( $user_ID ) : /* Dashboard only acccess */ if( current_user_can( ‘dashboardvisitors’ ) ) : $restricted = array( __(‘Posts’), __(‘Pages’), __(‘Links’), [etc…] ); endif; endif; end ( $menu ); while ( prev( $menu ) ) : $value = explode( ‘ … Read more

Search Users base on meta_value & meta_key

Your query is wrong that’s way noting is returned because there is no row in the database that holds more then one meta_key. What you can do instead is create a Sub Query to get all user id’s of users who live in London as a Sub Query and the use that to filter users … Read more

How to use WordPress for class notes?

My recommendation would be to add a separate site (usually pretty easy to do … just follow the typical installation instructions). Then, you can export your current content into an XML file and import it into the new site. A Better Option Create a new site on WordPress.com and import your content there. This has … Read more

Is there a way to make custom fields only editable by administrators?

<input type=”text” name=”facility” id=”facility” value=”<?php echo esc_attr( get_the_author_meta( ‘facility’, $user->ID ) ); ?>” <?php if (!is_admin()) { echo ‘disabled=”disabled”‘; } class=”regular-text” /><br /> <span class=”description”><?php _e(“Please enter the facility name.”); ?></span> Add this third line to all your inputs that you don’t want the non-admins to edit.

How can i change the name order in the admin?

You can’t alter the default Name column, but what you can do is hide it and create your own custom column. First, we add the action and filter on admin_init that will add and manage our new column: function wpa66544_user_custom_column_init(){ add_filter( ‘manage_users_columns’, ‘wpa66544_user_add_column’ ); add_action( ‘manage_users_custom_column’, ‘wpa66544_user_manage_column’, 100, 3 ); } add_action( ‘admin_init’, ‘wpa66544_user_custom_column_init’ ); … Read more