Fix front page filter

DRY DRY
This commit is contained in:
Robin Cornett
2015-09-01 20:34:25 -04:00
parent 26803d1718
commit 4b61557eeb
2 changed files with 16 additions and 24 deletions
@@ -60,19 +60,9 @@ class Display_Featured_Image_Genesis_Description {
}
// set front page and posts page variables
$frontpage = get_option( 'show_on_front' );
$postspage = get_post( get_option( 'page_for_posts' ) );
/**
* filter to show title on front page
* @return boolean true/false
*
* @since 2.3.0
*/
$show_front_page_title = apply_filters( 'display_featured_image_genesis_excerpt_show_front_page_title', false );
$show_front_page_title = true === $show_front_page_title ? $show_front_page_title : false;
$title = $show_front_page_title ? get_the_title() : '';
$frontpage = get_option( 'show_on_front' );
$postspage = get_post( get_option( 'page_for_posts' ) );
$title = $this->show_front_page_title() ? get_the_title() : '';
$intro_text = get_the_excerpt() ? get_the_excerpt() : get_bloginfo( 'description' );
$itemprop = genesis_html5() ? 'itemprop="headline"' : '';
@@ -196,4 +186,16 @@ class Display_Featured_Image_Genesis_Description {
}
/**
* Filter to show title on front page.
* @return boolean true/false
*
* @since 2.3.0
*/
public function show_front_page_title() {
$show_front_title = apply_filters( 'display_featured_image_genesis_excerpt_show_front_page_title', false );
return true === $show_front_title ? true : false;
}
}
@@ -234,17 +234,7 @@ class Display_Featured_Image_Genesis_Output {
* @since 2.3.1
*/
protected function do_the_title() {
/**
* filter to show title on front page
* @return boolean true/false
*
* @since 2.3.0
*/
$show_front_title = apply_filters( 'display_featured_image_genesis_excerpt_show_front_page_title', false );
$show_front_title = true === $show_front_title ? $show_front_title : false;
if ( is_front_page() && ! $show_front_title ) {
if ( is_front_page() && ! $this->description->show_front_page_title() ) {
return;
}
$class = is_singular() ? 'entry-title' : 'archive-title';