Tag Info

New answers tagged

0

I'd try this with two steps. First, install the Multisite User Plugin or grab the useful bits from its code. Short version: It hooks into user_register and loops through each blog in a multisite, adding the user to each one with a preset role. Handy. Second, use wp-cli to import a CSV of users: wp user import-csv /path/to/users.csv By default, this will ...


0

It sounds like you may have a plugin that is overriding the user-edit page, I would setup a dev environment mirroring the site and start disabling plugins until I knew which one was modifying the user-edit page. From there you may find it has a setting that allows you to turn it back on. The Profile section on a default WP install does not have a filter or ...


0

Seems simple enough in concept - get name/ID of logged-in user at time the action is performed with get_currentuserinfo(): https://codex.wordpress.org/Function_Reference/get_currentuserinfo. Would be easier to answer more specifically if you explained precisely where and how you wanted the information to turn up and what code you're looking at now where ...


-1

This worked for me: global $wpdb; require_once('/path/to/wordpress/wp-load.php');


0

Try logging in with an account that's NOT an admin account. I think that's just a quirk of an admin account...it assumes you want to go to the control panel.


0

STing, thanks for your attention. I will explain better. Both the website and the blog belong to the same project. In the configurantion website/blog, the website is the Online Business Directory Im developing and the blog its just about that. I planned this strategy, to start blogging about the niche of the website (Online Business Directory) while Im ...


0

Because you need to give your function a parameter: function auto_follow_admin( $user_id ) { // Now you can use $user_id, which is passed to the function from the hook caller }


0

There is really no answer given the limited facts in the question. Are you requiring that users login to see pages/data? If not I don't see why you would care to share user tables. There will be some things that multisite will handle better but there will be some things (handling certain plugins) that multisite will make you pull your hair out. If I had ...


0

You can hide profile fields on the edit screen from everyone except site admins - therefore they can only be edited by site admins. They will still be visible on the public profile screen. You can get the field id by looking at the url in wp-admin when you edit that field, or just rolling over the edit button. Add this function to your child-theme ...


0

Add this snippet to your child-theme functions.php or bp-custom.php function bpfr_hide_profile_edit( $retval ) { // remove field from edit tab if( bp_is_profile_edit() ) { $retval['exclude_fields'] = '2'; // field ID's separated by comma } // allow field on register page if ( bp_is_register_page() ) { $retval['include_fields'] = '2'; ...


0

I don't believe you are doing anything wrong, I think it is the way the get_users function works https://codex.wordpress.org/Function_Reference/get_users... search - Use this argument to search users by email address, URL, ID, username or display_name. Perhaps the phrases you are searching with do not match any of the above as it needs to be a full ...


0

If I understand correctly, you want 2(two) different shapes, and actualy not 2 different images?! If so, this answer below is a solution which you can use. But when I am wrong, my answer is probably useless. I personally would do such with CSS. I am not saying that it always works/is the solution, but for avatars it sure is the (imho) most fastest simple ...


1

The first issue as I see it is that you are using the_terms function. If you actually look in the source code you will see that after a couple of other function calls the whole thing fails because eventually the function get_the_terms is called which checks if the ID you are passing is a valid post. Sometimes this might work though if the user_id might ...


1

The problem is that you can't use the value for the LIKE comparison as you've mentioned. The generated SQL will look something along the lines of: AND CAST(wp_usermeta.meta_value AS CHAR) LIKE '%B%' which means that the query is set to look for every occurrence of letter B in our case. Of course this is not what you want, what you would need is something ...


-1

While looking for a multi step registration form, i came across Stride (a multi step profilepress registration form) on Google http://profilepress.net/downloads/stride-wordpress-multi-step-registration-form/ Note: its free albeit depends on a premium plugin called ProfilePress which cost $39. Totally worth the money IMO.


1

As you may or may not be aware WordPress provides a profile page in the admin for each registered user (including the admin of course!): `http://www.example.com/wp-admin/profile.php' On that page you will see a number of fields that can be edited / customized including a Biographical Info field. To fetch and output a field from this page for a particular ...


3

get_currentuserinfo() is a pluggable function, it is not available during plugins load stage. That aside you shouldn't be adding filter conditionally, but use data provided by the filter. If you take a look at filter calls: apply_filters( 'auth_cookie_expiration', 14 * DAY_IN_SECONDS, $user_id, $remember ) $user_id is provided as second argument. You ...


3

You can use the logged-in class added by body_class to target your CSS rules. .container { height: 160px } body.logged-in .container { height: 30px }


1

There's two main ways you can do it. Option 1 is to use a tool like PHPMyAdmin to manually export the data to a .sql file and import it into the new database. Option 2 is to use a plugin like https://github.com/wp-sync-db/wp-sync-db to transfer the data. Note that this plugin is an open source fork of a paid plugin. I linked to the open source version ...


1

The best way to do what you are asking is to perform a data EXPORT on the MySQL database using MySQL Workbench from the original instance of WordPress and then IMPORT the relevant tables into the New instance.. Passwords are all encrypted so these would migrate as was.


0

You can try BP Login Redirect Plugin description: Allows to decide buddypress website admins where their users should land after log in


0

You can use Advanced Access Manager for access control on pages but you need to set which pages give these control. You can also control the comment, read and more. Please check this may help you.


1

I peeked into the WP_User_Query class and it supports a WP_Date_Query query on the user registration date. So we could use: $query = new WP_User_Query( $args ); or simply: $users = get_users( $args ); where: $args = [ 'fields' => 'ID', 'number' => 8, 'date_query' => [ [ 'before' => '359 days ago midnight' ], ...


0

Use $wpdb->get_results("SELECT *, (DATEDIFF(NOW(),user_registered)) AS daydiff FROM {$wpdb->users} WHERE 'daydiff' = 360");


1

First, you should know that current_user_can() only accepts capabilities, not roles, so you are using it wrong and you can end up with unexpected results. That being said, to exlude users form WP_User_Query you can use the exclude parameter: // Get current user data $user = wp_get_current_user(); // Check if current user is a subscriber if( ! empty( $user ...


-1

Following should works for you:- if( current_user_can('read')) { $exclude_user = array(); $exclude_user[] =get_current_user_id(); $args = array( 'role' => 'subscriber', 'exclude' => $exclude_user ); $user_query = new WP_User_Query( $args); foreach ( $user_query->results as $user ) { $mail=$user->user_email; ...



Top 50 recent answers are included