Formatting
This commit is contained in:
@@ -246,7 +246,7 @@ function roots_caption($output, $attr, $content) {
|
|||||||
$attr = shortcode_atts($defaults, $attr);
|
$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 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;
|
return $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ function roots_widgets_init() {
|
|||||||
'before_title' => '<h3>',
|
'before_title' => '<h3>',
|
||||||
'after_title' => '</h3>',
|
'after_title' => '</h3>',
|
||||||
));
|
));
|
||||||
|
|
||||||
register_sidebar(array(
|
register_sidebar(array(
|
||||||
'name' => __('Footer', 'roots'),
|
'name' => __('Footer', 'roots'),
|
||||||
'id' => 'sidebar-footer',
|
'id' => 'sidebar-footer',
|
||||||
@@ -28,6 +29,7 @@ add_action('widgets_init', 'roots_widgets_init');
|
|||||||
class Roots_Vcard_Widget extends WP_Widget {
|
class Roots_Vcard_Widget extends WP_Widget {
|
||||||
function Roots_Vcard_Widget() {
|
function Roots_Vcard_Widget() {
|
||||||
$widget_ops = array('classname' => 'widget_roots_vcard', 'description' => __('Use this widget to add a vCard', 'roots'));
|
$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->WP_Widget('widget_roots_vcard', __('Roots: vCard', 'roots'), $widget_ops);
|
||||||
$this->alt_option_name = 'widget_roots_vcard';
|
$this->alt_option_name = 'widget_roots_vcard';
|
||||||
|
|
||||||
@@ -64,6 +66,7 @@ class Roots_Vcard_Widget extends WP_Widget {
|
|||||||
if (!isset($instance['email'])) { $instance['email'] = ''; }
|
if (!isset($instance['email'])) { $instance['email'] = ''; }
|
||||||
|
|
||||||
echo $before_widget;
|
echo $before_widget;
|
||||||
|
|
||||||
if ($title) {
|
if ($title) {
|
||||||
echo $before_title;
|
echo $before_title;
|
||||||
echo $title;
|
echo $title;
|
||||||
@@ -100,6 +103,7 @@ class Roots_Vcard_Widget extends WP_Widget {
|
|||||||
$this->flush_widget_cache();
|
$this->flush_widget_cache();
|
||||||
|
|
||||||
$alloptions = wp_cache_get('alloptions', 'options');
|
$alloptions = wp_cache_get('alloptions', 'options');
|
||||||
|
|
||||||
if (isset($alloptions['widget_roots_vcard'])) {
|
if (isset($alloptions['widget_roots_vcard'])) {
|
||||||
delete_option('widget_roots_vcard');
|
delete_option('widget_roots_vcard');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user