@see http://microformats.org/wiki/hcard-faq#Should_I_use_ADDRESS_for_hCards
* 20100221 - Changed local to voice @see http://microformats.org/wiki/hcard#adr_tel_email_types
*/
class Contact_Info extends WP_Widget {
/**
* Widget setup.
*/
function Contact_Info() {
/* Widget settings. */
$widget_ops = array( 'classname' => 'contactinfo', 'description' => __('Display contact information in the sidebar.', 'contactinfo') );
/* Widget control settings. */
//$control_ops = array( 'width' => 430, 'height' => 350, 'id_base' => 'ft-contact-info' );
/* Create the widget. */
$this->WP_Widget( 'ft-contact-info', __('Contact Info', 'contactinfo'), $widget_ops );
}
/**
* How to display the widget on the screen.
*/
function widget( $args, $instance ) {
extract( $args, EXTR_SKIP );
/* Our variables from the widget settings. */
$title = apply_filters('widget_title', $instance['title'] );
$name = empty($instance['name']) ? ' ' : apply_filters('widget_name', $instance['name']);
$street = empty($instance['street']) ? ' ' : apply_filters('widget_street', $instance['street']);
$city = empty($instance['city']) ? ' ' : apply_filters('widget_city', $instance['city']);
$state = empty($instance['state']) ? ' ' : apply_filters('widget_state', $instance['state']);
$zip = empty($instance['zip']) ? ' ' : apply_filters('widget_zip', $instance['zip']);
$phone = empty($instance['phone']) ? ' ' : apply_filters('widget_phone', $instance['phone']);
$fax = empty($instance['fax']) ? ' ' : apply_filters('widget_fax', $instance['fax']);
$email = empty($instance['email']) ? ' ' : apply_filters('widget_email', $instance['email']);
/* Before widget (defined by themes). */
echo $before_widget;
if ( $title )
echo $before_title . $title . $after_title;
?>
__('Contact Us', 'contactinfo'),
'name' => __('Your Company', 'contactinfo'),
'street' => __('123 Test Drive', 'contactinfo'),
'city' => __('Anytown', 'contactinfo'),
'state' => __('AZ', 'contactinfo'),
'zip' => __('85260', 'contactinfo'),
'phone' => __('(555) 555-5555', 'contactinfo'),
'fax' => __('(555) 555-5556', 'contactinfo'),
'email' => __('info@yourcompany.com', 'contactinfo')
);
$instance = wp_parse_args( (array) $instance, $defaults );
$title = strip_tags( $instance['title'] );
$name = strip_tags( $instance['name'] );
$street = strip_tags( $instance['street'] );
$city = strip_tags( $instance['city'] );
$state = strip_tags( $instance['state'] );
$zip = strip_tags( $instance['zip'] );
$phone = strip_tags( $instance['phone'] );
$fax = strip_tags( $instance['fax'] );
$email = strip_tags( $instance['email'] );
?>