add excerpt support for pages if excerpts turned on

This commit is contained in:
Robin Cornett
2014-11-01 20:07:53 -04:00
parent d2b31413a2
commit f7d11e2494
2 changed files with 16 additions and 3 deletions
+16 -2
View File
@@ -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
*