• Resolved monkeystyping

    (@monkeystyping)


    I’m just started to test one my sites in PHP 7.2, and use your plugin. I’m getting a “deprecated” message.

    Deprecated: Function create_function() is deprecated in /Users/myusername/Sites/bbbbb.test/web/wp-content/plugins/wp-category-permalink/wpcp_post.php on line 160

    … which is this line of code:
    $taxa = array_filter( $taxa, create_function( '$a', 'return !!$a->rewrite;' ) );

    I did a bit of Googling, and came up with this as a potential fix from a StackOverflow article:
    $taxa = array_filter( $taxa, function( $a ) { return !!$a->rewrite; } );

    (See https://stackoverflow.com/questions/48161526/php-7-2-function-create-function-is-deprecated)

    However, I’m not an expert PHP programmer, and am not sure this bit of interpreted code is really doing what you are looking to do.

    Can you update this plugin for PHP 7.2?

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Deprecated in PHP 7.2: Function create_function() is deprecated’ is closed to new replies.