diff --git a/lib/cleanup.php b/lib/cleanup.php
index 5acbfc7..70c015c 100644
--- a/lib/cleanup.php
+++ b/lib/cleanup.php
@@ -237,16 +237,16 @@ function roots_caption($output, $attr, $content) {
}
$defaults = array(
- 'id' => '',
- 'align' => 'alignnone',
- 'width' => '',
+ 'id' => '',
+ 'align' => 'alignnone',
+ 'width' => '',
'caption' => ''
);
$attr = shortcode_atts($defaults, $attr);
// If the width is less than 1 or there is no caption, return the content wrapped between the [caption] tags
- if (1 > $attr['width'] || empty($attr['caption'])) {
+ if ($attr['width'] < 1 || empty($attr['caption'])) {
return $content;
}
diff --git a/lib/widgets.php b/lib/widgets.php
index 81d6644..b12a786 100644
--- a/lib/widgets.php
+++ b/lib/widgets.php
@@ -3,20 +3,21 @@
function roots_widgets_init() {
// Register widgetized areas
register_sidebar(array(
- 'name' => __('Primary Sidebar', 'roots'),
- 'id' => 'sidebar-primary',
+ 'name' => __('Primary Sidebar', 'roots'),
+ 'id' => 'sidebar-primary',
'before_widget' => '',
- 'before_title' => '
',
- 'after_title' => '
',
+ 'after_widget' => '',
+ 'before_title' => '',
+ 'after_title' => '
',
));
+
register_sidebar(array(
- 'name' => __('Footer', 'roots'),
- 'id' => 'sidebar-footer',
+ 'name' => __('Footer', 'roots'),
+ 'id' => 'sidebar-footer',
'before_widget' => '',
- 'before_title' => '',
- 'after_title' => '
',
+ 'after_widget' => '',
+ 'before_title' => '',
+ 'after_title' => '
',
));
// Register widgets
@@ -28,6 +29,7 @@ add_action('widgets_init', 'roots_widgets_init');
class Roots_Vcard_Widget extends WP_Widget {
function Roots_Vcard_Widget() {
$widget_ops = array('classname' => 'widget_roots_vcard', 'description' => __('Use this widget to add a vCard', 'roots'));
+
$this->WP_Widget('widget_roots_vcard', __('Roots: vCard', 'roots'), $widget_ops);
$this->alt_option_name = 'widget_roots_vcard';
@@ -64,6 +66,7 @@ class Roots_Vcard_Widget extends WP_Widget {
if (!isset($instance['email'])) { $instance['email'] = ''; }
echo $before_widget;
+
if ($title) {
echo $before_title;
echo $title;
@@ -100,6 +103,7 @@ class Roots_Vcard_Widget extends WP_Widget {
$this->flush_widget_cache();
$alloptions = wp_cache_get('alloptions', 'options');
+
if (isset($alloptions['widget_roots_vcard'])) {
delete_option('widget_roots_vcard');
}