Added option to enable/disable the comic sidebar locations.

This commit is contained in:
Frumph
2012-06-01 03:27:02 -07:00
parent 1f022884a9
commit 12cd020bcc
3 changed files with 31 additions and 19 deletions

View File

@@ -33,7 +33,8 @@ if ( isset($_POST['_wpnonce']) && wp_verify_nonce($_POST['_wpnonce'], 'update-op
'add_dashboard_frumph_feed_widget',
'disable_comic_on_home_page',
'disable_comic_blog_on_home_page',
'enable_comments_on_homepage'
'enable_comments_on_homepage',
'enable_comic_sidebar_locations'
) as $key) {
if (!isset($_REQUEST[$key])) $_REQUEST[$key] = 0;
$ceo_options[$key] = (bool)( $_REQUEST[$key] == 1 ? true : false );

View File

@@ -151,21 +151,23 @@ function ceo_initialize_post_types() {
// Create CEO Specific Sidebars regardless if they already exist.
function ceo_register_sidebars() {
foreach (array(
__('Over Comic', 'comiceasel'),
__('Left of Comic','comiceasel'),
__('Right of Comic', 'comiceasel'),
__('Under Comic', 'comiceasel')
) as $sidebartitle) {
register_sidebar(array(
'name'=> $sidebartitle,
'id' => 'ceo-sidebar-'.sanitize_title($sidebartitle),
'description' => __('Comic Easel Sidebar Location', 'comiceasel'),
'before_widget' => "<div id=\"".'%1$s'."\" class=\"widget ".'%2$s'."\">\r\n<div class=\"widget-head\"></div>\r\n<div class=\"widget-content\">\r\n",
'after_widget' => "</div>\r\n<div class=\"clear\"></div>\r\n<div class=\"widget-foot\"></div>\r\n</div>\r\n",
'before_title' => "<h2 class=\"widgettitle\">",
'after_title' => "</h2>\r\n"
));
if (ceo_pluginfo('enable_comic_sidebar_locations')) {
foreach (array(
__('Over Comic', 'comiceasel'),
__('Left of Comic','comiceasel'),
__('Right of Comic', 'comiceasel'),
__('Under Comic', 'comiceasel')
) as $sidebartitle) {
register_sidebar(array(
'name'=> $sidebartitle,
'id' => 'ceo-sidebar-'.sanitize_title($sidebartitle),
'description' => __('Comic Easel Sidebar Location', 'comiceasel'),
'before_widget' => "<div id=\"".'%1$s'."\" class=\"widget ".'%2$s'."\">\r\n<div class=\"widget-head\"></div>\r\n<div class=\"widget-content\">\r\n",
'after_widget' => "</div>\r\n<div class=\"clear\"></div>\r\n<div class=\"widget-foot\"></div>\r\n</div>\r\n",
'before_title' => "<h2 class=\"widgettitle\">",
'after_title' => "</h2>\r\n"
));
}
}
}
@@ -261,7 +263,8 @@ function ceo_load_options($reset = false) {
'enable_random_nav' => true,
'enable_embed_nav' => false,
'disable_default_nav' => false,
'enable_comments_on_homepage' => false
'enable_comments_on_homepage' => false,
'enable_comic_sidebar_locations' => false
) as $field => $value) {
$ceo_config[$field] = $value;
}

View File

@@ -47,9 +47,17 @@
<?php _e('If the blog loop is disabled and the comic post is enabled on the home page, enabling this will allow the comments for the comic post to appear.','comiceasel'); ?>
</td>
</tr>
<tr class="alternate">
<th scope="row"><label for="enable_comic_sidebar_locations"><?php _e('Enable comic sidebar locations?','comiceasel'); ?></label></th>
<td>
<input id="enable_comic_sidebar_locations" name="enable_comic_sidebar_locations" type="checkbox" value="1" <?php checked(true, $ceo_options['enable_comic_sidebar_locations']); ?> />
</td>
<td>
<?php _e('Checking this option makes 4 new sidebars appear in the appearance - widgets section, above comic, below comic, left of comic and right of comic.','comiceasel'); ?>
</td>
</tr>
</table>
</div>
<br />
<div class="ceo-options-save">
<div class="ceo-major-publishing-actions">
@@ -63,4 +71,4 @@
</form>
</div>
</div>