diff --git a/includes/class-displayfeaturedimagegenesis-common.php b/includes/class-displayfeaturedimagegenesis-common.php index c10de8c..0824eb6 100644 --- a/includes/class-displayfeaturedimagegenesis-common.php +++ b/includes/class-displayfeaturedimagegenesis-common.php @@ -126,7 +126,17 @@ class Display_Featured_Image_Genesis_Common { * @since 1.0.1 */ public static function get_skipped_posttypes() { - return apply_filters( 'display_featured_image_genesis_skipped_posttypes', array( 'attachment', 'revision', 'nav_menu_item' ) ); + + $skip = get_option( 'displayfeaturedimage_exclude_front' ); + + $post_types = array(); + $post_types[] = 'attachment'; + $post_types[] = 'revision'; + $post_types[] = 'nav_menu_item'; + if ( $skip ) $post_types[] = is_front_page(); + + return apply_filters( 'display_featured_image_genesis_skipped_posttypes', $post_types ); + } /** @@ -136,7 +146,14 @@ class Display_Featured_Image_Genesis_Common { * @since 1.2.0 */ public static function use_fallback_image() { - return apply_filters( 'display_featured_image_genesis_use_default', array( 'attachment', 'revision', 'nav_menu_item' ) ); + + $post_types = array(); + $post_types[] = 'attachment'; + $post_types[] = 'revision'; + $post_types[] = 'nav_menu_item'; + + return apply_filters( 'display_featured_image_genesis_use_default', $post_types ); + } /** @@ -146,7 +163,14 @@ class Display_Featured_Image_Genesis_Common { * @since 1.3.0 */ public static function omit_excerpt() { - return apply_filters( 'display_featured_image_genesis_omit_excerpt', array( 'attachment', 'revision', 'nav_menu_item' ) ); + + $post_types = array(); + $post_types[] = 'attachment'; + $post_types[] = 'revision'; + $post_types[] = 'nav_menu_item'; + + return apply_filters( 'display_featured_image_genesis_omit_excerpt', $post_types ); + } } diff --git a/includes/class-displayfeaturedimagegenesis-description.php b/includes/class-displayfeaturedimagegenesis-description.php index 1c90a5e..3664828 100644 --- a/includes/class-displayfeaturedimagegenesis-description.php +++ b/includes/class-displayfeaturedimagegenesis-description.php @@ -51,17 +51,16 @@ class Display_Featured_Image_Genesis_Description { return; } - $item = Display_Featured_Image_Genesis_Common::get_image_variables(); - $frontpage = get_option( 'show_on_front' ); - $headline = $intro_text = ''; + $item = Display_Featured_Image_Genesis_Common::get_image_variables(); + $frontpage = get_option( 'show_on_front' ); + $headline = ''; + $intro_text = wpautop( get_bloginfo( 'description' ) ); if ( is_home() && 'page' === $frontpage ) { $headline = sprintf( '
' . __( 'The Display Featured Image for Genesis plugin has three optional settings. Check the Help tab for more information. ', 'display-featured-image-genesis' ) . '
'; + echo '' . __( 'The Display Featured Image for Genesis plugin has just a few optional settings. Check the Help tab for more information. ', 'display-featured-image-genesis' ) . '
'; } /** @@ -132,6 +142,18 @@ class Display_Featured_Image_Genesis_Settings { ) . ''; } + /** + * option to exclude default featured image on front page + * @return 0 1 checkbox + * + * @since x.y.z + */ + public function exclude_front() { + $value = get_option( 'displayfeaturedimage_exclude_front' ); + + echo ' '; + } + /** * option to move excerpts to leader image area * @return 0 1 checkbox @@ -246,6 +268,14 @@ class Display_Featured_Image_Genesis_Settings { absint( $large+1 ) ) . ''; + $skipfront_help = + '' . __( 'If you set a Default Featured Image, it will show on every post/page of your site. This may not be desirable on child themes with a front page constructed with widgets, so you can select this option to prevent the Featured Image from showing on the front page.', 'display-featured-image-genesis' ) . '
' . + '' . sprintf( + __( 'If you want to prevent entire groups of posts from not using the Featured Image, you will want to add a filter to your theme functions.php file.', 'display-featured-image-genesis' ), + esc_url( 'https://github.com/robincornett/display-featured-image-genesis#how-do-i-stop-the-featured-image-action-from-showing-on-my-custom-post-types' ) + ) . '
'; + $excerpts_help = '' . __( 'By default, archive descriptions (set on the Genesis Archive Settings pages) show below the Default Featured Image, while the archive title displays on top of the image. If you check this box, all headlines, descriptions, and optional excerpts will display in a box overlaying the Featured Image.', 'display-featured-image-genesis' ) . '
'; @@ -263,6 +293,12 @@ class Display_Featured_Image_Genesis_Settings { 'content' => $default_help, ) ); + $screen->add_help_tab( array( + 'id' => 'displayfeaturedimage_exclude_front-help', + 'title' => __( 'Show on Front Page', 'display-featured-image-genesis' ), + 'content' => $skipfront_help, + ) ); + $screen->add_help_tab( array( 'id' => 'displayfeaturedimage_excerpts-help', 'title' => __( 'Move Excerpts', 'display-featured-image-genesis' ),