Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

suppress deprecated warning on php 8.2.0 because $post_id is null on 404 pages #87

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

oguilleux
Copy link

This pull request fixes issue regarding deprecated warnings for php 8 because $post_id is passed null in str_replace and preg_replace.

It will apply the following changes :

  • make sure $post_id is always defined in Helpers/original_option_id method
  • make sure $post_id is always defined in Main/get_default_reference method

@oguilleux oguilleux changed the title suppress deprecated warning on php 8.2.0 because $post is null on 404 pages suppress deprecated warning on php 8.2.0 because $post_id is null on 404 pages Oct 20, 2023
@mikkosiikaniemi
Copy link

We are seeing similar PHP deprecated warnings appearing after upgrading from PHP 7.4 to PHP 8.1. Suggesting merging this pull request.

Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /wp-content/plugins/acf-options-for-polylang/classes/helpers.php on line 38

Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /wp-content/plugins/acf-options-for-polylang/classes/main.php on line 58

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants