Title: php7.2 Deprecated: Function create_function() is deprecated
Last modified: June 13, 2018

---

# php7.2 Deprecated: Function create_function() is deprecated

 *  [No3x](https://wordpress.org/support/users/no3x/)
 * (@no3x)
 * [7 years, 12 months ago](https://wordpress.org/support/topic/php7-2-deprecated-function-create_function-is-deprecated/)
 * I just migrated php to 7.2 and reviewing all installed plugins. I do have problems
   with your plugin:
    `Deprecated: Function create_function() is deprecated in disable-
   user-gravatar/disable-user-gravatar.php on line 35` `add_filter('user_profile_picture_description',
   create_function('$desc', 'return "";'));` This should be really easy to fix by
   using an anonymous function or a utility function of WordPress: `add_filter('
   user_profile_picture_description', '__return_empty_string' );` I have tested 
   this by modifying the filter to always return “Hello World”. After this I verified
   the behaviour by looking under a profile picture and “Hello World” was printed.
   Then I applied my Patch to use `'__return_empty_string'`. After this there is
   no output there.
 * 1. I’m not sure if `__return_empty_string` is appropriate because of the parameters.
   But I don’t get an error complaining about missing parameters of `__return_empty_string`.
   
   2. According to the [user_profile_picture_description hook](https://developer.wordpress.org/reference/hooks/user_profile_picture_description/)
   there is a second parameter `$profileuser` since WordPress 4.7.0. This one is
   missing in your current implementation by the way.
 * **Target WordPress version:** since this fix uses`__return_empty_string` which
   was introduced in 3.7.0 the target version might increase. If this is not acceptable
   just use a anonymous function.
 * Please note: you use `__return_true` which was introduced in 3.0.0. But the plugin
   min version is 2.7.0. Please increase to at least 3.0.0.
    -  This topic was modified 7 years, 12 months ago by [No3x](https://wordpress.org/support/users/no3x/).
      Reason: added code tags
    -  This topic was modified 7 years, 12 months ago by [No3x](https://wordpress.org/support/users/no3x/).
      Reason: added one more code tag
    -  This topic was modified 7 years, 12 months ago by [No3x](https://wordpress.org/support/users/no3x/).
      Reason: fixed grammar
    -  This topic was modified 7 years, 12 months ago by [No3x](https://wordpress.org/support/users/no3x/).

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Marcus (aka @msykes)](https://wordpress.org/support/users/netweblogic/)
 * (@netweblogic)
 * [7 years, 12 months ago](https://wordpress.org/support/topic/php7-2-deprecated-function-create_function-is-deprecated/#post-10400425)
 * Hi,
 * Thanks for your suggestion.
 * __return_empty_string is exactly what I’ll be adding, I’ve got that patch locally
   and have been meaning to update but short on time.
 * I hadn’t thought of the target version, but yes good point. I think frankly 4.0
   could even be the minimum, that’s already quite old 🙂
 *  Thread Starter [No3x](https://wordpress.org/support/users/no3x/)
 * (@no3x)
 * [7 years, 12 months ago](https://wordpress.org/support/topic/php7-2-deprecated-function-create_function-is-deprecated/#post-10402402)
 * Hopefully nobody uses such an old WordPress version. If you increase to 4.0 then
   you should also replace the deprecated (in version 3.3.0) `get_user_by_email(
   $id_or_email)` by `get_user_by('email', $id_or_email);`.
 * I’m looking forward to your new release.
    -  This reply was modified 7 years, 12 months ago by [No3x](https://wordpress.org/support/users/no3x/).
 *  Plugin Author [Marcus (aka @msykes)](https://wordpress.org/support/users/netweblogic/)
 * (@netweblogic)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/php7-2-deprecated-function-create_function-is-deprecated/#post-10403296)
 * noted, thanks!
 *  [websupporter](https://wordpress.org/support/users/websupporter/)
 * (@websupporter)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/php7-2-deprecated-function-create_function-is-deprecated/#post-10894619)
 * +1
 * would love to see this as well 🙂
 * thanks for the plugin.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘php7.2 Deprecated: Function create_function() is deprecated’ is closed
to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/disable-user-gravatar.svg)
 * [Disable User Gravatar](https://wordpress.org/plugins/disable-user-gravatar/)
 * [Support Threads](https://wordpress.org/support/plugin/disable-user-gravatar/)
 * [Active Topics](https://wordpress.org/support/plugin/disable-user-gravatar/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/disable-user-gravatar/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/disable-user-gravatar/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [websupporter](https://wordpress.org/support/users/websupporter/)
 * Last activity: [7 years, 6 months ago](https://wordpress.org/support/topic/php7-2-deprecated-function-create_function-is-deprecated/#post-10894619)
 * Status: not resolved