Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help on depreciated statement. 2

Status
Not open for further replies.

Swi

Programmer
Feb 4, 2002
1,965
US
Anyone know how to resolve this error?

Code:
$galleryID = preg_replace("/[^0-9]/","",$attr['ids'])

I get this error.

Deprecated: Function create_function() is deprecated in /xxxx/wp-content/themes/hively/library/WPPostScript/Content/MediaGallery.php on line 28

Swi
 
Another example:

Code:
echo '<a href="tel:' . preg_replace("/[^0-9]/","",$organization->properties["contact"]["phone"]) . '">' . $organization->properties["contact"]["phone"] . '</a>';

Swi
 
Hi

In addition to spamjim's suggestions, there is a dirty one : exclude [tt]E_DEPRECATED[/tt] from [tt]error_reporting[/tt].
Code:
[blue]bash-5.0$[/blue] php7.1 -d error_reporting='E_ALL' -r 'var_dump(create_function("",""));'
string(9) "\000lambda_1"

[blue]bash-5.0$[/blue] php7.2 -d error_reporting='E_ALL' -r 'var_dump(create_function("",""));'
PHP Deprecated:  Function create_function() is deprecated in Command line code on line 1
PHP Stack trace:
PHP   1. {main}() Command line code:0
string(9) "\000lambda_1"

[blue]bash-5.0$[/blue] php7.2 -d error_reporting='E_ALL [highlight]& ~E_DEPRECATED[/highlight]' -r 'var_dump(create_function("",""));'
string(9) "\000lambda_1"


Feherke.
feherke.github.io
 
Thanks to you both. Not a fan of downgrading so I guess clean it up or ignore the error. I inherited this 6 year old website. Looks like the theme needs an overhaul.

Swi
 
Being WordPress, you might simply resolve it by updating the core and the plugins.
 
Seems to be theme related. All plugins and WP core are up-to-date. The theme is littered with depreciated PHP. It is a custom theme someone write I assume... :-(

Swi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top