in my multi author website I have a button that users can upload their avatars. I need to display this button in author page. I can do it. I added this button to author page. The problem is that author can see this button in other author's page too . That's why I need to display this button in author page of current user. I am so sorry I have no any reference code. I have no any idea how …
I have a custom built site that does not use usernames and everything requires use of their email address. The username is auto generated and looks bad in the table. I know there are filters and actions to work with custom columns within the users table but I have been looking for a way to replace the username with the email address. I know I can unset the username using manage_users_columns filter but I then loose the row actions. Is …
my website users register with phone number OTP. That's why they have no email address in their accounts. Today I need email address in user accounts. I use this code to add email address for new user registrations. add_action("user_register", function ($user_id) { $user = get_userdata($user_id); if (empty($user->data->user_email)) { $args = array( "ID" => $user->id, "user_email" => uniqid() . "@example.com", ); wp_update_user( $args ); } }); add_filter( 'bnfw_trigger_insert_post', '__return_true' ); But I have about 3000 users that need email address in …
I have created a custom page which shows the list of Users(Role = 'Subscriber'). I named this page "Reporting" & It is based on wp_list_table. Now I want to show the user details (having custom layout & user meta). I am not sure How to create a link of user detail page or create a detail page. Here is the code which shows User lists Data. class-cisco-connex-core-wp-reporting-table.php class WP_Reporting_Table { /** * Constructor */ public function __construct() { // Hook …
in wordpress multisite when we give to site admin the option to add new users, site admin dont have the "checkbox" to add the new user without sending the user email with link activation (see the screenshot) how can we add this option to site admin?
I want to exclude Subscribers from a user list. My code is: $users = $wpdb->get_results( "SELECT display_name FROM $wpdb->users ORDER BY display_name ASC" ); How can I change that so subscribers are excluded from the list? I also looked at the get_users function in codex but it did not have an exclude by role parameter. Edit: Or another way would be to get the results filtered by capability (one that subscribers doesn't have).
I'm displaying users (authors) on a page. how can I add a filter based on user custom feilds? <?php // THE USER QUERY ARGS $args = [ 'role' => 'author', 'number' => -1, ]; // THE USER QUERY $user_query = new WP_User_Query($args); // THE TOTAL SUBSCRIBERS NUMBER echo '<h3 class="font-weight-bold">Total Listed Shops: ' . $user_query->get_total() . '</h3>'; echo '<hr>'; // THE USER LOOP if (!empty($user_query->get_results())) { foreach ($user_query->get_results() as $user) { // ACF PREFIX & FIELD DATA FROM USER PROFILE …
I am having hard time for importing to user-meta and post-meta from my non-wp-tables. I am trying to do db migration from user table and post table to WordPress tables. So it might be user table to wp-users and wp-usermeta post table to wp-posts and wp-postmeta I have been trying to find good plugins but it's all limited. (only basic information) My old user table has all of users information on only 1 row (1 line) such as phone number, …
I know this is not the way u should go, but my customers want it so im looking for ways. Requirement: WP with one DB (3 Domains sale the same stuff) 3 Domains which use this DB (can be more later), this should work with on fly rewriting over hooks user registered should be only able to login in the domain where he is registered, but should be able to register on the other 2 domains with same data. My …
I'm wondering if it's possible to logout all users 2 times a day using the function wp_logout() ? I see loads of plugins who can logout idled users but we want to log out every single users twice a day at 2PM and 10PM Hope someone can help me with this.
i have created user vote that can vote users or author of posts. so for example have 4 users which looks: user --- ID=1 --- META KEY='_thumbs_rating_up' --- META VALUE='13' user --- ID=2 --- META KEY='_thumbs_rating_up' --- META VALUE='17' user --- ID=3 --- META KEY='_thumbs_rating_up' --- META VALUE='8' user --- ID=4 --- META KEY='_thumbs_rating_up' --- META VALUE='241' So i must order these users by user meta key and meta value from heighest to lowwer. So i have these code now …
I would like to allow contributors to upload a file. So I use this recommended plugin WP Role Editor After activated, I go to the plugin from User > User Role Editor and then select contributor in the selection dropdown. After that I put a check on upload_files and hit update. Then, I login with contributor account to test uploading a file. Great, I see the media upload button but when I click to upload a file, I get this …
I want to disable the default email that is send when user is registered. I am using this plugin for email verification User Verification By PickPlugins, which sends an email with confirmation link, but the problem is that by default and WordPress send an email via pluggable.php: function wp_new_user_notification( $user_id, $deprecated = null, $notify = '' ){...} I am using a theme (which I am extending with a child theme), which calls wp_create_user. I have replaced that parent theme function …
The page name with my form is "Register", which means the slug is "register". That is the first piece of info that is tied to my theory about my error. When I run wp_insert_user I get a success the first time, but the user name is "register". So subsequent submissions try to create the user "register", so it errors out with a "User with that user name exists" error. I've checked my data over and over again to verify that …
I am trying to hide almost every single admin menu from wordpress dashboard for a specific user id who has administrator role. I want to give that user only option to edit a certain custom post type named lessons and other custom post type Events. I am using LMS wordpress theme from themeforest by designthemes. I am not sure why this theme just don't give access to the WP-admin for other role except administrator, like Editor, Contributor etc. So I …
I have a WP theme with its own custom fields including one for Phone Number. I also installed the Digits Plugin which allows users to sign up/login with their phone number and OTP, which has its own phone number custom field. What I want to do is to use the phone number they use to sign up/login to also be the phone number used within the theme and also within Woocommerce if possible. Any help would be appreciated
I am showing all the users by using the get_user() function. But I need to paginate the results. I tried a lot, but didn't succeed. Here is the code, which doesn't work as expected: $args = array( 'meta_query' => array( array( 'key' => 'ib_s2member_custom_fields', 'value' => trim($_GET["country"]), 'compare' => 'LIKE' ), array( 'key' => 'ib_s2member_custom_fields', 'value' => trim($_GET["city"]), 'compare' => 'LIKE' ), array( 'key' => 'ib_s2member_custom_fields', 'value' => $first_name, 'compare' => 'LIKE' ), array( 'key' => 'ib_s2member_custom_fields', 'value' => $last_name, …
I am creating a Super Admin role in wordpress Roles. $capabilities=array(); add_role('Administrator', 'Administrator', $capabilities ); add_role('Super Admin', 'Super Admin', $capabilities) ); So while adding a new user I got the Role Option Super Admin. So I added a Super User . Now When I login to wp-admin It gives me error saying: you do not have sufficient permissions to access this page. What more I have to do to make it work. I dont want to use any pluggin. I …
I need to create a search page that will display anything related to the supplied search. i.e. comments containing it, events, posts, CPTs and users with that name. How can I search for users in the site who's first or last name contains the search phrase ?
I have a question in regards to a WordPress plugin (Bookly) that creates a Staff ID for an already created WordPress user, and hopefully, somebody may be able to help me with. Currently Bookly adds the Staff ID incremental so each new staff ID would say Staff ID:4 then the next 5 then 6 etc, I'm looking for some code that would take the current WordPress user's ID and add that ID as the Staff ID for that user when …