WordPress.org

Support

Support » Plugins and Hacks » [Plugin: Twitter Tools] register_widget problems (deprecated)

[Plugin: Twitter Tools] register_widget problems (deprecated)

  • 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/

Viewing 2 replies - 1 through 2 (of 2 total)
  • 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.

    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;

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Twitter Tools] register_widget problems (deprecated)’ is closed to new replies.