• Resolved hupe13

    (@hupe13)


    I get a warning in php 8.1 and the code snippet is automatically deactivated sometimes:

    PHP Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /wp-content/plugins/insert-headers-and-footers/includes/class-wpcode-snippet-execute.php(277) : eval()’d code(5) : eval()’d code on line 2

    I’m using this solution, to disable this. Can you please fix it? Thank you very much.

    • This topic was modified 1 year, 2 months ago by hupe13.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Mircea Sandu

    (@gripgrip)

    Hi @hupe13,

    From the error log entry you shared that warning is caused by the code in one of your snippets.

    I suggest searching for preg_replace in your snippets and making sure your code follows the PHP 8.1 structure mentioned in the warning. You can also use the steps in this article to debug: https://wpcode.com/docs/how-to-debug-php-errors-in-wpcode/

    Thread Starter hupe13

    (@hupe13)

    You are right, it was my mistake. But it was a warning only. Can you deactivate the snippets on error only, but not on warnings?

    Thank you very much.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘php 8.1’ is closed to new replies.