Title: Deprecated in PHP 7.2: Function create_function() is deprecated
Last modified: November 26, 2018

---

# Deprecated in PHP 7.2: Function create_function() is deprecated

 *  Resolved [monkeystyping](https://wordpress.org/support/users/monkeystyping/)
 * (@monkeystyping)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/deprecated-in-php-7-2-function-create_function-is-deprecated/)
 * 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](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)

 *  Plugin Author [Jordy Meow](https://wordpress.org/support/users/tigroumeow/)
 * (@tigroumeow)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/deprecated-in-php-7-2-function-create_function-is-deprecated/#post-10938488)
 * Hi,
 * Please have a look here:
    [https://github.com/jordymeow/wp-category-permalink/issues/2](https://github.com/jordymeow/wp-category-permalink/issues/2)
 * Thanks 🙂
 *  Plugin Author [Jordy Meow](https://wordpress.org/support/users/tigroumeow/)
 * (@tigroumeow)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/deprecated-in-php-7-2-function-create_function-is-deprecated/#post-10951752)
 * Hello [@monkeystyping](https://wordpress.org/support/users/monkeystyping/),
 * This has been fixed on the WordPress repository, so you can update it naturally
   and it should work.

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.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-category-permalink_161616.svg)
 * [WP Category Permalink](https://wordpress.org/plugins/wp-category-permalink/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-category-permalink/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-category-permalink/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-category-permalink/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-category-permalink/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-category-permalink/reviews/)

## Tags

 * [deprecated](https://wordpress.org/support/topic-tag/deprecated/)
 * [php72](https://wordpress.org/support/topic-tag/php72/)

 * 2 replies
 * 2 participants
 * Last reply from: [Jordy Meow](https://wordpress.org/support/users/tigroumeow/)
 * Last activity: [7 years, 5 months ago](https://wordpress.org/support/topic/deprecated-in-php-7-2-function-create_function-is-deprecated/#post-10951752)
 * Status: resolved