mirror of
https://github.com/10h30/display-featured-image-genesis.git
synced 2026-07-18 14:03:20 +09:00
add filter for minimum backstretch width
This commit is contained in:
@@ -224,4 +224,18 @@ class Display_Featured_Image_Genesis_Common {
|
||||
return $attachment_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* add a filter to change the minimum width required for backstretch image
|
||||
* @return integer sets the minimum width for backstretch effect
|
||||
*
|
||||
* @since 2.2.0
|
||||
*/
|
||||
public static function minimum_backstretch_width() {
|
||||
$large = apply_filters( 'display_featured_image_genesis_set_minimum_backstretch_width', get_option( 'large_size_w' ) );
|
||||
if ( ! is_numeric( $large ) ) {
|
||||
$large = get_option( 'large_size_w' );
|
||||
}
|
||||
return absint( intval( $large ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ class Display_Featured_Image_Genesis_Output {
|
||||
|
||||
$version = Display_Featured_Image_Genesis_Common::$version;
|
||||
$item = Display_Featured_Image_Genesis_Common::get_image_variables();
|
||||
$large = absint( get_option( 'large_size_w' ) );
|
||||
$large = Display_Featured_Image_Genesis_Common::minimum_backstretch_width();
|
||||
$medium = absint( get_option( 'medium_size_w' ) );
|
||||
$width = absint( $item->backstretch[1] );
|
||||
|
||||
@@ -98,7 +98,7 @@ class Display_Featured_Image_Genesis_Output {
|
||||
public function add_body_class( $classes ) {
|
||||
|
||||
$item = Display_Featured_Image_Genesis_Common::get_image_variables();
|
||||
$large = absint( get_option( 'large_size_w' ) );
|
||||
$large = Display_Featured_Image_Genesis_Common::minimum_backstretch_width();
|
||||
$medium = absint( get_option( 'medium_size_w' ) );
|
||||
$width = absint( $item->backstretch[1] );
|
||||
|
||||
|
||||
@@ -208,7 +208,7 @@ class Display_Featured_Image_Genesis_Settings {
|
||||
public function set_default_image() {
|
||||
|
||||
$item = Display_Featured_Image_Genesis_Common::get_image_variables();
|
||||
$large = absint( get_option( 'large_size_w' ) );
|
||||
$large = Display_Featured_Image_Genesis_Common::minimum_backstretch_width();
|
||||
|
||||
if ( ! empty( $this->displaysetting['default'] ) ) {
|
||||
$preview = wp_get_attachment_image_src( $item->fallback_id, 'medium' );
|
||||
@@ -388,13 +388,13 @@ class Display_Featured_Image_Genesis_Settings {
|
||||
|
||||
$new_value = esc_url( $new_value );
|
||||
$valid = $this->is_valid_img_ext( $new_value );
|
||||
$large = get_option( 'large_size_w' );
|
||||
$large = Display_Featured_Image_Genesis_Common::minimum_backstretch_width();
|
||||
$id = Display_Featured_Image_Genesis_Common::get_image_id( $new_value );
|
||||
$source = wp_get_attachment_image_src( $id, 'displayfeaturedimage_backstretch' );
|
||||
$width = $source[1];
|
||||
$reset = __( ' The Default Featured Image has been reset to the last valid setting.', 'display-featured-image-genesis' );
|
||||
|
||||
//* ok for field to be empty
|
||||
// ok for field to be empty
|
||||
if ( $new_value ) {
|
||||
|
||||
if ( ! $valid ) {
|
||||
@@ -566,7 +566,7 @@ class Display_Featured_Image_Genesis_Settings {
|
||||
*/
|
||||
public function help() {
|
||||
$screen = get_current_screen();
|
||||
$large = get_option( 'large_size_w' );
|
||||
$large = Display_Featured_Image_Genesis_Common::minimum_backstretch_width();
|
||||
|
||||
$height_help =
|
||||
'<h3>' . __( 'Height', 'display-featured-image-genesis' ) . '</h3>' .
|
||||
|
||||
Reference in New Issue
Block a user