Tag Info

New answers tagged

0

What is the exact meta_key and meta_value for the field I created using the function custom_user_profile_fields ? created_by and some user ID, for example: $args = array( 'meta_key' => 'created_by', 'meta_value' => 123, ) You could use a meta_query for more complex searches. $args = array( 'meta_query' => ...


1

I've found it. /*** Adding extra field to get the the user who creates the another user during ADD NEW USER ***/ function custom_user_profile_fields($user){ if(is_object($user)) $created_by = esc_attr( get_the_author_meta( 'created_by', $user->ID ) ); else $created_by = null; ?> <h3>Extra profile ...


1

Users created in Site_A have roles assigned to them. Same users are available in Site_B but they have no roles assigned. Create a PHP script sync-admins.php with the following code in it: <?php // load WordPress environment require( 'wp-load.php' ); // REPLACE 'siteb_' with table prefix of Site_B in line below! $tblPrefixOfSite_B = 'siteb_'; // ...


0

This is what I just used, maybe there was a problem in past versions of WordPress or your theme. function allow_contrib_upload() { // get the role $contrib = get_role( 'contributor' ); // add the upload capability $contrib->add_cap( 'upload_files' ); } add_action( 'admin_init', 'allow_contrib_upload', 11 );


3

Firstly, you need to add the following capabilities to the Doctor and Receptionist role: list_users edit_users create_users delete_users Now we can get to work with controlling which users they can create/edite/delete. Let's start with a "helper" function that will return which roles a user is allowed to edit: /** * Helper function get getting roles ...


0

Seems like GravityView incl. the Advanced Filtering Extension will do this quite nicely - just for info.


1

This is right. You can use Wordpress in exactly the same way as you were using your OLD CMS. Wordpress is being used by Top newspapers / magazines and websites and they've editors / authors and bloggers and ofcourse they have groups & roles. CNN, Mashabale, TechCrunch, etc are all based on Wordpress. There are Free and Premium both type of plugins to ...


2

Notice that your redirection must happen before the HTTP headers are sent out. You can try the following, where we place our logic inside the template_redirect hook callback (PHP 5.4+): /** * Redirect logged-in users to the admin dashboard * if the have written 'student_form' posts * else display [wpuf_form id="414"] */ add_action( ...


1

If you are needing users to have the ability to edit/delete their submitted content I would assume they are registered with their own member account on your wordpress website. If this is the case, why not build a custom role for your new members and then restrict everything for that role in the WP-admin to only show the posts add and edit page? This would be ...


0

I found an answer. It is because the WooCommerce plugin which prevents users without edit_posts capability to display dashboard. Well, I think they should let you know that they are making this kind of change in WordPress default settings. Because you are not able to turn it off in WooCommerce settings.


2

You need to make the functions available, they are located in wp-includes/user.php. So load the user.php via require e.g. like this: require( ABSPATH . WPINC . '/user.php' ); But keep in mind, if you need to do that and load wp-load.php manually, then you likely have not done it right. Meaning, you should aim for a solution that is integrated into the ...


0

For your situation, ideal solution would be this plugin: Restrict Categories It allows you to restrict the users to add, view and edit categories. Note: But before installing, make sure you have a backup. The most recent review had a problem of categories getting disappeared.


1

You are trying to access the meta data of the user with ID stored in $user->ID but the object $user is not defined in your code. You are also using an undefined variable $user_ID. The quickest fix in your code would be to change this: get_the_author_meta( 'province', $user->ID ) ) With: get_the_author_meta( 'province', $userdata->ID ) ) Tip: ...


5

The user passwords are stored in one-way encription. Even looking at the database you can not know the password. The is a very basic privacy feature. Most users use the same password on multiple sites; imaging the potential risks for users if the administrator of the site can access to their passwords. You can intercept the password from the ...



Top 50 recent answers are included