REGISTER_SIDEAR_WIDGET从2.8版开始就不推荐使用了!改用wp_Register_侧边栏_Widget()

时间:2012-08-24 作者:user979331

我打开了调试器,出现了此错误。。。

Notice: register_sidebar_widget is deprecated since version 2.8! Use wp_register_sidebar_widget() instead. in /home/content/19/9468119/html/wp-includes/functions.php on line 2705

Notice: register_widget_control is deprecated since version 2.8! Use wp_register_widget_control() instead. in /home/content/19/9468119/html/wp-includes/functions.php on line 2705
我去了有问题的代码行。。。

function _deprecated_function( $function, $version, $replacement = null ) {

    do_action( \'deprecated_function_run\', $function, $replacement, $version );

    // Allow plugin to filter the output error trigger
    if ( WP_DEBUG && apply_filters( \'deprecated_function_trigger_error\', true ) ) {
        if ( ! is_null($replacement) )
            trigger_error( sprintf( __(\'%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.\'), $function, $version, $replacement ) );
        else
            trigger_error( sprintf( __(\'%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.\'), $function, $version ) );
    }
}
我在这里到底要换什么?

谢谢,J

1 个回复
最合适的回答,由SO网友:Chip Bennett 整理而成

从您的标题:

register_sidebar_widget() 自版本2.8以来已弃用!Use wp_register_sidebar_widget() instead.

在你的主题中的某个地方functions.php, 或包含在functions.php - 您正在添加自定义小部件。查找该代码,并替换register_sidebar_widget() 具有wp_register_sidebar_widget().

PROTIP:使用Log Deprecated Notices 用于跟踪已弃用函数调用的执行位置的插件。

结束

相关推荐

Functions.php中的帖子ID错误

我试图在我的函数中执行以下代码。php更改我的wordpress博客的标题。function filter_pagetitle($url) { global $wp_query; $the_post_id = $wp_query->post->ID; $the_post_data = get_post($the_post_id); return $the_post_da