WordPress.org

Ready to get started?Download WordPress

Forums

Twitter Tools
register_widget problems (deprecated) (3 posts)

  1. You're still using register_sidebar_widget and register_widget_control -- not the newer functions. Around lines 950 and 980 in twitter-tools.php, please change the following lines as noted:

    Line 950:

    // OLD:
    	register_sidebar_widget(array(__('Twitter Tools', 'twitter-tools'), 'widgets'), 'aktt_widget');
    // NEW:
    	wp_register_sidebar_widget( 'twitter-tools', __('Twitter Tools', 'twitter-tools'), 'aktt_widget' );

    Line 980:

    // OLD:
    	register_widget_control(array(__('Twitter Tools', 'twitter-tools'), 'widgets'), 'aktt_widget_control', 300, 100);
    // NEW:
    	wp_register_widget_control( 'twitter-tools', __('Twitter Tools', 'twitter-tools'), 'aktt_widget_control', array( 'width' => 300 ) );

    http://wordpress.org/extend/plugins/twitter-tools/

  2. Also, in twitter-tools.php, around line 2065 ... please change 10 and 2 to 'manage_options' and 'publish_posts' respectively.

    function aktt_menu_items() {
    	if (current_user_can('manage_options')) {
    		add_options_page(
    			__('Twitter Tools Options', 'twitter-tools')
    			, __('Twitter Tools', 'twitter-tools')
    			, 10
    			, basename(__FILE__)
    			, 'aktt_options_form'
    		);
    	}
    	if (current_user_can('publish_posts')) {
    		add_submenu_page(
    			'post-new.php'
    			, __('New Tweet', 'twitter-tools')
    			, __('Tweet', 'twitter-tools')
    			, 2
    			, basename(__FILE__)
    			, 'aktt_admin_tweet_form'
    		);
    	}
    }

    becomes

    function aktt_menu_items() {
    	if (current_user_can('manage_options')) {
    		add_options_page(
    			__('Twitter Tools Options', 'twitter-tools')
    			, __('Twitter Tools', 'twitter-tools')
    			, 'manage_options'
    			, basename(__FILE__)
    			, 'aktt_options_form'
    		);
    	}
    	if (current_user_can('publish_posts')) {
    		add_submenu_page(
    			'post-new.php'
    			, __('New Tweet', 'twitter-tools')
    			, __('Tweet', 'twitter-tools')
    			, 'publish_posts'
    			, basename(__FILE__)
    			, 'aktt_admin_tweet_form'
    		);
    	}
    }

    this is generating deprecated errors with wp_debug turned on.

  3. Also, line 2045 ( also in twitter-tools.php ):

    $posted_meta = $_POST['aktt_notify_twitter'];

    becomes

    $posted_meta = isset($_POST['aktt_notify_twitter'])?$_POST['aktt_notify_twitter']:null;

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic