问题
I saw people helping on rewriting to anonymous function. But I really don't know how:
Deprecated: Function create_function() is deprecated in /mnt/web110/c3/68/51799968/htdocs/portfolio2017/wp-content/themes/clean-photo-wp-modified/internal/includes.php on line 149
Method:
/**
* Safe file inclusion
*
* @param $path
*/
public static function include_isolated( $path ) {
if ( ! self::$include_isolated_callable ) {
self::$include_isolated_callable = create_function( '$path', 'include $path;' );
}
call_user_func( self::$include_isolated_callable, $path );
}
回答1:
self::$include_isolated_callable = function($path) { include $path; };
http://php.net/manual/en/functions.anonymous.php
来源:https://stackoverflow.com/questions/54189121/how-to-fix-create-function-when-swapping-to-php-7-2