WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] register_widget_control is deprecated since version 2.8 (3 posts)

  1. grayghostvisuals
    Member
    Posted 1 year ago #

    Currently receiving this error debugging with define('WP_DEBUG', true);

    Notice: register_widget_control is deprecated since version 2.8! Use wp_register_widget_control() instead. in wordpress/wp-includes/functions.php on line 2638

    How I'm handling widgets currently from my functions.php file

    //theme-name widget setup
    function grayghostvisuals_widget(){
        //call register_sidebar wp method as array
        register_sidebar( array(
            'ID'            => 'main-widgets',
            'name'          => 'main',
            'before_widget' => '<article id=&quot;%1$s&quot; class=&quot;widget %2$s&quot;>',
            'after_widget'  => '</article>',
            'before_title'  => '<h3 class=&quot;widget-title&quot;>',
            'after_title'   => '</h3>',
        ));//end main-sidebars
    
        register_sidebar(array(
            'ID'            => 'footer-widgets',
            'name'          => 'footer',
            'before_widget' => '<article id=&quot;%1$s&quot; class=&quot;widget %2$s&quot;>',
            'after_widget'  => '</article>',
            'before_title'  => '<h3 class=&quot;widget-title&quot;>',
            'after_title'   => '</h3>',
        ));//end footer-sidebars
    };
    //trigger the theme-name widget
    add_action( 'widgets_init' , 'grayghostvisuals_widget' );

    footer.php where my sidebar resides for widget display
    <?php if( function_exists( 'dynamic_sidebar' ) && dynamic_sidebar( 'footer' ) ) : ?>
    <?php dynamic_sidebar('footer widget') ?>
    <?php endif; ?>

    Documentation on this is slim so I'm unable to find a resolution to the problem. I've found a few questions through the forum but they were closed with no answers displayed for their solution and the Codex for register_widget_control is bare.

  2. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    search all of your theme's files for 'register_widget_control'; (and possibly the plugins as well if they're not all updated)

    what theme are you using?

  3. grayghostvisuals
    Member
    Posted 1 year ago #

    I'm using my own blank theme.

    Can't seem to find any remnants of register_widget_control throughout my entire theme files, but what I did find was it being used by a plugin. Great call !!!

    Thanks for the tip and help :)

Topic Closed

This topic has been closed to new replies.

About this Topic