Hot answers tagged

10

Yes, this is a good question and the answer is basic Wordpress 101 (core), contrary to the two comments above. No plugin necessary. You simply go to Users and delete the author (user) that you don't want to keep. Wordpress then asks you if you want to delete their content or attribute it to another user. Choose the author (user) you wish to keep and it will ...


4

You can use the views_users filter to alter it. Here's an example: /** * Remove the users view */ add_filter( 'views_users', '__return_empty_array' ); if you want to remove it for every user. Here's another example how you could remove it for non-admins (PHP 5.4+): /** * Remove the users view for non-admins */ add_filter( 'views_users', function( ...


3

first_name and last_name are not the part of _users table it is user metadata. Therefore, user object does not have it. So when you access the property first_name user object has a PHP magic method __get() /** * Magic method for accessing custom fields * * @since 3.3.0 * @param string $key * @return mixed */ public function __get( $key ) { if ( ...


3

Trying to detect when a UI was triggered, is indeed the wrong general approach (unless you want to tie to the UI). A proper one will be to hook on the user_register action. add_action( 'user_register', 'wpse223196_registration_save', 10, 1 ); function wpse223196_registration_save( $user_id ) { add_user_meta($user_id, 'score', 5); }


3

Register a collection post type to represent a single collection. You'll get permalinks and rewrite rules to resolve the requests for free. Insert a new collection post for a user when they create a collection, and save the chosen post IDs as an array in post meta. You can pass that array directly as post__in argument in a WP_Query instance to load the ...


1

'users' != $current_screen->id in your file $current_screen is not set therefore, you are getting warning. You can pass custom var in your user query and check before running your code. $blogusers = get_users( 'orderby=nicename&order=ASC&my_filter=1' ); Here we are passing my_filter=1 then later we can check in pre_user_query global $wpdb, ...


1

Place the following code in your theme's functions.php file: add_filter( 'bp_core_enable_root_profiles', '__return_true' ); I hope this helps.


1

Consider using DateTime as this would give the ability to format the date: $user = wp_get_current_user(); $date = new DateTime($user->user_registered); echo 'Registered since: '.$date->format('jS F Y');


1

Based on your comments, you should choose option 2 (using special template files). You can do that multiple ways, but I suggest you do the following: Create a plugin that will setup login, register, retrieve password, profile, delete account, and other related pages; (there will be a lot of pages). Creating a plugin is just a suggestion, but I prefer doing ...



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