Change method to get backstretch width

This commit is contained in:
Robin Cornett
2017-10-31 17:46:44 -04:00
parent 1066d96d54
commit 8e75c8572c
@@ -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.
*