/**
 * legacy function call
 * @ignore
 */
function _twitter_api_init_l10n($locale = null)
{
    return twitter_api_load_textdomain($locale);
}
Exemple #2
0
 /** @see WP_Widget::__construct */
 public function __construct($id_base = false, $name = '', $widget_options = array(), $control_options = array())
 {
     if (!function_exists('twitter_api_load_textdomain')) {
         require_once dirname(__FILE__) . '/api/twitter-api.php';
     }
     twitter_api_load_textdomain();
     $this->options = array(array('name' => 'title', 'label' => __('Widget title'), 'type' => 'text'), array('name' => 'screen_name', 'label' => __('Twitter handle', 'twitter-api'), 'type' => 'text'), array('name' => 'num', 'label' => __('Number of tweets', 'twitter-api'), 'type' => 'number'), array('name' => 'pop', 'label' => __('Minimum popularity', 'twitter-api'), 'type' => 'number'), array('name' => 'rts', 'label' => __('Show Retweets', 'twitter-api'), 'type' => 'bool'), array('name' => 'ats', 'label' => __('Show Replies', 'twitter-api'), 'type' => 'bool'));
     $name or $name = __('Latest Tweets', 'twitter-api');
     parent::__construct($id_base, $name, $widget_options, $control_options);
 }
/**
 * Overridden HTTP status codes for common Twitter-related problems.
 * Note these do not replace error text from Twitter, they're for complete API failures.
 * @param int HTTP status code
 * @return string HTTP status text
 */
function _twitter_api_http_status_text($s)
{
    // override status to be Twitter specific
    $codes = array(429 => 'Twitter API rate limit exceeded', 500 => 'Twitter server error', 502 => 'Twitter is not responding', 503 => 'Twitter is too busy to respond');
    if (isset($codes[$s])) {
        $text = $codes[$s];
    } else {
        $text = get_status_header_desc($s);
    }
    if ($text) {
        twitter_api_load_textdomain(null, 'twitter-errors');
        return __($text, 'twitter-errors');
    }
    // unknown status
    return sprintf(__('Status %u from Twitter', 'twitter-api'), $s);
}