Title: Fix for create_function deprecated in PHP 7.2
Last modified: December 7, 2019

---

# Fix for create_function deprecated in PHP 7.2

 *  Resolved [KTS915](https://wordpress.org/support/users/kts915/)
 * (@kts915)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/fix-for-create_function-deprecated-in-php-7-2-2/)
 * A couple of lines in `ultimate-posts-widget.php` need to be changed to use anonymous
   functions.
 * So line 154 should go from this:
    `$new_excerpt_more = create_function('$more','
   return "...";');` to this:
 *     ```
       $new_excerpt_more = function($more) {
            return '...';
       };
       ```
   
 * And line 158 should go from this:
    `$new_excerpt_length = create_function('$length',"
   return " . $excerpt_length . ";");` to this:
 *     ```
       $new_excerpt_length = function($length) {
           return ' . $excerpt_length . ';
       };
       ```
   

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

 *  Plugin Author [cl272](https://wordpress.org/support/users/cl272/)
 * (@cl272)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/fix-for-create_function-deprecated-in-php-7-2-2/#post-12219204)
 * Thank you for reporting this, we just fixed it in the plugin version we just 
   uploaded.
 *  Thread Starter [KTS915](https://wordpress.org/support/users/kts915/)
 * (@kts915)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/fix-for-create_function-deprecated-in-php-7-2-2/#post-12221630)
 * Thank you — and thank you for the plugin!

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

The topic ‘Fix for create_function deprecated in PHP 7.2’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/ultimate-posts-widget_5b9f2b.svg)
 * [Ultimate Posts Widget](https://wordpress.org/plugins/ultimate-posts-widget/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ultimate-posts-widget/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ultimate-posts-widget/)
 * [Active Topics](https://wordpress.org/support/plugin/ultimate-posts-widget/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ultimate-posts-widget/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ultimate-posts-widget/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [KTS915](https://wordpress.org/support/users/kts915/)
 * Last activity: [6 years, 6 months ago](https://wordpress.org/support/topic/fix-for-create_function-deprecated-in-php-7-2-2/#post-12221630)
 * Status: resolved