Skip to content
Browse files

Re: Issue #91 adds filters to functional files

  • Loading branch information...
1 parent 99dd10e commit dc4d0660fe327e354f8dd448c61038afb54a5ae6 @chipbennett committed Dec 21, 2012
Showing with 27 additions and 27 deletions.
  1. +13 −13 functions/custom.php
  2. +11 −11 functions/dynamic-css.php
  3. +2 −2 functions/post-custom-meta.php
  4. +1 −1 functions/wordpress-hooks.php
View
26 functions/custom.php
@@ -34,7 +34,7 @@
*/
function oenology_get_context() {
- $context = 'index';
+ $context = apply_filters( 'oenology_default_context', 'index' );
if ( is_front_page() ) {
// Front Page
@@ -80,7 +80,7 @@ function oenology_get_context() {
$context = 'home';
}
- return $context;
+ return apply_filters( 'oenology_get_context', $context );
}
/**
@@ -156,7 +156,7 @@ function oenology_get_current_page_layout() {
}
}
}
- return $layout;
+ return apply_filters( 'oenology_get_current_page_layout', $layout );
}
/**
@@ -178,7 +178,7 @@ function oenology_get_current_tab() {
$current = $oenology_options['default_reference_tab'];
}
}
- return $current;
+ return apply_filters( 'oenology_get_current_tab', $current );
}
@@ -194,7 +194,7 @@ function oenology_get_custom_category_list() {
$customcatfeedlink = get_category_feed_link( $customcat->term_id );
$customcatlist .= '<li><a title="' . esc_attr( sprintf( _x( 'Subscribe to the %s news feed', 'Category Name', 'oenology' ), $customcat->name ) ) . '" href="' . $customcatfeedlink . '"><img src="' . $catrssurl . '" alt="feed" /></a><a href="' . $customcathref . '">' . $customcat->name . '</a> (' . $customcat->count . ')</li>';
}
- return $customcatlist;
+ return apply_filters( 'oenology_get_custom_category_list', $customcatlist );
}
@@ -210,7 +210,7 @@ function oenology_get_custom_post_format_list() {
$termlink = get_post_format_link( $termslug );
$postformatlist .= '<li><a title="' . esc_attr( sprintf( _x( 'Subscribe to the %s news feed', 'Post Format', 'oenology' ), $term->name ) ) . '" href="' . $termlink .'feed/"><img src="'.$postformatrssurl.'" alt="feed" /></a><a href="'. $termlink .'">' . $term->name . '</a> (' . $term->count . ')</li>';
}
- return $postformatlist;
+ return apply_filters( 'oenology_get_custom_post_format_list', $postformatlist );
}
@@ -226,7 +226,7 @@ function oenology_get_custom_tag_list() {
$customtagfeedlink = get_tag_feed_link( $customtag->term_id );
$customtaglist .= '<li><a title="' . esc_attr( sprintf( _x( 'Subscribe to the %s feed', 'Tag Name', 'oenology' ), $customtag->name ) ) . '" href="' . $customtagfeedlink . '"><img src="' . $tagrssurl . '" alt="feed" /></a><a href="' . $customtaghref . '">' . $customtag->name . '</a> (' . $customtag->count . ')</li>';
}
- return $customtaglist;
+ return apply_filters( 'oenology_get_custom_tag_list', $customtaglist );
}
/**
@@ -456,9 +456,9 @@ function oenology_get_header_textcolor() {
$colorscheme = oenology_get_color_scheme();
if ( 'light' == $colorscheme ) {
- $headertextcolor = '666666';
+ $headertextcolor = apply_filters( 'oenology_light_color_scheme_header_textcolor', '666666' );
} elseif ( 'dark' == $colorscheme ) {
- $headertextcolor = 'dddddd';
+ $headertextcolor = apply_filters( 'oenology_light_color_scheme_header_textcolor', 'dddddd' );
}
}
return $headertextcolor;
@@ -513,7 +513,7 @@ function oenology_get_post_formats() {
'description' => __('A recording of both visual and audible components; Electronically capturing, recording, processing, storing, transmitting, and reconstructing a sequence of still images representing scenes in motion.', 'oenology' )
)
);
- return $postformats;
+ return apply_filters( 'oenology_get_post_formats', $postformats );
}
/**
@@ -594,7 +594,7 @@ function oenology_get_social_networks() {
'baseurl' => 'http://www.twitter.com'
)
);
- return $socialnetworks;
+ return apply_filters( 'oenology_get_social_networks', $socialnetworks );
}
/**
@@ -626,7 +626,7 @@ function oenology_gallery_links() {
$links['nextthumb'] = wp_get_attachment_link($attachments[$k-1]->ID, 'attachment-nav-thumbnail', true);
}
- return $links;
+ return apply_filters( 'oenology_gallery_links', $links );
}
/**
@@ -689,7 +689,7 @@ function oenology_gallery_image_meta() {
} else if ( is_object( $attachmentimage ) && $attachmentimage->post_excerpt ) {
$image_meta['caption'] = $attachmentimage->post_excerpt;
}
- return $image_meta;
+ return apply_filters( 'oenology_gallery_image_meta', $image_meta );
}
View
22 functions/dynamic-css.php
@@ -119,7 +119,7 @@ function oenology_enqueue_social_icon_style() {
return;
}
- $socialiconbgposition = array(
+ $socialiconbgposition = apply_filters( 'oenology_social_icon_bg_position', array(
'aim' => array(
'name' => 'aim',
'black' => array(
@@ -270,15 +270,15 @@ function oenology_enqueue_social_icon_style() {
'y' => '-630'
)
)
- );
+ ) );
$socialnetworks = oenology_get_social_networks();
- $linkcolor = 'silver';
- $linkhovercolor = 'black';
+ $linkcolor = apply_filters( 'oenology_light_color_scheme_linkcolor', 'silver' );
+ $linkhovercolor = apply_filters( 'oenology_light_color_scheme_linkhovercolor', 'black' );
$colorscheme = oenology_get_color_scheme();
if ( 'dark' == $colorscheme ) {
- $linkcolor = 'gray';
- $linkhovercolor = 'silver';
+ $linkcolor = apply_filters( 'oenology_dark_color_scheme_linkcolor', 'gray' );
+ $linkhovercolor = apply_filters( 'oenology_dark_color_scheme_linknovercolor', 'silver' );
}
?>
@@ -380,7 +380,7 @@ function oenology_get_post_format_icon_formats() {
'position' => 'left'
)
);
- return $icons;
+ return apply_filters( 'oenology_get_post_format_icon_formats', $icons );
}
/**
@@ -426,7 +426,7 @@ function oenology_post_format_title_icon_container() {
*/
function oenology_enqueue_post_format_icon_style() {
- $postformatbgposition = array(
+ $postformatbgposition = apply_filters( 'oenology_post_format_bg_position', array(
'aside' => array(
'name' => 'aside',
'gray' => array(
@@ -526,13 +526,13 @@ function oenology_enqueue_post_format_icon_style() {
'y' => '-1376'
)
)
- );
+ ) );
$postformats = oenology_get_post_formats();
- $iconcolor = 'original';
+ $iconcolor = apply_filters( 'oenology_light_color_scheme_postformat_linkcolor', 'original' );
$colorscheme = oenology_get_color_scheme();
if ( 'dark' == $colorscheme ) {
- $iconcolor = 'gray';
+ $iconcolor = apply_filters( 'oenology_dark_color_scheme_postformat_linkcolor', 'gray' );
}
?>
View
4 functions/post-custom-meta.php
@@ -21,8 +21,8 @@
function oenology_add_layout_meta_box( $post ) {
global $wp_meta_boxes;
- $context = 'side'; // 'normal', 'side', 'advanced'
- $priority = 'default'; // 'high', 'core', 'low', 'default'
+ $context = apply_filters( 'oenology_layout_meta_box_context', 'side' ); // 'normal', 'side', 'advanced'
+ $priority = apply_filters( 'oenology_layout_meta_box_priority', 'default' ); // 'high', 'core', 'low', 'default'
add_meta_box(
'oenology_layout',
View
2 functions/wordpress-hooks.php
@@ -214,7 +214,7 @@ function oenology_comment_count( $count ) {
*/
function oenology_untitled_post( $title ) {
if ( '' == $title ) {
- return '<em>(' . __( 'Untitled', 'oenology' ) . ')</em>';
+ return apply_filters( 'oenology_untitled_post_title', '<em>(' . __( 'Untitled', 'oenology' ) . ')</em>' );
} else {
return $title;
}

0 comments on commit dc4d066

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