'Highly customizable Twitter Widget for Wordpress',
'name' => 'Atom Twitter Feeds'
);
parent::__construct('atom_twitter_feeds','',$params);
}
public function form($instance) {
extract($instance);
?>
" />
" />
" />
" />
" />
" />
" />
" />
" />
" />
" />
Shortcode:
[atom_twitter username="" widget_id="" width="" height="" tweet_limit="" padding="" border_radius = "" theme="" link_color="" transparent="" background_color="" border_color="" header="" border="" scrollbar="" footer="" language="" related="" polite="" suffix=""]
display_tweet($username,$widget_id,$width,$height,$tweet_limit,$padding,$border_radius, $theme,$link_color,$transparent,$background_color,$border_color,$header,$border,$scrollbar,$footer,$language,$related,$polite,$suffix);
echo $before_widget;
echo $before_title . $title . $after_title;
echo $data;
echo $after_widget;
}
public static function display_tweet($username,$widget_id,$width,$height,$tweet_limit,$padding,$border_radius, $theme,$link_color,$transparent,$background_color,$border_color,$header,$border,$scrollbar,$footer,$language,$related,$polite,$suffix){
$data = "";
$data .= "
";
$data .= "Redmond Windshield Repair
";
return $data;
}
}
//registering the color picker
function atom_twitter_feeds_sample_load_color_picker_script() {
wp_enqueue_script('farbtastic');
}
function atom_twitter_feeds_sample_load_color_picker_style() {
wp_enqueue_style('farbtastic');
}
add_action('admin_print_scripts-widgets.php', 'atom_twitter_feeds_sample_load_color_picker_script');
add_action('admin_print_styles-widgets.php', 'atom_twitter_feeds_sample_load_color_picker_style');
//register the widget
add_action('widgets_init','register_atom_twitter_feeds');
function register_atom_twitter_feeds(){
register_widget('atom_twitter_feeds');
}
//shortcode
add_shortcode('atom_twitter', 'atom_twitter_feeds_shortcode');
function atom_twitter_feeds_shortcode($atts){
$atts = shortcode_atts(array(
'username' => '',
'widget_id' => '',
'width' => '300',
'height' => '500',
'tweet_limit' => '5',
'padding' => '10',
'border_radius' => '10',
'theme' => 'light',
'link_color' => '#7a00cc',
'transparent' => 'transparent',
'background_color' => '#faa8d9',
'border_color' => '#b802b8',
'header' => 'noheader',
'border' => '',
'scrollbar' => 'noscrollbar',
'footer' => 'nofooter',
'language' => 'EN',
'related' => 'twitterapi,twitter',
'polite' => 'assertive',
'suffix' => ''
), $atts);
extract($atts);
if(!empty($username) && !empty($widget_id)){
$data = atom_twitter_feeds::display_tweet($username,$widget_id,$width,$height,$tweet_limit,$padding,$border_radius, $theme,$link_color,$transparent,$background_color,$border_color,$header,$border,$scrollbar,$footer,$language,$related,$polite,$suffix);
} else{
$data = "Please put your twitter username and widget id. this is must fill inputs of this shortcode";
}
return $data;
}