Skip to content
This repository has been archived by the owner on Mar 17, 2022. It is now read-only.

Function create_function() is deprecated in PHP 7.2 #311

Closed
mrleemon opened this issue Mar 7, 2018 · 4 comments
Closed

Function create_function() is deprecated in PHP 7.2 #311

mrleemon opened this issue Mar 7, 2018 · 4 comments
Assignees
Labels

Comments

@mrleemon
Copy link
Contributor

mrleemon commented Mar 7, 2018

Can you reproduce this issue on default Wordpress theme (eg Storefront)?

Yes

Can you reproduce this issue when all other plugins are disabled except WooCommerce, Polylang and Hyyan WooCommerce Polylang Integration?

Yes

What product versions and settings are you using when this issue occurs?

  • PHP: 7.2
  • WordPress: 4.9.4
  • WooCommerce: 3.3.3
  • Polylang: 2.3.2
  • Hyyan WooCommerce Polylang Integration: 1.0.4
  • Browser: Firefox 58

Steps to Reproduce

  1. Go to any WP admin page

What I Expected

No errors

What Happened Instead

The following error is displayed:

Deprecated: Function create_function() is deprecated in /home/litoffde/public_html/wp-content/plugins/woo-poly-integration/vendor/class.settings-api.php on line 108
Line 108 is:

$callback = create_function('', 'echo "' . str_replace( '"', '\"', $section['desc'] ) . '";');

The create_function is deprecated in PHP 7.2, so it must be changed for a similar alternative

WordPress Environment

``` Copy and paste the system status report from **WooCommerce > System Status** in WordPress admin here. ```
@hyyan
Copy link
Owner

hyyan commented Mar 7, 2018

Hmmm, This is a problem related to woopoly dependency tareq1988/wordpress-settings-api-class
It would be better to replace this with an anonymous function. I will fix this later this week and see if it is related to #310

@hyyan hyyan self-assigned this Mar 7, 2018
@hyyan hyyan added the bug label Mar 7, 2018
@ahmedofali
Copy link
Contributor

I have submitted a pull request that Resolves this issue tareq1988/wordpress-settings-api-class#100 waiting to be merged and added to the next release

@Jon007
Copy link
Contributor

Jon007 commented May 5, 2018

@hyyan It looks like @ahmedofali pull request has been merged into master now
Beginning woocommerce 3.4, the recommended PHP version for WooCommerce is 7.2.

@hyyan
Copy link
Owner

hyyan commented May 7, 2018

Fixed via b32ee97

@hyyan hyyan closed this as completed May 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants