mirror of
https://github.com/10h30/display-featured-image-genesis.git
synced 2026-06-05 15:08:20 +09:00
add excerpt support for pages if excerpts turned on
This commit is contained in:
@@ -20,7 +20,6 @@ class Display_Featured_Image_Genesis_Settings {
|
||||
register_setting( 'media', 'displayfeaturedimage_default', array( $this, 'validate_image' ) );
|
||||
register_setting( 'media', 'displayfeaturedimage_excerpts', array( $this, 'one_zero' ) );
|
||||
|
||||
|
||||
add_settings_section(
|
||||
'display_featured_image_section',
|
||||
__( 'Display Featured Image for Genesis', 'display-featured-image-genesis' ),
|
||||
|
||||
@@ -30,8 +30,7 @@ class Display_Featured_Image_Genesis {
|
||||
return;
|
||||
}
|
||||
|
||||
add_image_size( 'displayfeaturedimage_backstretch', 2000 );
|
||||
|
||||
add_action( 'init', array( $this, 'add_plugin_supports' ) );
|
||||
add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
|
||||
add_action( 'admin_init', array( $this->settings, 'register_settings' ) );
|
||||
add_action( 'load-options-media.php', array( $this->settings, 'help' ) );
|
||||
@@ -75,6 +74,21 @@ class Display_Featured_Image_Genesis {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* add plugin support for new image size and excerpts on pages, if move excerpts option is enabled
|
||||
*
|
||||
* @since 1.3.0
|
||||
*/
|
||||
function add_plugin_supports() {
|
||||
add_image_size( 'displayfeaturedimage_backstretch', 2000, 2000, false );
|
||||
|
||||
$move_excerpts = get_option( 'displayfeaturedimage_excerpts' );
|
||||
if ( $move_excerpts ) {
|
||||
add_post_type_support( 'page', 'excerpt' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set up text domain for translations
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user