Title: Replace `create_function()` with a closure for PHP 7.2 compabitility
Last modified: November 11, 2019

---

# Replace `create_function()` with a closure for PHP 7.2 compabitility

 *  Resolved [lucasbustamante](https://wordpress.org/support/users/lucasbustamante/)
 * (@lucasbustamante)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/replace-create_function-with-a-closure-for-php-7-2-compabitility/)
 * Can you please update the plugin to remove a call to `create_function` on line
   256? It was deprecated on PHP 7.2.0 and I can’t use the plugin: [https://www.php.net/manual/pt_BR/function.create-function.php](https://www.php.net/manual/pt_BR/function.create-function.php)
 * On line 256, replace:
 *     ```
       add_filter('wp_mail_content_type', create_function('', 'return "text/html";'));
       ```
   
 * With:
 *     ```
       add_filter('wp_mail_content_type', function() {
           return "text/html";
       });
       ```
   
 * Since WordPress now requires 5.6 it is completely fine to use Closures.
 * Thanks

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

 *  [Gabriel Berzescu](https://wordpress.org/support/users/gabrielberzescu/)
 * (@gabrielberzescu)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/replace-create_function-with-a-closure-for-php-7-2-compabitility/#post-12121670)
 * Hello [@lucasbustamante](https://wordpress.org/support/users/lucasbustamante/)
 * Thanks for reporting this!
 * The development team is fixing it as we speak and will release an update today.
 * With the best of regards,
    Gabriel
 *  Thread Starter [lucasbustamante](https://wordpress.org/support/users/lucasbustamante/)
 * (@lucasbustamante)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/replace-create_function-with-a-closure-for-php-7-2-compabitility/#post-12121786)
 * That is great to hear, Gabriel! Thanks for being fast
 *  [Gabriel Berzescu](https://wordpress.org/support/users/gabrielberzescu/)
 * (@gabrielberzescu)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/replace-create_function-with-a-closure-for-php-7-2-compabitility/#post-12121943)
 * Glad to help [@lucasbustamante](https://wordpress.org/support/users/lucasbustamante/)

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

The topic ‘Replace `create_function()` with a closure for PHP 7.2 compabitility’
is closed to new replies.

 * ![](https://ps.w.org/passwordless-login/assets/icon-256x256.png?rev=2190567)
 * [Passwordless Login](https://wordpress.org/plugins/passwordless-login/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/passwordless-login/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/passwordless-login/)
 * [Active Topics](https://wordpress.org/support/plugin/passwordless-login/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/passwordless-login/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/passwordless-login/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Gabriel Berzescu](https://wordpress.org/support/users/gabrielberzescu/)
 * Last activity: [6 years, 6 months ago](https://wordpress.org/support/topic/replace-create_function-with-a-closure-for-php-7-2-compabitility/#post-12121943)
 * Status: resolved