Skip to:
Content

BuddyPress.org

Ticket #8449: 8449.patch

File 8449.patch, 1.4 KB (added by imath, 2 years ago)
  • src/bp-members/screens/register.php

    diff --git src/bp-members/screens/register.php src/bp-members/screens/register.php
    index f954f3f41..54b6facd5 100644
    function bp_core_screen_signup() { 
    155155                                 * Filters the error message in the loop.
    156156                                 *
    157157                                 * @since 1.5.0
     158                                 * @since 8.0.0 Adds the `$fieldname` parameter to the anonymous function.
    158159                                 *
    159                                  * @param string $value Error message wrapped in html.
     160                                 * @param string $value     Error message wrapped in html.
     161                                 * @param string $fieldname The name of the signup field.
    160162                                 */
    161                                 add_action( 'bp_' . $fieldname . '_errors', function() use ( $error_message ) {
    162                                         echo apply_filters( 'bp_members_signup_error_message', "<div class=\"error\">" . $error_message . "</div>" );
     163                                add_action( 'bp_' . $fieldname . '_errors', function() use ( $error_message, $fieldname ) {
     164                                        /**
     165                                         * Filter here to edit the error message about the invalid field value.
     166                                         *
     167                                         * @since 1.5.0
     168                                         * @since 8.0.0 Adds the `$fieldname` parameter.
     169                                         *
     170                                         * @param string $value     Error message wrapped in html.
     171                                         * @param string $fieldname The name of the signup field.
     172                                         */
     173                                        echo apply_filters( 'bp_members_signup_error_message', "<div class=\"error\">" . $error_message . "</div>", $fieldname );
    163174                                } );
    164175                        }
    165176                } else {