Search Results for 'wordpress'
-
Search Results
-
Hi
I have adjusted my registration form to not display the username field. I only want users to be able to login with their email and so the username field is essentially redundant; however it is still required for WordPress/Buddypress.
I have found script to autogenerate a random string which is fine. What I am having trouble with, is how do I intercept the registration, before it actually registers the user so that I can randomly generate the username? I don’t want to insert a randomly generated username into the form and simply hide it, as a savvy user could view the source and change the value of the username field.
Also, is anyone aware of a simple way to check whether the username is available or not? I know that if I use a random string of 10 characters that it is unlikely that it will exist, but it is better to be safe rather than sorry.
Thanks
I’ve been having a problem getting the profile image and cover image to work. When I attempt to crop the image, it give me the “there was an error cropping your profile image” error and doesn’t post.
The site is hosted on a dedicated server.
I have deactivated all plugins except Buddypress and activated the 2015 theme, and it still gives the same error.
PHP version: 5.6
Buddypress version: 2.4.3
Wordpress version: 4.4.1The file I’m trying to uplaod and use is 9.7kb, titled X.png, and 300px by 375px
Any help or advice would be appreciated/
In the past – I’ve used the following code in my functions.php to resolve this issue:
/**BuddyPress**/ add_action( 'wp_enqueue_scripts', 'wpb_adding_scripts' ); remove_action( ‘bp_init’, ‘bp_core_wpsignup_redirect’ ); remove_action( ‘bp_screens’, ‘bp_core_screen_signup’ );I’ve also tried following the advice in this thread, with no luck.
https://buddypress.org/support/topic/use-standard-wordpress-registration/The only changes i’ve made since implimenting the above fix was to make updates to wordpress and my plugins. I suspect, the buddypress plugin update in particular to be the cause here but I cannot be sure. I’ve spent several hours trying to troubleshoot this and i’m about ready to pull my hair out here… Any advice / help would be greatly appreciated.
Helpful information:
- Site is a subdomain
- was using the wordpress registration page in earlier versions of (wordpress/buddypress) just fine.
- tried disabling/updating all plugins
- Tried googling the issue already – no luck
- the code in functions.php was added under the child theme, so updates would not over-write it
I have a custom registration form that tweaked the registration.php template to include a couple additional inputs. The form works as expected, being processed through the buddypress channels
bp_core_screen_signup()Then I hook into the bp_core_signup_user like so:
# Capture registration form's metadata fields add_action('bp_core_signup_user', array( $this, 'add_registration_metadata' ),10 ,1);Through my custom add_registration_metadata() method I store the $_POST meta to the user_id like so:
public function add_registration_metadata($user_id){ $type = isset($_POST['team_type']) ? $_POST['team_type'] : FALSE; if ($type){ # Make sure that the post value matches the available options if (($type == "type1") || ($type == "type2")) # Save the value as user meta add_user_meta( $user_id, 'team_type', $type); } /* Save username to metadata */ $username = isset($_POST['signup_username']) ? $_POST['signup_username'] : FALSE; /* Save first name to metadata */ $fname = isset($_POST['signup_fname']) ? $_POST['signup_fname'] : FALSE; /* Save last name to metadata */ $lname = isset($_POST['signup_lname']) ? $_POST['signup_lname'] : FALSE; /* Update WordPress Details */ $userdata = array ( 'ID' => $user_id, 'first_name' => $fname, 'last_name' => $lname, 'nickname' => $username, 'user_nicename' => DIV_Helper::slugify($username) ); wp_update_user( $userdata ); }As expected all the values are set in the usermeta table. I would think this is all that is left to do but its not and there is some confusion as to what is happening next.
So now the user attempts to activate their account through their email obviously passing the activation key. This works! BUT my metadata values are gone. For some reason BuddyPress wipes the values stored in the usermeta table. So then I try to hook into the bp_core_activate_signup like so:
add_action('bp_core_activated_user', array( $this, 'setup_registration_metadata') );This custom method attempts to re-update the user information but for some reason no combination seems to work, here’s what I have at the moment:
public function setup_registration_metadata($user){ if (! empty( $user ) ) { if ( is_array( $user ) ) { $user_id = $user['user_id']; } else { $user_id = $user; } if ( ! empty( $user_id ) ) { $usermeta = get_user_meta($user_id); // This doesn't seem to work as expected $type = $usermeta['team_type']; // But this does... $type = get_user_meta($user_id, 'team_type' TRUE); # Make sure the value matches the available options if (($type == "type1") || ($type == "type2")) # Set the member type bp_set_member_type($user_id, $type); # Setup username $username = $usermeta['username'][0]; # Setup first name $fname = $usermeta['first_name'][0]; # Setup last name $lname = $usermeta['last_name'][0]; /* Update WordPress Details */ $userdata = array ( 'ID' => $user_id, 'first_name' => $fname, 'last_name' => $lname, 'nickname' => $username, 'user_nicename' => DIV_Helper::slugify($username) ); wp_update_user( $userdata ); ... }Any clues as to how I can update the first & last names (not using some xprofile field that redundantly stores the same information), as well as any other custom fields I may add in the future. It’s seems I’m on the right track, this just is working right now.
Thank youl
Topic: Theme Incompatible?
WordPress Version: 4.4.1
BuddyPress Version: 2.4.3.
Site link: still building it offlineFor the website I’m working on I’ve chosen to go with WooThemes Canvas. It has turned out that some features of BuddyPress don’t work with the theme, but I do not know why. As I’m not familiar with coding, I’ll try to explain as good as possible.
Problem: in the BuddyPress group forums the forum title and topic title aren’t displayed. The links itself are there, but the text isn’t rendered. When inspecting in Chrome I can see the link is there, but the topic title between the<a>tags isn’t there.
What I assume is this line of code in loop-single-topic.php<a class="bbp-topic-permalink" href="<?php bbp_topic_permalink(); ?>"><?php bbp_topic_title(); ?></a>
shows as:<a class="bbp-topic-permalink" href="http://mysite.com/community/groups/admins/forum/topic/instructions/"></a>When I switch to one of the default WordPress theme it shows just fine.
I can add that another plugin (MyCred) that is supposed to show additional information in the BuddyPress profile header doesn’t perform what it’s supposed to do. Again when switching to a default theme it works.
Is the theme just incompatible and that’s that? Or are there steps I can take to get to the bottom of the issue?