• Hi @greenshady
    Thanks for the great themes.
    I use stargazer and it’s child themes with PHP8.1.
    I noticed that I get many PHP Warnings like the following:
    PHP Warning: compact(): Undefined variable $… in /wp-content/themes/stargazer/library/ext/get-the-image.php on line 298

    After a bit of searching I found the the behavior of the compact() function has changed. Before PHP 7.3, any strings that are not set will silently be skipped. (https://www.php.net/manual/en/function.compact.php).

    Do you have any idea for a workaround, in order to avoid the PHP Warnings?

    Thanks in advance
    Lena

Viewing 1 replies (of 1 total)
  • Thread Starter Lena Stergatou

    (@lenasterg)

    Hi, again.

    I replaced the
    line 298 /wp-content/themes/stargazer/library/ext/get-the-image.php
    from

    $key = md5( serialize( compact( array_keys( $this->args ) ) ) );

    to

    $key = md5( serialize( $this->args ) );

    which fixed the error.

Viewing 1 replies (of 1 total)
  • The topic ‘PHP 8.1 – warnings on get_the_image() function’ is closed to new replies.