• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Uncaught Error in widget

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › General Genesis Framework Discussions › Uncaught Error in widget

This topic is: resolved

Tagged: breaking-news-widget

  • This topic has 2 replies, 2 voices, and was last updated 4 months, 2 weeks ago by ErikN.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • November 3, 2022 at 12:39 am #506108
    ErikN
    Participant

    The Daily News theme breaking-news-widget generates an error on Line 12:
    add_action( 'widgets_init', create_function( '', "register_widget('Breaking_News');" ) );
    this is the error
    Uncaught Error: Call to undefined function create_function() in /var/www/vhosts/domain.xx/httpdocs/wp-content/themes/daily-news/lib/widgets/breaking-news-widget.php:12

    Has anyone else seen this and is there a solution for this?

    WordPress versie 6.1
    Actief thema: Daily News (versie 1.7.1)
    PHP versie 8.0.20

    November 5, 2022 at 2:15 pm #506133
    Victor Font
    Moderator

    create_function() was deprecated in PHP 7.2. It has since been removed from PHP. To fix, you have to create your own function to be used as a callback in the widgets_init action like this:

    add_action( 'widgets_init', 'register_my_function' );
    function register_my_function() {
    register_widget('Breaking_News');
    }


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    November 7, 2022 at 11:03 am #506138
    ErikN
    Participant

    Thaks you I will try that
    I guess its not a well maintained child theme

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Log In

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble