How to hide “Change role to” dropdown on Users admin menu
How to hide “Change role to” dropdown on Users admin menu
How to hide “Change role to” dropdown on Users admin menu
Use WP cookie to authentificate user on an external app
You said that KingComposer will accept PHP blocks. This will generate a link to the current logged-in user’s author page: <?php $author_page = is_user_logged_in() ? get_author_posts_url( get_current_user_id() ) : NULL; $acc_pay_page = $author_page ? add_query_arg( ‘screen’, ‘acc_pay’, $author_page ) : NULL; if ( $acc_pay_page) { echo ‘<a href=”‘ . esc_url( $acc_pay_page ) .'”><img src=”account_page_page.png” /></a>’; … Read more
I managed to solve my issue by taking a look at \WP_REST_Users_Controller::get_items and noticing that there’s not an automatic way to filter via meta terms. Instead you need to apply_filters to actually input the args in the array. So in order to achieve my searching I had to do these things. in functions.php or a … Read more
Show posts who published after registration date
As you can see in question, a lot of things were checked and a lot of debugging was performed, but the most elemental thing was not checked. The user in question had simply visual editor disabled in user configuration: After enabling this issue become solved. This is dumb and underlines my ignorance. The only explanation … Read more
Cannot update newly added User field using wp_update_user
In addition to the code piece in the question, 1. To display only the author roles in the user list page of editor: add_action(‘pre_user_query’,’editors_edit_author_list’); function editors_edit_author_list($user_search) { $user = wp_get_current_user(); if($user->ID != 1) { $user_meta=get_userdata($user->ID); //$user_roles= $user_meta->roles; global $wpdb; if(in_array(‘editor’, $user_meta->roles)) { $user_search->query_where = str_replace( ‘WHERE 1=1’, “WHERE 1=1 AND {$wpdb->users}.ID IN ( SELECT {$wpdb->usermeta}.user_id … Read more
You probably don’t need to use ajax, you just need to check for user role and screen and output your required fields / metaboxes . How to check if a user is in a specific role? https://developer.wordpress.org/reference/functions/get_current_screen/
Figured out the SQL query that can be used to reset the display_name to first_name + last_name. And it’s simpler than the JOINs that I was trying when I posted the question. UPDATE wp_users SET display_name = Concat( (SELECT meta_value FROM wp_usermeta WHERE meta_key = ‘first_name’ AND user_id = id ), ‘ ‘, (SELECT meta_value … Read more