From 8e75c8572c02fc0254a0f8dfae47dabbb5d6527e Mon Sep 17 00:00:00 2001 From: Robin Cornett Date: Tue, 31 Oct 2017 17:46:44 -0400 Subject: [PATCH] Change method to get backstretch width --- ...ass-displayfeaturedimagegenesis-output.php | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/includes/class-displayfeaturedimagegenesis-output.php b/includes/class-displayfeaturedimagegenesis-output.php index 8b44dbf..c9099a4 100644 --- a/includes/class-displayfeaturedimagegenesis-output.php +++ b/includes/class-displayfeaturedimagegenesis-output.php @@ -62,7 +62,7 @@ class Display_Featured_Image_Genesis_Output { } add_filter( 'body_class', array( $this, 'add_body_class' ) ); - $large = $common->minimum_backstretch_width(); + $large = $this->get_minimum_backstretch_width(); $item = $this->get_item(); $width = absint( $item->backstretch[1] ); /** @@ -100,10 +100,9 @@ class Display_Featured_Image_Genesis_Output { if ( ! $this->can_do_things() ) { return $classes; } - $common = $this->get_common_class(); - $large = $common->minimum_backstretch_width(); - $item = $this->get_item(); - $width = (int) $item->backstretch[1]; + $large = $this->get_minimum_backstretch_width(); + $item = $this->get_item(); + $width = (int) $item->backstretch[1]; if ( false === $item->content || ! is_singular() ) { if ( $width > $large ) { $classes[] = 'has-leader'; @@ -494,6 +493,16 @@ class Display_Featured_Image_Genesis_Output { return $this->item; } + /** + * Get the minimum acceptable backstretch width. + * + * @return int + */ + protected function get_minimum_backstretch_width() { + $common = $this->get_common_class(); + return $common->minimum_backstretch_width(); + } + /** * Define the hooks/priorities for image output. *