updated plugin GP Premium
version 1.10.0
This commit is contained in:
@ -537,13 +537,33 @@ if ( ! function_exists( 'generate_blog_customize_register' ) ) {
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_setting(
|
||||
'generate_blog_settings[post_image_size]',
|
||||
array(
|
||||
'default' => $defaults['post_image_size'],
|
||||
'type' => 'option',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_choices',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
'generate_blog_settings[post_image_size]',
|
||||
array(
|
||||
'type' => 'select',
|
||||
'label' => __( 'Media Attachment Size', 'gp-premium' ),
|
||||
'section' => 'generate_blog_section',
|
||||
'choices' => generate_blog_get_image_sizes(),
|
||||
'settings' => 'generate_blog_settings[post_image_size]',
|
||||
'active_callback' => 'generate_premium_featured_image_active',
|
||||
)
|
||||
);
|
||||
|
||||
// Width
|
||||
$wp_customize->add_setting(
|
||||
'generate_blog_settings[post_image_width]', array(
|
||||
'default' => $defaults['post_image_width'],
|
||||
'capability' => 'edit_theme_options',
|
||||
'type' => 'option',
|
||||
'transport' => 'postMessage',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_empty_absint',
|
||||
)
|
||||
);
|
||||
@ -554,11 +574,6 @@ if ( ! function_exists( 'generate_blog_customize_register' ) ) {
|
||||
'type' => 'number',
|
||||
'label' => __( 'Width', 'gp-premium' ),
|
||||
'section' => 'generate_blog_section',
|
||||
'input_attrs' => array(
|
||||
'style' => 'text-align:center;',
|
||||
'placeholder' => __( 'Auto', 'gp-premium' ),
|
||||
'min' => 5,
|
||||
),
|
||||
'settings' => 'generate_blog_settings[post_image_width]',
|
||||
'active_callback' => 'generate_premium_featured_image_active',
|
||||
)
|
||||
@ -570,7 +585,6 @@ if ( ! function_exists( 'generate_blog_customize_register' ) ) {
|
||||
'default' => $defaults['post_image_height'],
|
||||
'capability' => 'edit_theme_options',
|
||||
'type' => 'option',
|
||||
'transport' => 'postMessage',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_empty_absint',
|
||||
)
|
||||
);
|
||||
@ -581,24 +595,21 @@ if ( ! function_exists( 'generate_blog_customize_register' ) ) {
|
||||
'type' => 'number',
|
||||
'label' => __( 'Height', 'gp-premium' ),
|
||||
'section' => 'generate_blog_section',
|
||||
'input_attrs' => array(
|
||||
'style' => 'text-align:center;',
|
||||
'placeholder' => __( 'Auto', 'gp-premium' ),
|
||||
'min' => 5,
|
||||
),
|
||||
'settings' => 'generate_blog_settings[post_image_height]',
|
||||
'active_callback' => 'generate_premium_featured_image_active',
|
||||
)
|
||||
);
|
||||
|
||||
// Save dimensions
|
||||
$wp_customize->add_control(
|
||||
new GeneratePress_Refresh_Button_Customize_Control(
|
||||
new GeneratePress_Information_Customize_Control(
|
||||
$wp_customize,
|
||||
'post_image_apply_sizes',
|
||||
'generate_regenerate_images_notice',
|
||||
array(
|
||||
'section' => 'generate_blog_section',
|
||||
'label' => __( 'Apply', 'gp-premium' ),
|
||||
'section' => 'generate_blog_section',
|
||||
'description' => sprintf(
|
||||
__( 'We will attempt to serve exact image sizes based on your width/height settings. If that is not possible, we will resize your images using CSS. Learn more about featured image sizing %s.', 'gp-premium' ),
|
||||
'<a href="https://docs.generatepress.com/article/adjusting-the-featured-images/" target="_blank" rel="noopener noreferrer">' . __( 'here', 'gp-premium' ) . '</a>'
|
||||
),
|
||||
'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname',
|
||||
'active_callback' => 'generate_premium_featured_image_active',
|
||||
)
|
||||
@ -701,13 +712,33 @@ if ( ! function_exists( 'generate_blog_customize_register' ) ) {
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_setting(
|
||||
'generate_blog_settings[single_post_image_size]',
|
||||
array(
|
||||
'default' => $defaults['single_post_image_size'],
|
||||
'type' => 'option',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_choices',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
'generate_blog_settings[single_post_image_size]',
|
||||
array(
|
||||
'type' => 'select',
|
||||
'label' => __( 'Media Attachment Size', 'gp-premium' ),
|
||||
'section' => 'generate_blog_section',
|
||||
'choices' => generate_blog_get_image_sizes(),
|
||||
'settings' => 'generate_blog_settings[single_post_image_size]',
|
||||
'active_callback' => 'generate_premium_featured_image_active',
|
||||
)
|
||||
);
|
||||
|
||||
// Width
|
||||
$wp_customize->add_setting(
|
||||
'generate_blog_settings[single_post_image_width]', array(
|
||||
'default' => $defaults['single_post_image_width'],
|
||||
'capability' => 'edit_theme_options',
|
||||
'type' => 'option',
|
||||
'transport' => 'postMessage',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_empty_absint',
|
||||
)
|
||||
);
|
||||
@ -718,13 +749,8 @@ if ( ! function_exists( 'generate_blog_customize_register' ) ) {
|
||||
'type' => 'number',
|
||||
'label' => __( 'Width', 'gp-premium' ),
|
||||
'section' => 'generate_blog_section',
|
||||
'input_attrs' => array(
|
||||
'style' => 'text-align:center;',
|
||||
'placeholder' => __( 'Auto', 'gp-premium' ),
|
||||
'min' => 5,
|
||||
),
|
||||
'settings' => 'generate_blog_settings[single_post_image_width]',
|
||||
'active_callback' => 'generate_premium_single_featured_image_active',
|
||||
'active_callback' => 'generate_premium_featured_image_active',
|
||||
)
|
||||
);
|
||||
|
||||
@ -734,7 +760,6 @@ if ( ! function_exists( 'generate_blog_customize_register' ) ) {
|
||||
'default' => $defaults['single_post_image_height'],
|
||||
'capability' => 'edit_theme_options',
|
||||
'type' => 'option',
|
||||
'transport' => 'postMessage',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_empty_absint',
|
||||
)
|
||||
);
|
||||
@ -745,26 +770,23 @@ if ( ! function_exists( 'generate_blog_customize_register' ) ) {
|
||||
'type' => 'number',
|
||||
'label' => __( 'Height', 'gp-premium' ),
|
||||
'section' => 'generate_blog_section',
|
||||
'input_attrs' => array(
|
||||
'style' => 'text-align:center;',
|
||||
'placeholder' => __( 'Auto', 'gp-premium' ),
|
||||
'min' => 5,
|
||||
),
|
||||
'settings' => 'generate_blog_settings[single_post_image_height]',
|
||||
'active_callback' => 'generate_premium_single_featured_image_active',
|
||||
'active_callback' => 'generate_premium_featured_image_active',
|
||||
)
|
||||
);
|
||||
|
||||
// Save dimensions
|
||||
$wp_customize->add_control(
|
||||
new GeneratePress_Refresh_Button_Customize_Control(
|
||||
new GeneratePress_Information_Customize_Control(
|
||||
$wp_customize,
|
||||
'single_post_image_apply_sizes',
|
||||
'generate_regenerate_single_post_images_notice',
|
||||
array(
|
||||
'section' => 'generate_blog_section',
|
||||
'label' => __( 'Apply', 'gp-premium' ),
|
||||
'section' => 'generate_blog_section',
|
||||
'description' => sprintf(
|
||||
__( 'We will attempt to serve exact image sizes based on your width/height settings. If that is not possible, we will resize your images using CSS. Learn more about featured image sizing %s.', 'gp-premium' ),
|
||||
'<a href="https://docs.generatepress.com/article/adjusting-the-featured-images/" target="_blank" rel="noopener noreferrer">' . __( 'here', 'gp-premium' ) . '</a>'
|
||||
),
|
||||
'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname',
|
||||
'active_callback' => 'generate_premium_single_featured_image_active',
|
||||
'active_callback' => 'generate_premium_featured_image_active',
|
||||
)
|
||||
)
|
||||
);
|
||||
@ -865,13 +887,33 @@ if ( ! function_exists( 'generate_blog_customize_register' ) ) {
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_setting(
|
||||
'generate_blog_settings[page_post_image_size]',
|
||||
array(
|
||||
'default' => $defaults['page_post_image_size'],
|
||||
'type' => 'option',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_choices',
|
||||
)
|
||||
);
|
||||
|
||||
$wp_customize->add_control(
|
||||
'generate_blog_settings[page_post_image_size]',
|
||||
array(
|
||||
'type' => 'select',
|
||||
'label' => __( 'Media Attachment Size', 'gp-premium' ),
|
||||
'section' => 'generate_blog_section',
|
||||
'choices' => generate_blog_get_image_sizes(),
|
||||
'settings' => 'generate_blog_settings[page_post_image_size]',
|
||||
'active_callback' => 'generate_premium_featured_image_active',
|
||||
)
|
||||
);
|
||||
|
||||
// Width
|
||||
$wp_customize->add_setting(
|
||||
'generate_blog_settings[page_post_image_width]', array(
|
||||
'default' => $defaults['page_post_image_width'],
|
||||
'capability' => 'edit_theme_options',
|
||||
'type' => 'option',
|
||||
'transport' => 'postMessage',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_empty_absint',
|
||||
)
|
||||
);
|
||||
@ -882,13 +924,8 @@ if ( ! function_exists( 'generate_blog_customize_register' ) ) {
|
||||
'type' => 'number',
|
||||
'label' => __( 'Width', 'gp-premium' ),
|
||||
'section' => 'generate_blog_section',
|
||||
'input_attrs' => array(
|
||||
'style' => 'text-align:center;',
|
||||
'placeholder' => __( 'Auto', 'gp-premium' ),
|
||||
'min' => 5,
|
||||
),
|
||||
'settings' => 'generate_blog_settings[page_post_image_width]',
|
||||
'active_callback' => 'generate_premium_single_page_featured_image_active',
|
||||
'active_callback' => 'generate_premium_featured_image_active',
|
||||
)
|
||||
);
|
||||
|
||||
@ -898,7 +935,6 @@ if ( ! function_exists( 'generate_blog_customize_register' ) ) {
|
||||
'default' => $defaults['page_post_image_height'],
|
||||
'capability' => 'edit_theme_options',
|
||||
'type' => 'option',
|
||||
'transport' => 'postMessage',
|
||||
'sanitize_callback' => 'generate_premium_sanitize_empty_absint',
|
||||
)
|
||||
);
|
||||
@ -909,26 +945,23 @@ if ( ! function_exists( 'generate_blog_customize_register' ) ) {
|
||||
'type' => 'number',
|
||||
'label' => __( 'Height', 'gp-premium' ),
|
||||
'section' => 'generate_blog_section',
|
||||
'input_attrs' => array(
|
||||
'style' => 'text-align:center;',
|
||||
'placeholder' => __( 'Auto', 'gp-premium' ),
|
||||
'min' => 5,
|
||||
),
|
||||
'settings' => 'generate_blog_settings[page_post_image_height]',
|
||||
'active_callback' => 'generate_premium_single_page_featured_image_active',
|
||||
'active_callback' => 'generate_premium_featured_image_active',
|
||||
)
|
||||
);
|
||||
|
||||
// Save dimensions
|
||||
$wp_customize->add_control(
|
||||
new GeneratePress_Refresh_Button_Customize_Control(
|
||||
new GeneratePress_Information_Customize_Control(
|
||||
$wp_customize,
|
||||
'page_post_image_apply_sizes',
|
||||
'generate_regenerate_page_images_notice',
|
||||
array(
|
||||
'section' => 'generate_blog_section',
|
||||
'label' => __( 'Apply', 'gp-premium' ),
|
||||
'section' => 'generate_blog_section',
|
||||
'description' => sprintf(
|
||||
__( 'We will attempt to serve exact image sizes based on your width/height settings. If that is not possible, we will resize your images using CSS. Learn more about featured image sizing %s.', 'gp-premium' ),
|
||||
'<a href="https://docs.generatepress.com/article/adjusting-the-featured-images/" target="_blank" rel="noopener noreferrer">' . __( 'here', 'gp-premium' ) . '</a>'
|
||||
),
|
||||
'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname',
|
||||
'active_callback' => 'generate_premium_single_page_featured_image_active',
|
||||
'active_callback' => 'generate_premium_featured_image_active',
|
||||
)
|
||||
)
|
||||
);
|
||||
@ -1042,34 +1075,6 @@ add_action( 'customize_controls_print_styles', 'generate_blog_customizer_control
|
||||
function generate_blog_customizer_controls_css() {
|
||||
?>
|
||||
<style>
|
||||
#customize-control-generate_blog_settings-post_image_width:not([style*="display: none;"]),
|
||||
#customize-control-generate_blog_settings-post_image_height:not([style*="display: none;"]),
|
||||
#customize-control-post_image_apply_sizes:not([style*="display: none;"]),
|
||||
#customize-control-generate_blog_settings-single_post_image_width:not([style*="display: none;"]),
|
||||
#customize-control-generate_blog_settings-single_post_image_height:not([style*="display: none;"]),
|
||||
#customize-control-single_post_image_apply_sizes:not([style*="display: none;"]),
|
||||
#customize-control-generate_blog_settings-page_post_image_width:not([style*="display: none;"]),
|
||||
#customize-control-generate_blog_settings-page_post_image_height:not([style*="display: none;"]),
|
||||
#customize-control-page_post_image_apply_sizes:not([style*="display: none;"]) {
|
||||
display: inline-block !important;
|
||||
width: 30%;
|
||||
clear: none;
|
||||
vertical-align: bottom;
|
||||
float: none;
|
||||
}
|
||||
|
||||
#customize-control-post_image_apply_sizes,
|
||||
#customize-control-single_post_image_apply_sizes,
|
||||
#customize-control-page_post_image_apply_sizes {
|
||||
margin-left: 1%;
|
||||
}
|
||||
|
||||
#customize-control-generate_blog_settings-post_image_width,
|
||||
#customize-control-generate_blog_settings-single_post_image_width,
|
||||
#customize-control-generate_blog_settings-page_post_image_width {
|
||||
margin-right: 2px;
|
||||
}
|
||||
|
||||
#customize-control-generate_blog_settings-post_image_width .customize-control-title:after,
|
||||
#customize-control-generate_blog_settings-post_image_height .customize-control-title:after,
|
||||
#customize-control-generate_blog_settings-single_post_image_width .customize-control-title:after,
|
||||
@ -1088,6 +1093,12 @@ function generate_blog_customizer_controls_css() {
|
||||
line-height: 18px;
|
||||
margin-left: 5px
|
||||
}
|
||||
|
||||
#customize-control-generate_regenerate_images_notice p,
|
||||
#customize-control-generate_regenerate_single_post_images_notice p,
|
||||
#customize-control-generate_regenerate_page_images_notice p {
|
||||
margin-top: 0;
|
||||
}
|
||||
</style>
|
||||
<?php
|
||||
}
|
||||
|
@ -20,18 +20,21 @@ if ( ! function_exists( 'generate_blog_get_defaults' ) ) {
|
||||
'post_image' => true,
|
||||
'post_image_position' => '',
|
||||
'post_image_alignment' => 'post-image-aligned-center',
|
||||
'post_image_size' => 'full',
|
||||
'post_image_width' => '',
|
||||
'post_image_height' => '',
|
||||
'post_image_padding' => true,
|
||||
'single_post_image' => true,
|
||||
'single_post_image_position' => 'inside-content',
|
||||
'single_post_image_alignment' => 'center',
|
||||
'single_post_image_size' => 'full',
|
||||
'single_post_image_width' => '',
|
||||
'single_post_image_height' => '',
|
||||
'single_post_image_padding' => true,
|
||||
'page_post_image' => true,
|
||||
'page_post_image_position' => 'above-content',
|
||||
'page_post_image_alignment' => 'center',
|
||||
'page_post_image_size' => 'full',
|
||||
'page_post_image_width' => '',
|
||||
'page_post_image_height' => '',
|
||||
'page_post_image_padding' => true,
|
||||
@ -47,7 +50,7 @@ if ( ! function_exists( 'generate_blog_get_defaults' ) ) {
|
||||
'single_post_navigation' => true,
|
||||
'column_layout' => false,
|
||||
'columns' => '50',
|
||||
'featured_column' => false
|
||||
'featured_column' => false,
|
||||
);
|
||||
|
||||
return apply_filters( 'generate_blog_option_defaults', $generate_blog_defaults );
|
||||
|
@ -122,6 +122,22 @@ if ( ! function_exists( 'generate_blog_post_classes' ) ) {
|
||||
$classes[] = 'no-featured-image-padding';
|
||||
}
|
||||
|
||||
$atts = generate_get_blog_image_attributes();
|
||||
|
||||
if ( ! is_singular() && has_post_thumbnail() && ! empty( $atts ) ) {
|
||||
$values = array(
|
||||
$atts['width'],
|
||||
$atts['height'],
|
||||
$atts['crop'],
|
||||
);
|
||||
|
||||
$image_src = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID(), 'full' ), $values );
|
||||
|
||||
if ( $image_src && ( ! $image_src[3] || ! apply_filters( 'generate_use_featured_image_size_match', true ) ) ) {
|
||||
$classes[] = 'resize-featured-image';
|
||||
}
|
||||
}
|
||||
|
||||
return $classes;
|
||||
}
|
||||
}
|
||||
@ -288,6 +304,36 @@ if ( ! function_exists( 'generate_blog_css' ) ) {
|
||||
$return .= '}';
|
||||
}
|
||||
|
||||
$atts = generate_get_blog_image_attributes();
|
||||
|
||||
if ( ! empty( $atts ) ) {
|
||||
$image_width = $atts['width'] && 9999 !== $atts['width'] ? 'width: ' . $atts['width'] . 'px;' : '';
|
||||
$image_height = $atts['height'] && 9999 !== $atts['height'] ? 'height: ' . $atts['height'] . 'px;' : '';
|
||||
$image_crop = $atts['crop'] ? '-o-object-fit: cover;object-fit: cover;' : '';
|
||||
|
||||
if ( ! $image_width && $image_height ) {
|
||||
$image_crop = '-o-object-fit: cover;object-fit: cover;';
|
||||
}
|
||||
|
||||
if ( ! is_singular() ) {
|
||||
$return .= '.resize-featured-image .post-image img {' . $image_width . $image_height . $image_crop . '}';
|
||||
}
|
||||
|
||||
if ( is_single() || is_page() ) {
|
||||
$values = array(
|
||||
$atts['width'],
|
||||
$atts['height'],
|
||||
$atts['crop'],
|
||||
);
|
||||
|
||||
$image_src = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID(), 'full' ), $values );
|
||||
|
||||
if ( $image_src && ( ! $image_src[3] || ! apply_filters( 'generate_use_featured_image_size_match', true ) ) ) {
|
||||
$return .= '.featured-image img {' . $image_width . $image_height . $image_crop . '}';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,73 @@
|
||||
<?php
|
||||
defined( 'WPINC' ) or die;
|
||||
|
||||
if ( ! defined( 'GP_IMAGE_RESIZER' ) ) {
|
||||
require_once GP_LIBRARY_DIRECTORY . 'image-processing-queue/image-processing-queue.php';
|
||||
/**
|
||||
* Collects all available image sizes which we use in the Customizer.
|
||||
*
|
||||
* @since 1.10.0
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function generate_blog_get_image_sizes() {
|
||||
$sizes = get_intermediate_image_sizes();
|
||||
|
||||
$new_sizes = array(
|
||||
'full' => 'full',
|
||||
);
|
||||
|
||||
foreach ( $sizes as $key => $name ) {
|
||||
$new_sizes[ $name ] = $name;
|
||||
}
|
||||
|
||||
return $new_sizes;
|
||||
}
|
||||
|
||||
add_filter( 'generate_page_header_default_size', 'generate_blog_set_featured_image_size' );
|
||||
/**
|
||||
* Set our featured image sizes.
|
||||
*
|
||||
* @since 1.10.0
|
||||
*
|
||||
* @param string $size The existing size.
|
||||
* @return string The new size.
|
||||
*/
|
||||
function generate_blog_set_featured_image_size( $size ) {
|
||||
$settings = wp_parse_args(
|
||||
get_option( 'generate_blog_settings', array() ),
|
||||
generate_blog_get_defaults()
|
||||
);
|
||||
|
||||
if ( ! is_singular() ) {
|
||||
$size = $settings['post_image_size'];
|
||||
}
|
||||
|
||||
if ( is_single() ) {
|
||||
$size = $settings['single_post_image_size'];
|
||||
}
|
||||
|
||||
if ( is_page() ) {
|
||||
$size = $settings['page_post_image_size'];
|
||||
}
|
||||
|
||||
$atts = generate_get_blog_image_attributes();
|
||||
|
||||
if ( ! empty( $atts ) ) {
|
||||
$values = array(
|
||||
$atts['width'],
|
||||
$atts['height'],
|
||||
$atts['crop'],
|
||||
);
|
||||
|
||||
$image_src = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID(), 'full' ), $values );
|
||||
|
||||
if ( $image_src && $image_src[3] && apply_filters( 'generate_use_featured_image_size_match', true ) ) {
|
||||
return $values;
|
||||
} else {
|
||||
return $size;
|
||||
}
|
||||
}
|
||||
|
||||
return $size;
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'generate_get_blog_image_attributes' ) ) {
|
||||
@ -110,7 +175,7 @@ if ( ! function_exists( 'generate_blog_setup' ) ) {
|
||||
|
||||
add_filter( 'generate_featured_image_output', 'generate_blog_featured_image' );
|
||||
/**
|
||||
* Filter our core featured image so we can include support for resized images.
|
||||
* Remove featured image if set or using WooCommerce.
|
||||
*
|
||||
* @since 1.5
|
||||
* @return string The image HTML
|
||||
@ -121,35 +186,11 @@ function generate_blog_featured_image( $output ) {
|
||||
generate_blog_get_defaults()
|
||||
);
|
||||
|
||||
$image_atts = generate_get_blog_image_attributes();
|
||||
$image_id = get_post_thumbnail_id( get_the_ID(), 'full' );
|
||||
|
||||
if ( ( function_exists( 'is_woocommerce' ) && is_woocommerce() ) || ! $settings['post_image'] ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( $image_atts && function_exists( 'ipq_get_theme_image' ) ) {
|
||||
$image_html = ipq_get_theme_image( $image_id,
|
||||
array(
|
||||
array( $image_atts[ 'width' ], $image_atts[ 'height' ], $image_atts[ 'crop' ] )
|
||||
),
|
||||
array(
|
||||
'itemprop' => 'image',
|
||||
)
|
||||
);
|
||||
} else {
|
||||
return $output;
|
||||
}
|
||||
|
||||
return apply_filters( 'generate_resized_featured_image_output', sprintf(
|
||||
'<div class="post-image">
|
||||
<a href="%1$s">
|
||||
%2$s
|
||||
</a>
|
||||
</div>',
|
||||
esc_url( get_permalink() ),
|
||||
$image_html
|
||||
), $image_html );
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -168,7 +209,6 @@ function generate_blog_single_featured_image() {
|
||||
generate_blog_get_defaults()
|
||||
);
|
||||
|
||||
$image_atts = generate_get_blog_image_attributes();
|
||||
$image_id = get_post_thumbnail_id( get_the_ID(), 'full' );
|
||||
|
||||
if ( function_exists( 'generate_page_header_get_image' ) && generate_page_header_get_image( 'ID' ) ) {
|
||||
@ -183,32 +223,17 @@ function generate_blog_single_featured_image() {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( $image_atts && function_exists( 'ipq_get_theme_image' ) ) {
|
||||
|
||||
$image_html = ipq_get_theme_image( $image_id,
|
||||
array(
|
||||
array( $image_atts[ 'width' ], $image_atts[ 'height' ], $image_atts[ 'crop' ] )
|
||||
),
|
||||
$image_html = apply_filters( 'post_thumbnail_html',
|
||||
wp_get_attachment_image( $image_id, apply_filters( 'generate_page_header_default_size', 'full' ), '',
|
||||
array(
|
||||
'itemprop' => 'image',
|
||||
)
|
||||
);
|
||||
|
||||
} else {
|
||||
|
||||
$image_html = apply_filters( 'post_thumbnail_html',
|
||||
wp_get_attachment_image( $image_id, apply_filters( 'generate_page_header_default_size', 'full' ), '',
|
||||
array(
|
||||
'itemprop' => 'image',
|
||||
)
|
||||
),
|
||||
get_the_ID(),
|
||||
$image_id,
|
||||
apply_filters( 'generate_page_header_default_size', 'full' ),
|
||||
''
|
||||
);
|
||||
|
||||
}
|
||||
),
|
||||
get_the_ID(),
|
||||
$image_id,
|
||||
apply_filters( 'generate_page_header_default_size', 'full' ),
|
||||
''
|
||||
);
|
||||
|
||||
$location = generate_blog_get_singular_template();
|
||||
|
||||
|
@ -5,9 +5,10 @@ jQuery( document ).ready( function($) {
|
||||
'generate_blog_settings-post_image_padding',
|
||||
'generate_blog_settings-post_image_position',
|
||||
'generate_blog_settings-post_image_alignment',
|
||||
'generate_blog_settings-post_image_size',
|
||||
'generate_blog_settings-post_image_width',
|
||||
'generate_blog_settings-post_image_height',
|
||||
'post_image_apply_sizes',
|
||||
'generate_regenerate_images_notice',
|
||||
];
|
||||
|
||||
$.each( featured_image_archive_controls, function( index, value ) {
|
||||
@ -19,9 +20,10 @@ jQuery( document ).ready( function($) {
|
||||
'generate_blog_settings-single_post_image_padding',
|
||||
'generate_blog_settings-single_post_image_position',
|
||||
'generate_blog_settings-single_post_image_alignment',
|
||||
'generate_blog_settings-single_post_image_size',
|
||||
'generate_blog_settings-single_post_image_width',
|
||||
'generate_blog_settings-single_post_image_height',
|
||||
'single_post_image_apply_sizes',
|
||||
'generate_regenerate_single_post_images_notice',
|
||||
];
|
||||
|
||||
$.each( featured_image_single_controls, function( index, value ) {
|
||||
@ -39,9 +41,10 @@ jQuery( document ).ready( function($) {
|
||||
'generate_blog_settings-page_post_image_padding',
|
||||
'generate_blog_settings-page_post_image_position',
|
||||
'generate_blog_settings-page_post_image_alignment',
|
||||
'generate_blog_settings-page_post_image_size',
|
||||
'generate_blog_settings-page_post_image_width',
|
||||
'generate_blog_settings-page_post_image_height',
|
||||
'page_post_image_apply_sizes',
|
||||
'generate_regenerate_page_images_notice',
|
||||
];
|
||||
|
||||
$.each( featured_image_page_controls, function( index, value ) {
|
||||
|
Reference in New Issue
Block a user