Skip to content
Browse files

Re: Issue #87 makes sidebar widget content default display state user…

…-configurable
  • Loading branch information...
1 parent 7180e92 commit 41651fab6260ce2f91c95f1ebf6cd6d8a6d3627a @chipbennett committed Nov 26, 2012
Showing with 27 additions and 1 deletion.
  1. +25 −0 functions/options.php
  2. +2 −1 functions/widgets.php
View
25 functions/options.php
@@ -518,6 +518,26 @@ function oenology_get_option_parameters() {
'since' => '2.5',
'default' => 'always'
),
+ 'widget_display_default_state' => array(
+ 'name' => 'widget_display_default_state',
+ 'title' => __( 'Default Widget Display State', 'oenology' ),
+ 'type' => 'select',
+ 'valid_options' => array(
+ 'block' => array(
+ 'name' => 'block',
+ 'title' => __( 'Display Content', 'oenology' )
+ ),
+ 'none' => array(
+ 'name' => 'none',
+ 'title' => __( 'Hide Content', 'oenology' )
+ ),
+ ),
+ 'description' => __( 'The content of each Widget can be displayed or hidden via the "Show/Hide" link. Should Widget content be displayed or hidden by default?', 'oenology' ),
+ 'section' => 'widgets',
+ 'tab' => 'general',
+ 'since' => '3.0',
+ 'default' => 'none'
+ ),
);
return apply_filters( 'oenology_get_option_parameters', $options );
}
@@ -650,6 +670,11 @@ function oenology_get_settings_page_tabs() {
'title' => __( 'Social Network Profile Options', 'oenology' ),
'description' => __( 'Manage Social Network Profile options for the Oenology Theme. Refer to the contextual help screen for descriptions and help regarding each theme option.', 'oenology' )
),
+ 'widgets' => array(
+ 'name' => 'widgets',
+ 'title' => __( 'Widget Display Options', 'oenology' ),
+ 'description' => __( 'Manage Widget options for the Oenology Theme. Refer to the contextual help screen for descriptions and help regarding each theme option.', 'oenology' )
+ ),
'footer' => array(
'name' => 'footer',
'title' => __( 'Footer Options', 'oenology' ),
View
3 functions/widgets.php
@@ -88,11 +88,12 @@ function oenology_setup_widgets() {
} // function oenology_widget_setup()
function oenology_showhide_widget_content_open() {
+ $options = oenology_get_options();
$showhide = '<span class="showhide">';
$showhide .= 'Click to ';
$showhide .= '<span style="color:#5588aa;" onclick="d=this.parentElement.nextElementSibling; d.style.display==\'none\' ? d.style.display=\'block\' : d.style.display=\'none\';">view/hide</span>';
$showhide .= '<br /></span>';
- $showhide .= '<div style="display:none;">';
+ $showhide .= '<div style="display:' . $options['widget_display_default_state'] . ';">';
return $showhide;
}

0 comments on commit 41651fa

Please sign in to comment.
Something went wrong with that request. Please try again.