0

After installing PHP 7.2.10, the following error appeared:

PHP Error Backtrace Backtrace from warning 'Function create_function() is deprecated' at /var/www/site/data/www/site.org/wp-config.php 110:
/var/www/site/data/www/site.org/wp-load.php 37 calling require_once()
/var/www/site/data/www/site.org/wp-admin/admin.php 31 calling require_once()
/var/www/site/data/www/site.org/wp-admin/post.php 12 calling require_once()

Total PHP Notices: 1 NOTICE: wp-config.php:110 - Function create_function() is deprecated

How can this problem be solved?

Perhaps this is due to the fact that create_function deprecated in php 7.2

Here is what I found in my topic:

public function __construct() {
        $this->print_meta_box_content_callback = create_function( '$post,$args', 'echo $args["args"];' );
    }

How do I fix my code so that it does not conflict with 7.2.0?

Thanks for your help

  • 3
    Please take a look here and here PHP-Net – Charles Dec 31 '18 at 18:19
  • Thanks. that's what i found. Tell me, how can I fix this? public function __construct() { $this->print_meta_box_content_callback = create_function( '$post,$args', 'echo $args["args"];' ); – Marat Petrov Dec 31 '18 at 18:46
  • 3
  • Did you read the answer in Charles' first link? – Jacob Peattie Jan 1 at 1:54
  • 1
    @MaratPetrov $this->print_meta_box_content_callback = function( $post, $args ){ echo $args['args']; }; – Sally CJ Jan 3 at 0:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.