WordPress.org

Forums

Error with "wp_widget_description()" (2 posts)

  1. niklas-schroder
    Member
    Posted 6 years ago #

    When I try to view my widgets (after upgrading), I get this...

    "Fatal error: Call to undefined function: wp_widget_description() in /home/www/paperclipsandscrambledeggs.com/blog/wp-admin/includes/widgets.php on line 127"

    Help?

  2. benjaminjackson
    Member
    Posted 6 years ago #

    Looks like the WP team left that function out of widgets.php in the version I downloaded as well. Add this code at the top widgets.php, it worked for me:

    function wp_widget_description( $id ) {
      if ( !is_scalar($id) )
        return; 
    
      global $wp_registered_widgets; 
    
      if ( isset($wp_registered_widgets[$id]['description']) )
        return wp_specialchars( $wp_registered_widgets[$id]['description'] );
    }

Topic Closed

This topic has been closed to new replies.

About this Topic