Answers for "Deprecated: Function create_function() is deprecated in php 7.4 wordpress"

PHP
3

PHP Deprecated: Function create_function()

//From
create_function( '$caps', "return '$caps';" );

//To
function($caps) {return $caps;}
Posted by: Guest on March-13-2020
1

Function create_function() is deprecated in

//change create_function to anonymous like so:
//change:
$square = create_function('$x', 'return pow($x,2);');
//to:
$square = function($x){
	return pow($x,2);
};
Posted by: Guest on September-29-2020

Code answers related to "Deprecated: Function create_function() is deprecated in php 7.4 wordpress"

Browse Popular Code Answers by Language