How can I set wp_dropdown_users so that it shows only authors?

you can create a function which gives you all users which have role author in a drop down list. Note: It is a dummy example modify it as you want( put this function in functions.php or custom plugin ). Use: Call this function any where in theme like <?php ravs_author_dropdown_list(); ?> function ravs_author_dropdown_list() { // … Read more

call wp_insert_user in custom class doesnt work

In addition to the debugging advice from @s_ha_dum, you could try to catch the possible WP_Error thrown by wp_insert_user(): $user_id = wp_insert_user($params); if ( is_wp_error( $user_id ) ) { echo $user_id->get_error_message(); } else { printf( ‘User created with user_id = %d’, $user_id ); } Maybe the user already exists? You could also use email_exists() and … Read more

User meta and public function security

functions.php is not more nor less secure than any other file in your WordPress installation, just like post meta is not more nor less secure than any other table in your WordPress database. That means that they are secure until your site is hacked. So question become “is WordPress secure?” and I think that: that … Read more

How would I restrict certain user levels from editing categories

You would need to remove the capability for a Editor role to manage_categories add_action( ‘init’, ‘remove_editor_manage_categories’ ); function remove_editor_manage_categories() { $role = get_role( ‘editor’ ); $role->remove_cap( ‘manage_categories’ ); } Source http://codex.wordpress.org/Function_Reference/remove_cap

WordPress where clauses in db select

I think you are missing the relation key here. If you want the users to be picked up when both the above meta values are matched, then you should use this as below $users_sent_to_admin = new WP_User_Query( array( ‘meta_query’ => array( ‘relation’ => ‘AND’, array( ‘key’ => ‘pending_approval’, ‘value’ => ‘true’, ‘compare’ => ‘=’), array( … Read more