Tag Info

Hot answers tagged

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 ...


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 ...


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

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 ...


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 ...


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_'; // ...


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

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' => ...



Only top voted, non community-wiki answers of a minimum length are eligible