Support » Plugin: WP-Memory-Usage » Fix error `Function create_function() is deprecated `with PHP 7.2

  • Replace these two lines

    	// Start this plugin once all other plugins are fully loaded
    	add_action( 'plugins_loaded', create_function('', '$memory = new wp_memory_usage();') );

    with

    	// Start this plugin once all other plugins are fully loaded
    	//add_action( 'plugins_loaded', create_function('', '$memory = new wp_memory_usage();') );
    	add_action( 'plugins_loaded', function () { return $memory = new wp_memory_usage();}, 10);
  • The topic ‘Fix error `Function create_function() is deprecated `with PHP 7.2’ is closed to new replies.