Skip to:
Content

bbPress.org


Ignore:
Timestamp:
08/03/2020 01:33:59 PM (4 months ago)
Author:
xknown
Message:

PHP 7.4 Compat: Remove the create_function calls.

They are deprecated, and they seem to be removed in PHP 8.0.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.1/bb-admin/includes/functions.bb-admin.php

    r6170 r7111  
    3838
    3939    $message = '<div id="message" class="' . esc_attr( $class ) . '">' . $message . '</div>';
    40     $message = str_replace( "'", "\'", $message );
    41     $lambda = create_function( '', "echo '$message';" );
     40    $lambda = function() use( $message ) { echo $message; };
    4241    add_action( 'bb_admin_notices', $lambda );
    4342    return $lambda;
     
    153152
    154153                // Get an array of all plugin added keys
    155                 $plugin_menu_keys = array_filter( $menu_keys, create_function( '$v', 'if ($v >= ' . $lower . ' && $v < ' . $upper . ') { return $v; }' ) );
     154                $plugin_menu_keys = array_filter( $menu_keys, function( $v ) use ( $lower, $upper ) { if ( $v >= $lower && $v < $upper ) { return $v; } } );
    156155
    157156                // If there is an array of keys
Note: See TracChangeset for help on using the changeset viewer.