__( 'Footer widget for Address, Telephone & Email', 'cyclone-corporate' ), )
);
}
// Creating widget front-end
// This is where the action happens
public function widget( $args, $instance ) {
$title = apply_filters( 'widget_title', $instance['title'] );
$address = apply_filters( 'widget_title', $instance['address'] );
$tel = apply_filters( 'widget_title', $instance['tel'] );
$email = apply_filters( 'widget_title', $instance['email'] );
// before and after widget arguments are defined by themes
echo $args['before_widget'];
if ( ! empty( $address ) || ! empty( $tel ) || ! empty( $email ) || ! empty( $title ) )
echo '
'.esc_attr($title).'
'. ''
.'- '.''.' '.esc_attr($address).'
'.
'- '.''.' '.esc_attr($tel).'
'.
'- '.''.' '.esc_attr($email).'
'.'
'.$args['after_title'];
}
// Widget Backend
public function form( $instance ) {
if ( isset( $instance[ 'title' ] ) ) {
$instance = wp_parse_args( (array) $instance, array( 'title' => 'Contact' ) );
$title = $instance[ 'title' ];
}
else {
$title = __( 'Contact', 'cyclone-corporate' );
}
if ( isset( $instance[ 'address' ] ) ) {
$address = $instance[ 'address' ];
}
else {
$address = __( 'New Address', 'cyclone-corporate' );
}
if ( isset( $instance[ 'tel' ] ) ) {
$tel = $instance[ 'tel' ];
}
else {
$tel = __( 'New Phone', 'cyclone-corporate' );
}
if ( isset( $instance[ 'email' ] ) ) {
$email = $instance[ 'email' ];
}
else {
$email = __( 'New Email','cyclone-corporate' );
}
// Widget admin form
?>