Questions tagged [users]

Refers to accounts with the ability to login and participate in a WordPress site.

Filter by
Sorted by
Tagged with
0 votes
1 answer
722 views

How to list users by custom field?

I have a custom user field in the standard database, called company. I want to output on to a page the usermeta info only of users whose company matches Widgets Inc ... How do I do that? What I'd ...
0 votes
2 answers
345 views

Users as team members through a loop in elementor

I am trying to create a loop in Elementor's theme builder that will display each user with the role of the Contributor or Author. I.E. When the admin of the website will add a new user with the above ...
0 votes
1 answer
976 views

WordPress 5.8 - Hide or Remove personal fields from admin Profile page

There are several threads on this topic, but none updated to Wordpress 5.8 The question is, in 2021 WP 5.8, what is the cleanest or recommended code to hide profile fields when creating/editing a user,...
0 votes
1 answer
1k views

UPDATE on SELECT results. A SQL query to swap Author with Meta Box value

I inherited a project where, for some reason, the previous developer make a custom post type for authors and a custom select listing all those authors cpt titles in the post edit screen. This led to a ...
2 votes
1 answer
2k views

How to delete all customer user account that haven't placed a single order?

Recently I've had an influx of spam users registering on my Wordpress website and I am trying to delete them all if: they have a "Customer" role haven't placed at least one order before As I could ...
0 votes
2 answers
21 views

WordPress user password reset not working

I have additional users set up on my WordPress site. One of the other users has asked me to reset their password as the 'forgot my password' function doesn't work (a reset password email isn't ...
1 vote
1 answer
32 views

redirect to my login page if not logged in

When a customer wants to leave a review on the product page, they are prompted to log in if not. Do you have a proposal to send the customer to the a specific login page and then return once logged in?...
0 votes
1 answer
2k views

How to Access wp_usermeta Data Immediately After a New User is Created

I am trying to find a WordPress action hook that will allow me to access a new user's wp_usermeta information, immediately after the user has been created. In our registration process, custom fields ...
0 votes
1 answer
1k views

On button click, redirect users to registration page instead of another page

I have a button that I have that leads users to a page on WordPress called /portfolio/, so is there a way that I can redirect users to the /registration/ page until their logged in? I'm using a ...
1 vote
2 answers
2k views

WP User Query fails when searching meta queries and search columns

I'm building an advanced User search using WP_User_Query but experiencing some unusual behaviour. I'm trying to search with a term that I know exists in the user_nicename and user_email fields but ...
0 votes
2 answers
2k views

Changing Wordpress author name in database

I originally begun my wordpress site using a psudonym. Over the past few years I have been attributing my own name to all articles and have had the author name options switched off. Now I'm changing ...
2 votes
2 answers
757 views

how do i get a greeting for logged in uses by the time of day

