Support » Plugin: Search Everything » PHP Deprecated: Function create_function() is deprecated in…

  • PHP Deprecated: Function create_function() is deprecated in /.../public_html/wp-content/plugins/search-everything/search-everything.php on line 236

    Will the plugin be updated anytime this year?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Tested my website with PHP 7.2 and also saw the same issue. This function is used in one place:

    search-everything.php > line 236

    
    $search_terms = array_filter(array_map( create_function( '$a', 'return trim($a, "\\"\'\\n\\r ");' ), $matches[0] ));
    

    Perhaps use an anonymous function?

    • This reply was modified 8 months, 3 weeks ago by Preliot.
    • This reply was modified 8 months, 3 weeks ago by Preliot.

    Fix (on your own risk). If you see an error, please comment here:

    //$search_terms = array_filter(array_map( create_function( '$a', 'return trim($a, "\\"\'\\n\\r ");' ), $matches[0] ));
    
    //Custom improvement
    $search_terms = array_filter(array_map( function($a) 
    {
        return trim($a, "\"'\n\r "); 
    }, $matches[0] ));

    Works for me! Thanks for the tip

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.