Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
12/13/2017 01:13:51 AM (4 years ago)
Author:
boonebgorges
Message:

Remove calls to create_function().

create_function() is deprecated in PHP 7.2.

See #7634.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-members/bp-members-screens.php

    r11766 r11773  
    184184        if ( !empty( $bp->signup->errors ) ) {
    185185            foreach ( (array) $bp->signup->errors as $fieldname => $error_message ) {
    186                 /*
    187                  * The addslashes() and stripslashes() used to avoid create_function()
    188                  * syntax errors when the $error_message contains quotes.
    189                  */
    190 
    191186                /**
    192187                 * Filters the error message in the loop.
     
    196191                 * @param string $value Error message wrapped in html.
    197192                 */
    198                 add_action( 'bp_' . $fieldname . '_errors', create_function( '', 'echo apply_filters(\'bp_members_signup_error_message\', "<div class=\"error\">" . stripslashes( \'' . addslashes( $error_message ) . '\' ) . "</div>" );' ) );
     193                add_action( 'bp_' . $fieldname . '_errors', function() use ( $error_message ) {
     194                    echo apply_filters( 'bp_members_signup_error_message', "<div class=\"error\">" . $error_message . "</div>" );
     195                } );
    199196            }
    200197        } else {
Note: See TracChangeset for help on using the changeset viewer.