Title: PHP Deprecated: Function create_function()
Last modified: July 11, 2018

---

# PHP Deprecated: Function create_function()

 *  Resolved [wp_kc](https://wordpress.org/support/users/wp_kc/)
 * (@wp_kc)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/php-deprecated-function-create_function/)
 * I was installing your most excellent plug-in on a web site yesterday and found
   these entries in the debug log…
 *     ```
       [11-Jul-2018 16:47:30 UTC] PHP Deprecated:  Function create_function() is deprecated in /wp-content/plugins/juiz-social-post-sharer/admin/jsps-admin.inc.php on line 192
       [11-Jul-2018 16:47:30 UTC] PHP Deprecated:  Function create_function() is deprecated in /wp-content/plugins/juiz-social-post-sharer/admin/jsps-admin.inc.php on line 195
       [11-Jul-2018 16:47:30 UTC] PHP Deprecated:  Function create_function() is deprecated in /wp-content/plugins/juiz-social-post-sharer/admin/jsps-admin.inc.php on line 201
       [11-Jul-2018 16:47:30 UTC] PHP Deprecated:  Function create_function() is deprecated in /wp-content/plugins/juiz-social-post-sharer/admin/jsps-admin.inc.php on line 211
       ```
   
 * I looked at those line numbers and saw code like this…
    `add_settings_field( '
   juiz_sps_temp_submit', get_submit_button( __( 'Save Changes' ), 'secondary' ),
   create_function( '', 'return "";' ), JUIZ_SPS_SLUG, 'juiz_sps_plugin_main' );`
 * The web site is running on PHP7.2, and [the php.net documentation](https://secure.php.net/manual/en/function.create-function.php)
   does say this function is depreciated.
 * To future proof these lines of code, you should probably replace **create_function(”,‘
   return “”;’ )** with the WordPress defined function **__return_empty_string()**.
   So the example line of code above would become…
 * `add_settings_field( 'juiz_sps_temp_submit', get_submit_button( __( 'Save Changes'),'
   secondary' ), '__return_empty_string', JUIZ_SPS_SLUG, 'juiz_sps_plugin_main' );`
 * Thanks again for your work on this great plugin.

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

 * ![](https://ps.w.org/juiz-social-post-sharer/assets/icon-256x256.png?rev=3389742)
 * [Nobs • Share Buttons](https://wordpress.org/plugins/juiz-social-post-sharer/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/juiz-social-post-sharer/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/juiz-social-post-sharer/)
 * [Active Topics](https://wordpress.org/support/plugin/juiz-social-post-sharer/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/juiz-social-post-sharer/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/juiz-social-post-sharer/reviews/)

## Tags

 * [create_function](https://wordpress.org/support/topic-tag/create_function/)
 * [PHP 7.2](https://wordpress.org/support/topic-tag/php-7-2/)
 * [PHP Deprecated](https://wordpress.org/support/topic-tag/php-deprecated/)

 * 0 replies
 * 1 participant
 * Last reply from: [wp_kc](https://wordpress.org/support/users/wp_kc/)
 * Last activity: [7 years, 10 months ago](https://wordpress.org/support/topic/php-deprecated-function-create_function/)
 * Status: resolved