How to modify an add_action() inside a loop of core function

Use the filter hook bp_members_signup_error_message Try: function signup_error_change( $error_message ) { $error_message = str_replace(‘<div class=”error”>’, ‘<span class=”val-error”>’, $error_message); $error_message = str_replace(‘</div>’, ‘</span>’, $error_message); return $error_message; } add_filter(‘bp_members_signup_error_message’, ‘signup_error_change’, 1, 1);

How to delete user roles?

$wp_roles = new WP_Roles(); // create new role object $wp_roles->remove_role(‘name_of_role’); If you need to check the name_of_role use $wp_roles->get_names(); you will get an array of name_of_role => Nicename of Role Alternatively, you could use the global object $wp_roles global $wp_roles;

BuddyPress Xprofile check if user can view field [closed]

I found the answer to this question with support from the members from the BuddyPress forum. The function that I needed was xprofile_get_field_data(). Here my code: <?php $hidden_fields = bp_xprofile_get_hidden_fields_for_user(); ?> <?php if(xprofile_get_field_data(‘field_name’) && !in_array(xprofile_get_field_id_from_name(‘field_name’), $hidden_fields)) : ?> <p><?php echo xprofile_get_field_data (‘field_name’); ?></p> <?php endif; ?>

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)