• Just a friendly reminder to the developers of this cool plugin that you guys still have a pending pull request on GitHub which has been ‘sleeping’ over there since May 2020; this hasn’t made into the WordPress plugin repository yet, even though it seems to have been ‘fixed’ on GitHub.

    It’s now January 2021, PHP 8.0, and the dangerous, vulnerability-prone create_function() has been removed — not merely deprecated — and now throws a Fatal Error.

    For those having found this issue via Google, and assuming it hasn’t been fixed yet, do the following: Open the plugin’s addons/auto-pagination/auto-pagination-functions.php file, go to line 29 and replace
    add_filter('generate_pagination', create_function('$output,$page,$pages,$args', 'return $output;'), 10, 4);
    with
    add_filter( 'generate_pagination', function( $output, $page, $pages, $args ) { return $output; }, 10, 4 );
    It’s that simple to get WPP: PLP working again.

    While you’re at it, to make it future-proof, on the same file, go to line 64 (66 if you have upgraded to the version on GitHub), and replace
    if (!$post->post_content || $post->post_content == '')
    with
    if (empty($post) || empty($post->post_content))
    PHP 8.0 will throw a warning with the above line when $post is null, complaining with: Attempt to read property "post_content" on null. There are a few alternative possible ‘fixes’, but I’m a fan of empty() since it does a lot of stuff ‘in the background’…

Viewing 2 replies - 1 through 2 (of 2 total)
  • Re: PHP 8.0 Issue
    After install from Dreamhost,this is showing on my pages on the website..All help is appreciated…

    Deprecated: Required parameter $sub_selector follows optional parameter $ri in /home/natmil23/njadvertising.net/wp-content/plugins/siteorigin-panels/inc/css-builder.php on line 157

    Thread Starter Gwyneth Llewelyn

    (@gwynethllewelyn)

    @natemex if you look closely, that error comes from a different plugin, Page Builder

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘PHP 8.0 issue: deprecated create_function() throws Fatal error’ is closed to new replies.