Update docblocks

This commit is contained in:
Robin Cornett
2016-01-12 09:13:25 -05:00
parent bc80927720
commit 6d268b79dd
3 changed files with 103 additions and 3 deletions
@@ -35,6 +35,11 @@ class Display_Featured_Image_Genesis_Common {
add_filter( 'jetpack_photon_override_image_downsize', '__return_true' ); // turn Photon off so we can get the correct image
$image_size = 'displayfeaturedimage_backstretch';
/**
* Creates display_featured_image_genesis_use_large_image filter to check
* whether get_post_type array should use large image instead of backstretch.
* @uses is_in_array()
*/
if ( self::is_in_array( 'use_large_image' ) ) {
$image_size = 'large';
}
@@ -94,6 +99,11 @@ class Display_Featured_Image_Genesis_Common {
// set here with fallback preemptively, if it exists
if ( ! empty( $fallback ) ) {
/**
* Creates display_featured_image_genesis_use_default filter to check
* whether get_post_type array should use default image.
* @uses is_in_array()
*/
$image_id = $fallback_id;
if ( self::is_in_array( 'use_default' ) ) {
return (int) $image_id;
@@ -112,6 +122,11 @@ class Display_Featured_Image_Genesis_Common {
// if a post type image exists, it takes priority over the fallback. check that next.
$post_type = get_post_type();
if ( ! empty( $displaysetting['post_type'][ $post_type ] ) ) {
/**
* Creates display_featured_image_genesis_use_post_type_image filter to check
* whether get_post_type array should use the post type image.
* @uses is_in_array()
*/
$image_id = displayfeaturedimagegenesis_check_image_id( $displaysetting['post_type'][ $post_type ] );
if ( self::is_in_array( 'use_post_type_image' ) ) {
return (int) $image_id;
@@ -134,6 +149,11 @@ class Display_Featured_Image_Genesis_Common {
$term_image = display_featured_image_genesis_get_term_image_id();
if ( ! empty( $term_image ) ) {
/**
* Creates display_featured_image_genesis_use_taxonomy filter to check
* whether get_post_type array should use the term image.
* @uses is_in_array()
*/
$image_id = $term_image;
if ( self::is_in_array( 'use_taxonomy' ) ) {
return (int) $image_id;
@@ -24,8 +24,12 @@ class Display_Featured_Image_Genesis_Output {
$settings = new Display_Featured_Image_Genesis_Settings();
$this->displaysetting = $settings->get_display_setting();
$skip = $this->displaysetting['exclude_front'];
/**
* Creates display_featured_image_genesis_skipped_posttypes filter to check
* whether get_post_type array should not run plugin on this post type.
* @uses is_in_array()
*/
$post_types = array( 'attachment', 'revision', 'nav_menu_item' );
if ( is_admin() || ( Display_Featured_Image_Genesis_Common::is_in_array( 'skipped_posttypes', $post_types ) ) || ( $skip && is_front_page() ) ) {
return;
}
@@ -53,7 +57,11 @@ class Display_Featured_Image_Genesis_Output {
$large = $this->common->minimum_backstretch_width();
$width = absint( $this->item->backstretch[1] );
/**
* Creates display_featured_image_genesis_force_backstretch filter to check
* whether get_post_type array should force the backstretch effect for this post type.
* @uses is_in_array()
*/
if ( $width > $large || Display_Featured_Image_Genesis_Common::is_in_array( 'force_backstretch' ) ) {
$this->do_backstretch_image_things();
} else {
@@ -303,6 +311,11 @@ class Display_Featured_Image_Genesis_Output {
*/
protected function move_excerpts() {
$move_excerpts = $this->displaysetting['move_excerpts'];
/**
* Creates display_featured_image_genesis_omit_excerpt filter to check
* whether get_post_type array should not move excerpts for this post type.
* @uses is_in_array()
*/
if ( $move_excerpts && ! Display_Featured_Image_Genesis_Common::is_in_array( 'omit_excerpt' ) ) {
return true;
}
@@ -316,7 +329,11 @@ class Display_Featured_Image_Genesis_Output {
*/
protected function move_title() {
$keep_titles = $this->displaysetting['keep_titles'];
// if titles will be moved to overlay backstretch image
/**
* Creates display_featured_image_genesis_do_not_move_titles filter to check
* whether get_post_type array should not move titles to overlay the featured image.
* @uses is_in_array()
*/
if ( ! $keep_titles && ! Display_Featured_Image_Genesis_Common::is_in_array( 'do_not_move_titles' ) ) {
return true;
}
@@ -16,6 +16,66 @@
*/
class Display_Featured_Image_Genesis {
/**
* Admin area class: handles columns.
* @var Display_Featured_Image_Genesis_Admin $admin
*/
protected $admin;
/**
* Adds new author meta.
* @var Display_Featured_Image_Genesis_Author $author
*/
protected $author;
/**
* Common class: sets image ID, post title, handles database query
* @var Display_Featured_Image_Genesis_Common $common
*/
protected $common;
/**
* All archive description functions.
* @var Display_Featured_Image_Genesis_Description $description
*/
protected $description;
/**
* Handles all image output functionality
* @var Display_Featured_Image_Genesis_Output $output
*/
protected $output;
/**
* Handles RSS feed output
* @var Display_Featured_Image_Genesis_RSS $rss
*/
protected $rss;
/**
* Sets up settings page for the plugin.
* @var Display_Featured_Image_Genesis_Settings $settings
*/
protected $settings;
/**
* Handles term meta.
* @var Display_Featured_Image_Genesis_Taxonomies $taxonomies
*/
protected $taxonomies;
/**
* Display_Featured_Image_Genesis constructor.
*
* @param $admin
* @param $author
* @param $common
* @param $description
* @param $output
* @param $rss
* @param $settings
* @param $taxonomies
*/
function __construct( $admin, $author, $common, $description, $output, $rss, $settings, $taxonomies ) {
$this->admin = $admin;
$this->author = $author;
@@ -27,6 +87,9 @@ class Display_Featured_Image_Genesis {
$this->taxonomies = $taxonomies;
}
/**
* Main plugin function. Starts up all the things.
*/
public function run() {
if ( 'genesis' !== basename( get_template_directory() ) ) {
add_action( 'admin_init', array( $this, 'deactivate' ) );