Woo-poly-integration: Function create_function() is deprecated in PHP 7.2

Created on 7 Mar 2018  ·  4Comments  ·  Source: hyyan/woo-poly-integration

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.

bug

Most helpful comment

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

All 4 comments

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

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

@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.

Fixed via b32ee97f36d0a66164c362a7b40b8c21dc0fd73f

Was this page helpful?
0 / 5 - 0 ratings

Related issues

theblackhole picture theblackhole  ·  4Comments

vasildervenski picture vasildervenski  ·  19Comments

ngrudev picture ngrudev  ·  6Comments

dmytro-kindrat picture dmytro-kindrat  ·  14Comments

hyyan picture hyyan  ·  13Comments