hi i am looking to combing to pieces of code into 1 both work but not together keep no matter what i try it keeps crashing the site <?php $t=date("H"); if ($t<"12") { echo " Have a good ...
16 votes
7 answers
40k views

How to check if a user exists by a given id

Is there any way to check if a user id exists? I want to create a function similar to username_exists() but which returns if the id exists or not.
0 votes
3 answers
2k views

Assign a Post to a User

1 - I have a CPT, with 10 posts. 2 - I have 10 users Q : How can i assign a single post from my CPT, to an unique user ? -> Each user must see only it's assigned post (Each post will be assigned by ...
0 votes
1 answer
1k views

Get current user array with post string

I need to get 10 current user fields and pass the field values to a post string. The post string is expecting certain label names for each value. Example - post string expects 'firstname' => '...
0 votes
1 answer
773 views

Modify new user email notification in network admin screen wp multisite

Can please teach me which function reference should I use to modify new user email notification in network admin screen -> add user. I want to use custom email template for notify user? it will ...
9 votes
1 answer
8k views

Execute a function when admin changes the user role

How can I execute a function, when admin changes the user role of a user? I have two user roles: one is agent and the other one is client . My need is that when admin changes the user role of ...
12 votes
9 answers
43k views

Get multiple roles with get_users

I've got some code like this: $query_args = array(); $query_args['fields'] = array( 'ID', 'display_name' ); $query_args['role'] = 'subscriber'; $users = get_users( $query_args ); foreach ($users as $...
0 votes
1 answer
919 views

Add WordPress users to a custom post type

I have created a custom post type called Groups. I would like to provide an option to add Users to these groups in the Group edit page. Any help would be appreciated thank you. P.S: I thought of ...
1 vote
1 answer
2k views

Allow Contributors to Upload Files

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 ...
0 votes
1 answer
1k views

admin ajax is not working for non logged in users

I know that this issue has been discussed many times, but I think I tried most of the advises. This is my code: $.post('<?php echo admin_url( 'admin-ajax.php' ) ?>', {'action': '...
0 votes
1 answer
816 views

Can't activate a user on multisite install

So I have a user that I can't activate with the unconfirmed plugin manually. His user was created on all appropriate sites, but his account isn't listed as activated. The link in the activation email ...
0 votes
0 answers
13 views

Add a product for all users based on a condition (WooCommerce)

Hello everyone in my wordpress website, I want to add a product to all users based on a condition, I mean if a condition is true I will inform specific users and then add the product for them, how can ...
2 votes
1 answer
1k views

How to get profile user id when uploading image via media uploader on profile page

I have a PlugIn which lets a user upload an image to a user profile in the backend. Now I want to access the user id in the uploader to change the filename of the uploaded image. On the user profile ...
0 votes
1 answer
26 views

wp_authenticate_username_password not authenticating properly when pass username and password

I am developing custom login page and want to login through username and password. To authenticate user, i am using this function wp_authenticate_username_password() $usr_user = ...
1 vote
3 answers
3k views

Add a role and give admin priviledges

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 ...
0 votes
1 answer
2k views

Updating custom user meta

I have created a new custom meta for my wordpress users. These are just 2 radio buttons (either 'Yes' or 'No'). I have created a button on the front end and want it so that if the button is clicked, ...
1 vote
1 answer
904 views

Display custom user profile fields in wordpress

New to wordpress development. I was trying to solve the problem of adding extra fields to my wordpress logged in subscriber user profile area, and also echoing the field values in my custom page ...
0 votes
2 answers
1k views

Allow a user or role to view drafts and previews, but not other admin privileges?

How do I allow a specific user or a specific role to view drafts and previews, but not allow them to edit posts or have any other admin capabilities? I can add a custom capability to a role, but don't ...
0 votes
1 answer
19 views

How to allow users in wordpress to switch between two assigned roles e.g. Candidate & Employer

I am using Careerfy Theme for wordpress which is basically a job board and has Candidate and Employer User roles set for new registrations. I want registered users to be able to switch between these ...
1 vote
0 answers
92 views

How to "attribute all content to" specific user once delete user in wordpress

I have a question about how to attribute all content to specific user once delete any user in Wordpress. Is there any idea how could I disable "Delete all content" option and set as default ...
0 votes
1 answer
2k views

wp_insert_user always tries the same user name

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 ...
6 votes
2 answers
2k views

Give to site admin the option to "skip confirmation email" when adding new user

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 ...
0 votes
0 answers
40 views

How can I display different menu for logged in users using a block theme

I am trying to display a different menu for the logged in users. The problem is that the classic wp_nav_menu_args filter does not work for block themes. Or I can't make it work. Does anybody know how ...
0 votes
1 answer
1k views

import (migration) user database to wp-users

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 ...
0 votes
1 answer
18 views

How is user visits calculated

the users screen includes the column 'visits'. It lists the number of visits but I would like to know how it is calculated?
0 votes
2 answers
2k views

change user password REST API

I am trying to let a user change their password via the API. What it looks like here is that I can send a POST request to the users endpoint with their user ID at the end, sending the new password in ...
0 votes
2 answers
2k views

User list order by user meta

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=...
0 votes
1 answer
2k views

Pagination for user list

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( '...
0 votes
1 answer
38 views

Email notification when registred user clicks a link/visits page

Wordpress- I need to get an email which signed up user visited/clicked on link/button/or visited specific page. Email needs to tell me at least their username, or something from sign up form from User ...
0 votes
1 answer
728 views

How to keep the plugin submenu open on viewing a custom version of users.php?

I have added to my-plugin submenu a custom view of the user list using users.php and a my_plugin_view argument to filter the request: add_submenu_page( "my-plugin", '...
0 votes
3 answers
2k views

Disable emails for new user registration

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, ...
0 votes
2 answers
3k views

User profile in front-end

I want every user to get a profile in the front-end of my website. So I want to visit website.com/user/user-name and view all the information of this user. Is this somehow possible? I would like to ...
1 vote
1 answer
1k views

how to get WordPress admin user table columns name in my plugin

I used this to get User list table columns Name. add_filter( 'manage_users_columns', array($this , 'new_modify_user_table')); public function new_modify_user_table( $column ) { $column // ...
0 votes
1 answer
776 views

Append USER ID to an outbound link?

Please bear with me as I am a newbie. Is there a way to append a USER ID aka a logged-in user's ID to any external link. For example, a logged-in user clicks a link, the link then appends that user'...
1 vote
3 answers
3k views

Move users and passwords from one wordpress site to another

I need to copy over Wordpress users with roles/passwords intact to a new install. I'd prefer not to copy the entire site (though if I have to I will.) Currently I only have the one main admin account ...
0 votes
1 answer
1k views

Is it possible to create a custom admin page for users?

I want to greatly restrict the user's authority in the website. I don't want to give the user access to the admin console but I do want to allow the user to edit their username, email, and password. ...
1 vote
2 answers
2k views

When I try to login in wordpress it is showing "USER Doesn't Exists"

The main Issues is that I am entering the email address & password that I used in creating my WordPress site in digital but It shows that the email address & username doesn’t exist even I ...
6 votes
2 answers
5k views

Remove email verification when new user register

Please note I'm not posting this question without doing google search, but the problem is every single result I found is either about BuddyPress or WP Multisite, but I have a WP Single installation ...
0 votes
1 answer
1k views

User Following System

I have a custom plugin which allows users to follow each other. The follow and unfollow functionality works by ajax which is fine but there are just a few bugs that need sorting out which I am unsure ...

1
2 3 4 5
42