updated plugin `GP Premium` version 1.10.0

This commit is contained in:
KawaiiPunk 2020-05-04 15:57:08 +00:00 committed by Gitium
parent bedbe7cc3f
commit 6a7ce488aa
68 changed files with 483 additions and 39245 deletions

View File

@ -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
}

View File

@ -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 );

View File

@ -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;
}
}

View File

@ -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();

View File

@ -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 ) {

View File

@ -1,5 +1,32 @@
== changelog ==
= 1.10.0 =
* Blog: Remove existing on-the-fly featured image resizer (Image Processing Queue)
* Blog: Choose from existing image sizes for featured images
* Blog: Use CSS to further resize featured images if necessary
* Blog: Fix edge case persistent transient bug with old image resizer
* Elements: Fix broken closing element in metabox
* General: Change scroll variable to gpscroll in smooth scroll script to avoid conflicts
* General: Update responsive widths in Customizer
* General: Fix responsive Customizer views when using RTL
* Menu Plus: Don't output sticky nav branding if sticky nav is disabled
* Menu Plus: Fix focus when off canvas overlay is opened (a11y)
* Menu Plus: Fix sticky navigation jump when navigation branding is in use
* Sections: Fix visible block editor when Sections are enabled
* WooCommerce: Use minmax in grid template definitions to fix overflow issue
* WooCommerce: Prevent add to cart panel interfering with back to top button on mobile
* WooCommerce: WooCommerce: Fix secondary image position if HTML isn't ordered correctly
* General: Add/update all translations over 50% complete. Big thanks to all contributors!
* Translation: Added Arabic - thank you anass!
* Translation: Added Bengali - thank you gtmroy!
* Translation: Added Spanish (Spain) - thank you davidperez (closemarketing.es)!
* Translation: Added Spanish (Argentina) - thank you bratorr!
* Translation: Added Finnish - thank you Stedi!
* Translation: Add Dutch - thank you Robin!
* Translation: Added Ukrainian - thank you EUROMEDIA!
* Translation: Vietnamese added - thank you themevi!
= 1.9.1 =
* Blog: Fix "null" in infinite scroll load more button text
* WooCommerce: Fix hidden added to cart panel on mobile when sticky nav active

View File

@ -101,7 +101,7 @@ class GeneratePress_Hero {
wp_add_inline_style( 'generate-style', self::build_css() );
if ( $options['parallax'] ) {
wp_enqueue_script( 'generate-hero-parallax', plugin_dir_url( __FILE__ ) . '/assets/js/parallax.min.js', array(), GP_PREMIUM_VERSION, true );
wp_enqueue_script( 'generate-hero-parallax', plugin_dir_url( __FILE__ ) . 'assets/js/parallax.min.js', array(), GP_PREMIUM_VERSION, true );
wp_localize_script( 'generate-hero-parallax', 'hero', array(
'parallax' => apply_filters( 'generate_hero_parallax_speed', 2 ),
) );

View File

@ -1077,7 +1077,7 @@ class GeneratePress_Elements_Metabox {
<input type="checkbox" name="_generate_disable_footer" id="_generate_disable_footer" value="true" <?php checked( get_post_meta( get_the_ID(), '_generate_disable_footer', true ), 'true' ); ?> />
</td>
</tr>
</body>
</tbody>
</table>
<table class="generate-elements-settings" data-type="layout" data-tab="content">

View File

@ -23,10 +23,15 @@ function generate_premium_do_elements() {
'post_status' => 'publish',
'numberposts' => 500,
'fields' => 'ids',
'order' => 'ASC',
'suppress_filters' => false,
);
$custom_args = apply_filters( 'generate_elements_custom_args', array(
'order' => 'ASC',
) );
$args = array_merge( $args, $custom_args );
// Prevent Polylang from altering the query.
if ( function_exists( 'pll_get_post_language' ) ) {
$args['lang'] = '';

View File

@ -706,7 +706,7 @@ if (window.Element && !Element.prototype.closest) {
}));
/* GP */
var scroll = new SmoothScroll( smooth.elements.join(), {
var gpscroll = new SmoothScroll( smooth.elements.join(), {
speed: smooth.duration,
offset: function( anchor, toggle ) {
var body = document.body,

File diff suppressed because one or more lines are too long

View File

@ -3,7 +3,7 @@
Plugin Name: GP Premium
Plugin URI: https://generatepress.com
Description: The entire collection of GeneratePress premium modules.
Version: 1.9.1
Version: 1.10.0
Author: Tom Usborne
Author URI: https://generatepress.com
License: GNU General Public License v2 or later
@ -16,7 +16,7 @@ if ( ! defined( 'ABSPATH' ) ) {
}
// Set our version
define( 'GP_PREMIUM_VERSION', '1.9.1' );
define( 'GP_PREMIUM_VERSION', '1.10.0' );
// Set our library directory
define( 'GP_LIBRARY_DIRECTORY', plugin_dir_path( __FILE__ ) . 'library/' );

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
msgid ""
msgstr ""
"Project-Id-Version: GP Premium\n"
"POT-Creation-Date: 2019-11-06 11:02-0800\n"
"POT-Creation-Date: 2020-04-06 11:59-0700\n"
"PO-Revision-Date: 2016-10-01 21:24-0700\n"
"Last-Translator: \n"
"Language-Team: \n"
@ -220,7 +220,7 @@ msgstr ""
#: disable-elements/functions/functions.php:163
#: disable-elements/functions/functions.php:323
#: disable-elements/functions/functions.php:325 elements/class-metabox.php:199
#: elements/class-metabox.php:1074 elements/class-metabox.php:2001
#: elements/class-metabox.php:1074 elements/class-metabox.php:2003
#: library/customizer-helpers.php:205
#: spacing/functions/customizer/footer-spacing.php:12
#: typography/functions/functions.php:2355
@ -345,47 +345,47 @@ msgstr ""
msgid "Pages"
msgstr ""
#: blog/functions/customizer.php:462 blog/functions/customizer.php:625
#: blog/functions/customizer.php:789
#: blog/functions/customizer.php:462 blog/functions/customizer.php:636
#: blog/functions/customizer.php:811
msgid "Display featured images"
msgstr ""
#: blog/functions/customizer.php:482 blog/functions/customizer.php:645
#: blog/functions/customizer.php:809
#: blog/functions/customizer.php:482 blog/functions/customizer.php:656
#: blog/functions/customizer.php:831
msgid "Display padding around images"
msgstr ""
#: blog/functions/customizer.php:503 blog/functions/customizer.php:666
#: blog/functions/customizer.php:830 elements/class-metabox.php:1128
#: blog/functions/customizer.php:503 blog/functions/customizer.php:677
#: blog/functions/customizer.php:852 elements/class-metabox.php:1128
#: elements/class-post-type.php:104 elements/class-post-type.php:114
msgid "Location"
msgstr ""
#: blog/functions/customizer.php:506 blog/functions/customizer.php:669
#: blog/functions/customizer.php:833
#: blog/functions/customizer.php:506 blog/functions/customizer.php:680
#: blog/functions/customizer.php:855
msgid "Below Title"
msgstr ""
#: blog/functions/customizer.php:507 blog/functions/customizer.php:670
#: blog/functions/customizer.php:834
#: blog/functions/customizer.php:507 blog/functions/customizer.php:681
#: blog/functions/customizer.php:856
msgid "Above Title"
msgstr ""
#: blog/functions/customizer.php:528 blog/functions/customizer.php:692
#: blog/functions/customizer.php:856
#: blog/functions/customizer.php:528 blog/functions/customizer.php:703
#: blog/functions/customizer.php:878
msgid "Alignment"
msgstr ""
#: blog/functions/customizer.php:531 blog/functions/customizer.php:695
#: blog/functions/customizer.php:859 elements/class-metabox.php:372
#: blog/functions/customizer.php:531 blog/functions/customizer.php:706
#: blog/functions/customizer.php:881 elements/class-metabox.php:372
#: elements/class-metabox.php:394 secondary-nav/functions/functions.php:284
#: woocommerce/functions/customizer/customizer.php:390
#: woocommerce/functions/customizer/customizer.php:433
msgid "Center"
msgstr ""
#: blog/functions/customizer.php:532 blog/functions/customizer.php:696
#: blog/functions/customizer.php:860 elements/class-metabox.php:371
#: blog/functions/customizer.php:532 blog/functions/customizer.php:707
#: blog/functions/customizer.php:882 elements/class-metabox.php:371
#: elements/class-metabox.php:444 elements/class-metabox.php:482
#: library/customizer/controls/class-spacing-control.php:43
#: menu-plus/functions/generate-menu-plus.php:655
@ -396,8 +396,8 @@ msgstr ""
msgid "Left"
msgstr ""
#: blog/functions/customizer.php:533 blog/functions/customizer.php:697
#: blog/functions/customizer.php:861 elements/class-metabox.php:373
#: blog/functions/customizer.php:533 blog/functions/customizer.php:708
#: blog/functions/customizer.php:883 elements/class-metabox.php:373
#: elements/class-metabox.php:426 elements/class-metabox.php:464
#: library/customizer/controls/class-spacing-control.php:41
#: menu-plus/functions/generate-menu-plus.php:656
@ -408,45 +408,49 @@ msgstr ""
msgid "Right"
msgstr ""
#: blog/functions/customizer.php:555 blog/functions/customizer.php:719
#: blog/functions/customizer.php:883
#: blog/functions/customizer.php:553 blog/functions/customizer.php:728
#: blog/functions/customizer.php:903
msgid "Media Attachment Size"
msgstr ""
#: blog/functions/customizer.php:575 blog/functions/customizer.php:750
#: blog/functions/customizer.php:925
msgid "Width"
msgstr ""
#: blog/functions/customizer.php:559 blog/functions/customizer.php:586
#: blog/functions/customizer.php:723 blog/functions/customizer.php:750
#: blog/functions/customizer.php:887 blog/functions/customizer.php:914
msgid "Auto"
msgstr ""
#: blog/functions/customizer.php:582 blog/functions/customizer.php:746
#: blog/functions/customizer.php:910
#: blog/functions/customizer.php:596 blog/functions/customizer.php:771
#: blog/functions/customizer.php:946
msgid "Height"
msgstr ""
#: blog/functions/customizer.php:601 blog/functions/customizer.php:765
#: blog/functions/customizer.php:929 inc/activation.php:139
#: sections/functions/metaboxes/views/sections-template.php:80
msgid "Apply"
#: blog/functions/customizer.php:610 blog/functions/customizer.php:785
#: blog/functions/customizer.php:960
#, php-format
msgid "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."
msgstr ""
#: blog/functions/customizer.php:671 blog/functions/customizer.php:835
#: blog/functions/customizer.php:611 blog/functions/customizer.php:786
#: blog/functions/customizer.php:961
msgid "here"
msgstr ""
#: blog/functions/customizer.php:682 blog/functions/customizer.php:857
msgid "Above Content Area"
msgstr ""
#: blog/functions/customizer.php:943 blog/functions/customizer.php:983
#: blog/functions/customizer.php:976 blog/functions/customizer.php:1016
msgid "Columns"
msgstr ""
#: blog/functions/customizer.php:963
#: blog/functions/customizer.php:996
msgid "Display posts in columns"
msgstr ""
#: blog/functions/customizer.php:1010
#: blog/functions/customizer.php:1043
msgid "Make first post featured"
msgstr ""
#: blog/functions/customizer.php:1031
#: blog/functions/customizer.php:1064
msgid "Display posts in masonry grid"
msgstr ""
@ -1411,56 +1415,56 @@ msgstr ""
msgid "Scripts & Styles"
msgstr ""
#: elements/class-metabox.php:1983
#: elements/class-metabox.php:1985
msgid "Comments"
msgstr ""
#: elements/class-metabox.php:1992
#: elements/class-metabox.php:1994
#: spacing/functions/customizer/sidebar-spacing.php:12
msgid "Sidebars"
msgstr ""
#: elements/class-metabox.php:2017
#: elements/class-metabox.php:2019
msgid "WooCommerce - Global"
msgstr ""
#: elements/class-metabox.php:2027
#: elements/class-metabox.php:2029
msgid "WooCommerce - Shop"
msgstr ""
#: elements/class-metabox.php:2038
#: elements/class-metabox.php:2040
msgid "WooCommerce - Product"
msgstr ""
#: elements/class-metabox.php:2059
#: elements/class-metabox.php:2061
msgid "WooCommerce - Cart"
msgstr ""
#: elements/class-metabox.php:2081
#: elements/class-metabox.php:2083
msgid "WooCommerce - Checkout"
msgstr ""
#: elements/class-metabox.php:2108
#: elements/class-metabox.php:2110
msgid "WooCommerce - Account"
msgstr ""
#: elements/class-metabox.php:2124
#: elements/class-metabox.php:2126
msgid "The content title of the current post/taxonomy."
msgstr ""
#: elements/class-metabox.php:2129
#: elements/class-metabox.php:2131
msgid "The published date of the current post."
msgstr ""
#: elements/class-metabox.php:2134
#: elements/class-metabox.php:2136
msgid "The author of the current post."
msgstr ""
#: elements/class-metabox.php:2139
#: elements/class-metabox.php:2141
msgid "The terms attached to the chosen taxonomy (category, post_tag, product_cat)."
msgstr ""
#: elements/class-metabox.php:2144
#: elements/class-metabox.php:2146
msgid "Custom post meta. Replace \"name\" with the name of your custom field."
msgstr ""
@ -1475,7 +1479,7 @@ msgid "Element"
msgstr ""
#: elements/class-post-type.php:67 elements/class-post-type.php:255
#: elements/class-post-type.php:256 elements/elements.php:66
#: elements/class-post-type.php:256 elements/elements.php:71
msgid "Elements"
msgstr ""
@ -1678,6 +1682,11 @@ msgstr ""
msgid "Deactivate"
msgstr ""
#: inc/activation.php:139
#: sections/functions/metaboxes/views/sections-template.php:80
msgid "Apply"
msgstr ""
#: inc/activation.php:173
msgid "WooCommerce not activated."
msgstr ""
@ -2295,31 +2304,45 @@ msgstr ""
msgid "No sections added!"
msgstr ""
#: sites/classes/class-site-restore.php:105
#: sites/classes/class-site-restore.php:42
#: sites/classes/class-site-restore.php:115
#: sites/classes/class-site-restore.php:145
#: sites/classes/class-site-restore.php:170
#: sites/classes/class-site-restore.php:189
#: sites/classes/class-site-restore.php:208
#: sites/classes/class-site-restore.php:239 sites/classes/class-site.php:552
#: sites/classes/class-site.php:588 sites/classes/class-site.php:629
#: sites/classes/class-site.php:787 sites/classes/class-site.php:815
#: sites/classes/class-site.php:860 sites/classes/class-site.php:891
#: sites/classes/class-site.php:990 sites/classes/class-site.php:1040
msgid "You are not allowed to perform this action"
msgstr ""
#: sites/classes/class-site-restore.php:106
msgid "Theme options restored."
msgstr ""
#: sites/classes/class-site-restore.php:134
#: sites/classes/class-site-restore.php:136
msgid "Site options restored."
msgstr ""
#: sites/classes/class-site-restore.php:158
#: sites/classes/class-site-restore.php:161
msgid "Content restored."
msgstr ""
#: sites/classes/class-site-restore.php:176
#: sites/classes/class-site-restore.php:180
msgid "Plugins restored."
msgstr ""
#: sites/classes/class-site-restore.php:194
#: sites/classes/class-site-restore.php:199
msgid "Widgets restored."
msgstr ""
#: sites/classes/class-site-restore.php:224
#: sites/classes/class-site-restore.php:230
msgid "CSS restored."
msgstr ""
#: sites/classes/class-site-restore.php:240
#: sites/classes/class-site-restore.php:247
msgid "Completed clean-up."
msgstr ""
@ -2488,15 +2511,15 @@ msgstr ""
msgid "View Your Site"
msgstr ""
#: sites/classes/class-site.php:631
#: sites/classes/class-site.php:634
msgid "No theme options exist."
msgstr ""
#: sites/classes/class-site.php:967
#: sites/classes/class-site.php:974
msgid "Site options imported"
msgstr ""
#: sites/classes/class-site.php:1011
#: sites/classes/class-site.php:1019
msgid "Plugins activated"
msgstr ""
@ -2978,7 +3001,7 @@ msgid "Display product meta data"
msgstr ""
#: woocommerce/functions/customizer/customizer.php:1005
#: woocommerce/functions/functions.php:1114
#: woocommerce/functions/functions.php:1117
msgid "Checkout"
msgstr ""
@ -2994,35 +3017,29 @@ msgstr ""
msgid "View your shopping cart"
msgstr ""
#: woocommerce/functions/functions.php:531
msgid "<span class=\"number-of-items "
msgid_plural "<span class=\"number-of-items "
msgstr[0] ""
msgstr[1] ""
#: woocommerce/functions/functions.php:1038
#: woocommerce/functions/functions.php:1035
#, php-format
msgid "Rated %s out of 5"
msgstr ""
#: woocommerce/functions/functions.php:1040
#: woocommerce/functions/functions.php:1037
msgid "Not yet rated"
msgstr ""
#: woocommerce/functions/functions.php:1045
#: woocommerce/functions/functions.php:1042
msgid "out of 5"
msgstr ""
#: woocommerce/functions/functions.php:1100
#: woocommerce/functions/functions.php:1103
msgid "Continue Shopping"
msgstr ""
#: woocommerce/functions/functions.php:1105
#: woocommerce/functions/functions.php:1108
msgid "Item added to cart."
msgstr ""
#: woocommerce/functions/functions.php:1109
#: woocommerce/functions/functions.php:1179
#: woocommerce/functions/functions.php:1112
#: woocommerce/functions/functions.php:1182
#, php-format
msgid "%d item"
msgid_plural "%d items"

View File

@ -223,14 +223,16 @@ add_action( 'customize_controls_print_styles', 'generate_premium_customize_print
*/
function generate_premium_customize_print_styles() {
$sizes = apply_filters( 'generate_customizer_device_preview_sizes', array(
'tablet' => 900,
'mobile' => 640,
'tablet' => 800,
'mobile' => 411,
'mobile_height' => 731,
) );
?>
<style>
.wp-customizer .preview-tablet .wp-full-overlay-main {
width: <?php echo absint( $sizes['tablet'] ); ?>px;
margin: 0 auto;
margin-left: 0;
margin-right: 0;
left: 50%;
-webkit-transform: translateX(-50%);
transform: translateX(-50%);
@ -238,11 +240,18 @@ function generate_premium_customize_print_styles() {
.wp-customizer .preview-mobile .wp-full-overlay-main {
width: <?php echo absint( $sizes['mobile'] ); ?>px;
margin: 0 auto;
height: <?php echo absint( $sizes['mobile_height'] ); ?>px;
margin-left: 0;
margin-right: 0;
left: 50%;
-webkit-transform: translateX(-50%);
transform: translateX(-50%);
height: 100%;
}
.rtl.wp-customizer .preview-tablet .wp-full-overlay-main,
.rtl.wp-customizer .preview-mobile .wp-full-overlay-main {
-webkit-transform: translateX(50%);
transform: translateX(50%);
}
</style>
<?php

View File

@ -16,7 +16,8 @@ jQuery( document ).ready( function($) {
visibility: 'visible',
height: '',
width: '',
margin: ''
margin: '',
overflow: '',
} );
$.each( other_targets, function( index, value ) {
@ -25,7 +26,8 @@ jQuery( document ).ready( function($) {
visibility: 'hidden',
height: '0',
width: '0',
margin: '0'
margin: '0',
overflow: 'hidden',
} );
} );
} );

View File

@ -1,17 +0,0 @@
<?php
/*
* Copyright (c) 2016 Delicious Brains. All rights reserved.
*
* Released under the GPL license
* http://www.opensource.org/licenses/gpl-license.php
*/
defined( 'WPINC' ) or die;
require_once GP_LIBRARY_DIRECTORY . 'batch-processing/wp-async-request.php';
require_once GP_LIBRARY_DIRECTORY . 'batch-processing/wp-background-process.php';
require_once plugin_dir_path( __FILE__ ) . 'includes/class-ipq-process.php';
require_once plugin_dir_path( __FILE__ ) . 'includes/class-image-processing-queue.php';
require_once plugin_dir_path( __FILE__ ) . 'includes/ipq-template-functions.php';
Image_Processing_Queue::instance();

View File

@ -1,277 +0,0 @@
<?php
/**
* Image Processing Queue
*
* @package Image-Processing-Queue
*/
if ( ! class_exists( 'Image_Processing_Queue' ) ) {
/**
* Image Processing Queue
*/
class Image_Processing_Queue {
/**
* Singleton
*
* @var Image_Processing_Queue|null
*/
protected static $instance = null;
/**
* Whether or not we're updating the backup sizes
*
* @var bool
*/
private $is_updating_backup_sizes = false;
/**
* Instance of the background process class
*
* @var IPQ_Process|null
*/
public $process = null;
/**
* Singleton
*
* @return Image_Processing_Queue|null
*/
public static function instance() {
if ( is_null( self::$instance ) ) {
self::$instance = new self();
}
return self::$instance;
}
/**
* Image_Processing_Queue constructor.
*/
public function __construct() {
$this->process = new IPQ_Process();
add_filter( 'update_post_metadata', array( $this, 'filter_update_post_metadata' ), 10, 5 );
}
/**
* Filter the post meta data for backup sizes
*
* Unfortunately WordPress core is lacking hooks in its image resizing functions so we are reduced
* to this hackery to detect when images are resized and previous versions are relegated to backup sizes.
*
* @param bool $check
* @param int $object_id
* @param string $meta_key
* @param mixed $meta_value
* @param mixed $prev_value
* @return bool
*/
public function filter_update_post_metadata( $check, $object_id, $meta_key, $meta_value, $prev_value ) {
if ( '_wp_attachment_backup_sizes' !== $meta_key ) {
return $check;
}
$current_value = get_post_meta( $object_id, $meta_key, true );
if ( ! $current_value ) {
$current_value = array();
}
$diff = array_diff_key( $meta_value, $current_value );
if ( ! $diff ) {
return $check;
}
$key = key( $diff );
$suffix = substr( $key, strrpos( $key, '-' ) + 1 );
$image_meta = self::get_image_meta( $object_id );
foreach ( $image_meta['sizes'] as $size_name => $size ) {
if ( 0 !== strpos( $size_name, 'ipq-' ) ) {
continue;
}
$meta_value[ $size_name . '-' . $suffix ] = $size;
unset( $image_meta['sizes'][ $size_name ] );
}
if ( ! $this->is_updating_backup_sizes ) {
$this->is_updating_backup_sizes = true;
update_post_meta( $object_id, '_wp_attachment_backup_sizes', $meta_value );
wp_update_attachment_metadata( $object_id, $image_meta );
return true;
}
$this->is_updating_backup_sizes = false;
return $check;
}
/**
* Check if the image sizes exist and push them to the queue if not.
*
* @param int $post_id
* @param array $sizes
*/
protected function process_image( $post_id, $sizes ) {
$new_item = false;
foreach ( $sizes as $size ) {
if ( self::does_size_already_exist_for_image( $post_id, $size ) ) {
continue;
}
if ( self::is_size_larger_than_original( $post_id, $size ) ) {
continue;
}
$item = array(
'post_id' => $post_id,
'width' => $size[0],
'height' => $size[1],
'crop' => $size[2],
);
$this->process->push_to_queue( $item );
$new_item = true;
}
if ( $new_item ) {
$this->process->save()->dispatch();
}
}
/**
* Get image HTML for a specific context in a theme, specifying the exact sizes
* for the image. The first image size is always used as the `src` and the other
* sizes are used in the `srcset` if they're the same aspect ratio as the original
* image. If any of the image sizes don't currently exist, they are queued for
* creation by a background process. Example:
*
* echo ipq_get_theme_image( 1353, array(
* array( 600, 400, false ),
* array( 1280, 720, false ),
* array( 1600, 1067, false ),
* ),
* array(
* 'class' => 'header-banner'
* )
* );
*
* @param int $post_id Image attachment ID.
* @param array $sizes Array of arrays of sizes in the format array(width,height,crop).
* @param string $attr Optional. Attributes for the image markup. Default empty.
* @return string HTML img element or empty string on failure.
*/
public function get_image( $post_id, $sizes, $attr = '' ) {
$this->process_image( $post_id, $sizes );
return wp_get_attachment_image( $post_id, array( $sizes[0][0], $sizes[0][1] ), false, $attr );
}
/**
* Get image URL for a specific context in a theme, specifying the exact size
* for the image. If the image size does not currently exist, it is queued for
* creation by a background process. Example:
*
* echo ipq_get_theme_image_url( 1353, array( 600, 400, false ) );
*
* @param int $post_id
* @param array $size
*
* @return string
*/
public function get_image_url( $post_id, $size ) {
$this->process_image( $post_id, array( $size ) );
$size = self::get_size_name( $size );
$src = wp_get_attachment_image_src( $post_id, $size );
if ( isset( $src[0] ) ) {
return $src[0];
}
return '';
}
/**
* Get array index name for image size.
*
* @param array $size array in format array(width,height,crop).
* @return string Image size name.
*/
public static function get_size_name( $size ) {
$crop = $size[2] ? 'true' : 'false';
return 'ipq-' . $size[0] . 'x' . $size[1] . '-' . $crop;
}
/**
* Get an image's file path.
*
* @param int $post_id ID of the image post.
* @return false|string
*/
public static function get_image_path( $post_id ) {
return get_attached_file( $post_id );
}
/**
* Get an image's post meta data.
*
* @param int $post_id ID of the image post.
* @return mixed Post meta field. False on failure.
*/
public static function get_image_meta( $post_id ) {
return wp_get_attachment_metadata( $post_id );
}
/**
* Update meta data for an image
*
* @param int $post_id Image ID.
* @param array $data Image data.
* @return bool|int False if $post is invalid.
*/
public static function update_image_meta( $post_id, $data ) {
return wp_update_attachment_metadata( $post_id, $data );
}
/**
* Checks if an image size already exists for an image
*
* @param int $post_id Image ID.
* @param array $size array in format array(width,height,crop).
* @return bool
*/
public static function does_size_already_exist_for_image( $post_id, $size ) {
$image_meta = self::get_image_meta( $post_id );
$size_name = self::get_size_name( $size );
return isset( $image_meta['sizes'][ $size_name ] );
}
/**
* Check if an image size is larger than the original.
*
* @param int $post_id Image ID.
* @param array $size array in format array(width,height,crop).
*
* @return bool
*/
public static function is_size_larger_than_original( $post_id, $size ) {
$image_meta = self::get_image_meta( $post_id );
if ( ! isset( $image_meta['width'] ) || ! isset( $image_meta['height'] ) ) {
return true;
}
if ( $size[0] > $image_meta['width'] || $size[1] > $image_meta['height'] ) {
return true;
}
return false;
}
}
}

View File

@ -1,97 +0,0 @@
<?php
/**
* Background Process for Image Processing Queue
*
* @package Image-Processing-Queue
*/
if ( ! class_exists( 'IPQ_Process' ) ) {
/**
* Custom exception class for IPQ background processing
*/
class IPQ_Process_Exception extends Exception {}
/**
* Extends the background processing library and implements image processing routines
*/
class IPQ_Process extends WP_Background_Process {
/**
* Action
*
* @var string
*/
protected $action = 'image_processing_queue';
/**
* Background task to resizes images
*
* @param mixed $item Image data.
* @return bool
* @throws IPQ_Process_Exception On error.
*/
protected function task( $item ) {
$defaults = array(
'post_id' => 0,
'width' => 0,
'height' => 0,
'crop' => false,
);
$item = wp_parse_args( $item, $defaults );
$post_id = $item['post_id'];
$width = $item['width'];
$height = $item['height'];
$crop = $item['crop'];
if ( ! $width && ! $height ) {
throw new IPQ_Process_Exception( "Invalid dimensions '{$width}x{$height}'" );
}
if ( Image_Processing_Queue::does_size_already_exist_for_image( $post_id, array( $width, $height, $crop ) ) ) {
return false;
}
$image_meta = Image_Processing_Queue::get_image_meta( $post_id );
if ( ! $image_meta ) {
return false;
}
add_filter( 'as3cf_get_attached_file_copy_back_to_local', '__return_true' );
$img_path = Image_Processing_Queue::get_image_path( $post_id );
if ( ! $img_path ) {
return false;
}
$editor = wp_get_image_editor( $img_path );
if ( is_wp_error( $editor ) ) {
throw new IPQ_Process_Exception( 'Unable to get WP_Image_Editor for file "' . $img_path . '": ' . $editor->get_error_message() . ' (is GD or ImageMagick installed?)' );
}
if ( is_wp_error( $editor->resize( $width, $height, $crop ) ) ) {
throw new IPQ_Process_Exception( 'Error resizing image: ' . $editor->get_error_message() );
}
$resized_file = $editor->save();
if ( is_wp_error( $resized_file ) ) {
throw new IPQ_Process_Exception( 'Unable to save resized image file: ' . $editor->get_error_message() );
}
$size_name = Image_Processing_Queue::get_size_name( array( $width, $height, $crop ) );
$image_meta['sizes'][ $size_name ] = array(
'file' => $resized_file['file'],
'width' => $resized_file['width'],
'height' => $resized_file['height'],
'mime-type' => $resized_file['mime-type'],
);
wp_update_attachment_metadata( $post_id, $image_meta );
return false;
}
}
}

View File

@ -1,47 +0,0 @@
<?php
if ( ! function_exists( 'ipq_get_theme_image' ) ) {
/**
* Get image HTML for a specific context in a theme, specifying the exact sizes
* for the image. The first image size is always used as the `src` and the other
* sizes are used in the `srcset` if they're the same aspect ratio as the original
* image. If any of the image sizes don't currently exist, they are queued for
* creation by a background process. Example:
*
* echo ipq_get_theme_image( 1353, array(
* array( 600, 400, false ),
* array( 1280, 720, false ),
* array( 1600, 1067, false ),
* ),
* array(
* 'class' => 'header-banner'
* )
* );
*
* @param int $post_id Image attachment ID.
* @param array $sizes Array of arrays of sizes in the format array(width,height,crop).
* @param string $attr Optional. Attributes for the image markup. Default empty.
*
* @return string HTML img element or empty string on failure.
*/
function ipq_get_theme_image( $post_id, $sizes, $attr = '' ) {
return Image_Processing_Queue::instance()->get_image( $post_id, $sizes, $attr );
}
}
if ( ! function_exists( 'ipq_get_theme_image_url' ) ) {
/**
* Get image URL for a specific context in a theme, specifying the exact size
* for the image. If the image size does not currently exist, it is queued for
* creation by a background process. Example:
*
* echo ipq_get_theme_image_url( 1353, array( 600, 400, false ) );
*
* @param int $post_id
* @param array $size
*
* @return string Img URL
*/
function ipq_get_theme_image_url( $post_id, $size ) {
return Image_Processing_Queue::instance()->get_image_url( $post_id, $size );
}
}

View File

@ -34,7 +34,8 @@
z-index: 999;
}
#sticky-placeholder.mobile-header-navigation .mobile-header-logo {
#sticky-placeholder.mobile-header-navigation .mobile-header-logo,
#sticky-placeholder .navigation-branding {
display: none;
}

View File

@ -1 +1 @@
.sticky-enabled .gen-sidebar-nav.is_stuck .main-navigation{margin-bottom:0}.sticky-enabled .gen-sidebar-nav.is_stuck{z-index:500}.sticky-enabled .main-navigation.is_stuck{box-shadow:0 2px 2px -2px rgba(0,0,0,.2)}.sticky-enabled .fixfixed .is_stuck{position:relative!important}.navigation-stick:not(.gen-sidebar-nav){left:0;right:0;width:100%!important}.both-sticky-menu .main-navigation:not(#mobile-header).toggled .main-nav,.mobile-sticky-menu .main-navigation:not(#mobile-header).toggled .main-nav{clear:both}.both-sticky-menu .main-navigation:not(#mobile-header).toggled .main-nav>ul,.mobile-header-sticky #mobile-header.toggled .main-nav>ul,.mobile-sticky-menu .main-navigation:not(#mobile-header).toggled .main-nav>ul{position:absolute;left:0;right:0;z-index:999}#sticky-placeholder.mobile-header-navigation .mobile-header-logo{display:none}.nav-float-right .is_stuck.main-navigation:not(.toggled) .menu>li{float:none;display:inline-block}.nav-float-right .is_stuck.main-navigation:not(.toggled) .menu>li.search-item,.nav-float-right .is_stuck.main-navigation:not(.toggled) .menu>li.slideout-toggle,.nav-float-right .is_stuck.main-navigation:not(.toggled) .menu>li.wc-menu-item{display:block;float:right}.nav-float-right .is_stuck.main-navigation:not(.toggled) ul{letter-spacing:-.31em;font-size:1em}.nav-float-right .is_stuck.main-navigation:not(.toggled) ul li{letter-spacing:normal}.nav-float-right .is_stuck.main-navigation:not(.toggled){text-align:right}.nav-float-right .is_stuck.main-navigation.has-branding:not(.toggled) ul,.nav-float-right .is_stuck.main-navigation.has-sticky-branding:not(.toggled) ul{letter-spacing:unset}.nav-float-right .is_stuck.main-navigation.has-branding:not(.toggled) .menu>li,.nav-float-right .is_stuck.main-navigation.has-sticky-branding:not(.toggled) .menu>li{display:block;float:left}
.sticky-enabled .gen-sidebar-nav.is_stuck .main-navigation{margin-bottom:0}.sticky-enabled .gen-sidebar-nav.is_stuck{z-index:500}.sticky-enabled .main-navigation.is_stuck{box-shadow:0 2px 2px -2px rgba(0,0,0,.2)}.sticky-enabled .fixfixed .is_stuck{position:relative!important}.navigation-stick:not(.gen-sidebar-nav){left:0;right:0;width:100%!important}.both-sticky-menu .main-navigation:not(#mobile-header).toggled .main-nav,.mobile-sticky-menu .main-navigation:not(#mobile-header).toggled .main-nav{clear:both}.both-sticky-menu .main-navigation:not(#mobile-header).toggled .main-nav>ul,.mobile-header-sticky #mobile-header.toggled .main-nav>ul,.mobile-sticky-menu .main-navigation:not(#mobile-header).toggled .main-nav>ul{position:absolute;left:0;right:0;z-index:999}#sticky-placeholder .navigation-branding,#sticky-placeholder.mobile-header-navigation .mobile-header-logo{display:none}.nav-float-right .is_stuck.main-navigation:not(.toggled) .menu>li{float:none;display:inline-block}.nav-float-right .is_stuck.main-navigation:not(.toggled) .menu>li.search-item,.nav-float-right .is_stuck.main-navigation:not(.toggled) .menu>li.slideout-toggle,.nav-float-right .is_stuck.main-navigation:not(.toggled) .menu>li.wc-menu-item{display:block;float:right}.nav-float-right .is_stuck.main-navigation:not(.toggled) ul{letter-spacing:-.31em;font-size:1em}.nav-float-right .is_stuck.main-navigation:not(.toggled) ul li{letter-spacing:normal}.nav-float-right .is_stuck.main-navigation:not(.toggled){text-align:right}.nav-float-right .is_stuck.main-navigation.has-branding:not(.toggled) ul,.nav-float-right .is_stuck.main-navigation.has-sticky-branding:not(.toggled) ul{letter-spacing:unset}.nav-float-right .is_stuck.main-navigation.has-branding:not(.toggled) .menu>li,.nav-float-right .is_stuck.main-navigation.has-sticky-branding:not(.toggled) .menu>li{display:block;float:left}

View File

@ -1776,7 +1776,7 @@ function generate_do_navigation_branding() {
}
}
if ( '' !== $settings['sticky_navigation_logo'] ) {
if ( 'false' !== $settings['sticky_menu'] && '' !== $settings['sticky_navigation_logo'] ) {
$sticky_logo = apply_filters( 'generate_sticky_navigation_logo_output', sprintf(
'<div class="sticky-navigation-logo">
<a href="%1$s" title="%2$s" rel="home">

View File

@ -510,13 +510,15 @@ var generateOffside = offside( '.slideout-navigation', {
document.body.classList.add( 'slide-opened' );
// Get the first link so we can focus on it.
var slideoutMenu = document.getElementById( 'generate-slideout-menu' ).querySelector( 'ul.slideout-menu' );
var slideoutMenu = document.querySelector( 'ul.slideout-menu' );
if ( slideoutMenu ) {
var firstLink = slideoutMenu.firstChild.querySelector( 'a' );
if ( firstLink ) {
firstLink.focus();
setTimeout( function() {
firstLink.focus();
}, 200 );
}
}
},

File diff suppressed because one or more lines are too long

View File

@ -1,10 +1,6 @@
<?php
defined( 'WPINC' ) or die;
if ( ! defined( 'GP_IMAGE_RESIZER' ) ) {
require_once GP_LIBRARY_DIRECTORY . 'image-processing-queue/image-processing-queue.php';
}
require plugin_dir_path( __FILE__ ) . 'post-type.php';
require plugin_dir_path( __FILE__ ) . 'global-locations.php';
require plugin_dir_path( __FILE__ ) . 'metabox.php';
@ -370,8 +366,14 @@ function generate_page_header_get_image_output() {
}
}
if ( ! empty( $image_atts ) && 'enable' == $options[ 'image_resize' ] && function_exists( 'ipq_get_theme_image' ) ) {
return ipq_get_theme_image( $image_id, array( array( $image_atts[ 'width' ], $image_atts[ 'height' ], $image_atts[ 'crop' ] ) ) );
if ( ! empty( $image_atts ) && 'enable' == $options[ 'image_resize' ] ) {
return apply_filters( 'post_thumbnail_html',
wp_get_attachment_image( $image_id, array( $image_atts['width'], $image_atts['height'], $image_atts['crop'] ), '', array( 'itemprop' => 'image' ) ),
get_the_ID(),
$image_id,
apply_filters( 'generate_page_header_default_size', 'full' ),
''
);
} else {
return apply_filters( 'post_thumbnail_html',
wp_get_attachment_image( $image_id, apply_filters( 'generate_page_header_default_size', 'full' ), '', array( 'itemprop' => 'image' ) ),

View File

@ -253,17 +253,20 @@ if ( ! function_exists( 'show_generate_page_header_meta_box' ) ) {
</p>
<div id="crop-enabled" style="display:none">
<p>
<label for="_meta-generate-page-header-image-width" class="example-row-title"><strong><?php _e( 'Image Width', 'gp-premium' );?></strong></label><br />
<input style="width:45px" type="text" name="_meta-generate-page-header-image-width" id="_meta-generate-page-header-image-width" value="<?php echo intval( generate_page_header_get_post_meta( get_the_ID(), '_meta-generate-page-header-image-width', true ) ); ?>" /><label for="_meta-generate-page-header-image-width"><span class="pixels">px</span></label>
</p>
<p><?php _e( 'These options are no longer available as of GP Premium 1.10.0.', 'gp-premium' ); ?>
<div style="display: none;">
<p>
<label for="_meta-generate-page-header-image-width" class="example-row-title"><strong><?php _e( 'Image Width', 'gp-premium' );?></strong></label><br />
<input style="width:45px" type="text" name="_meta-generate-page-header-image-width" id="_meta-generate-page-header-image-width" value="<?php echo intval( generate_page_header_get_post_meta( get_the_ID(), '_meta-generate-page-header-image-width', true ) ); ?>" /><label for="_meta-generate-page-header-image-width"><span class="pixels">px</span></label>
</p>
<p style="margin-bottom:0;">
<label for="_meta-generate-page-header-image-height" class="example-row-title"><strong><?php _e( 'Image Height', 'gp-premium' );?></strong></label><br />
<input placeholder="" style="width:45px" type="text" name="_meta-generate-page-header-image-height" id="_meta-generate-page-header-image-height" value="<?php echo intval( generate_page_header_get_post_meta( get_the_ID(), '_meta-generate-page-header-image-height', true ) ); ?>" />
<label for="_meta-generate-page-header-image-height"><span class="pixels">px</span></label>
<span class="description" style="display:block;"><?php _e( 'Use "0" or leave blank for proportional resizing.', 'gp-premium' );?></span>
</p>
<p style="margin-bottom:0;">
<label for="_meta-generate-page-header-image-height" class="example-row-title"><strong><?php _e( 'Image Height', 'gp-premium' );?></strong></label><br />
<input placeholder="" style="width:45px" type="text" name="_meta-generate-page-header-image-height" id="_meta-generate-page-header-image-height" value="<?php echo intval( generate_page_header_get_post_meta( get_the_ID(), '_meta-generate-page-header-image-height', true ) ); ?>" />
<label for="_meta-generate-page-header-image-height"><span class="pixels">px</span></label>
<span class="description" style="display:block;"><?php _e( 'Use "0" or leave blank for proportional resizing.', 'gp-premium' );?></span>
</p>
</div>
</div>
</div>
</div>

View File

@ -780,11 +780,17 @@ var Generate_Sections = {
'overflow': 'hidden'
});
$( '.editor-block-list__layout' ).hide();
$( '.edit-post-layout__content .edit-post-visual-editor' ).css( {
$( '.block-editor-block-list__layout' ).hide();
$( '.edit-post-layout .edit-post-visual-editor' ).css( {
'flex-grow': 'unset',
'flex-basis': '0'
} );
$( '.edit-post-visual-editor .block-editor-writing-flow__click-redirect' ).css( {
'min-height': '0'
} );
$( '.edit-post-layout__metaboxes:not(:empty)' ).css( 'border-top', '0' );
// Show the sections
@ -818,11 +824,17 @@ var Generate_Sections = {
'height': 'auto'
});
$( '.editor-block-list__layout' ).show();
$( '.edit-post-layout__content .edit-post-visual-editor' ).css( {
$( '.block-editor-block-list__layout' ).show();
$( '.edit-post-layout .edit-post-visual-editor' ).css( {
'flex-grow': '',
'flex-basis': ''
} );
$( '.edit-post-visual-editor .block-editor-writing-flow__click-redirect' ).css( {
'min-height': ''
} );
$( '.edit-post-layout__metaboxes:not(:empty)' ).css( 'border-top', '' );
// Hide the sections

View File

@ -39,7 +39,8 @@ class GeneratePress_Sites_Restore {
check_ajax_referer( 'generate_sites_nonce', 'nonce' );
if ( ! current_user_can( 'manage_options' ) ) {
return;
wp_send_json_error( __( 'You are not allowed to perform this action', 'gp-premium' ) );
return; // Just in case.
}
$backup_data = get_option( '_generatepress_site_library_backup', array() );
@ -111,7 +112,8 @@ class GeneratePress_Sites_Restore {
check_ajax_referer( 'generate_sites_nonce', 'nonce' );
if ( ! current_user_can( 'manage_options' ) ) {
return;
wp_send_json_error( __( 'You are not allowed to perform this action', 'gp-premium' ) );
return; // Just in case.
}
$backup_data = get_option( '_generatepress_site_library_backup', array() );
@ -140,7 +142,8 @@ class GeneratePress_Sites_Restore {
check_ajax_referer( 'generate_sites_nonce', 'nonce' );
if ( ! current_user_can( 'manage_options' ) ) {
return;
wp_send_json_error( __( 'You are not allowed to perform this action', 'gp-premium' ) );
return; // Just in case.
}
$backup_data = get_option( '_generatepress_site_library_backup', array() );
@ -164,7 +167,8 @@ class GeneratePress_Sites_Restore {
check_ajax_referer( 'generate_sites_nonce', 'nonce' );
if ( ! current_user_can( 'manage_options' ) ) {
return;
wp_send_json_error( __( 'You are not allowed to perform this action', 'gp-premium' ) );
return; // Just in case.
}
$backup_data = get_option( '_generatepress_site_library_backup', array() );
@ -182,7 +186,8 @@ class GeneratePress_Sites_Restore {
check_ajax_referer( 'generate_sites_nonce', 'nonce' );
if ( ! current_user_can( 'manage_options' ) ) {
return;
wp_send_json_error( __( 'You are not allowed to perform this action', 'gp-premium' ) );
return; // Just in case.
}
$backup_data = get_option( '_generatepress_site_library_backup', array() );
@ -200,7 +205,8 @@ class GeneratePress_Sites_Restore {
check_ajax_referer( 'generate_sites_nonce', 'nonce' );
if ( ! current_user_can( 'manage_options' ) ) {
return;
wp_send_json_error( __( 'You are not allowed to perform this action', 'gp-premium' ) );
return; // Just in case.
}
$backup_data = get_option( '_generatepress_site_library_backup', array() );
@ -230,7 +236,8 @@ class GeneratePress_Sites_Restore {
check_ajax_referer( 'generate_sites_nonce', 'nonce' );
if ( ! current_user_can( 'manage_options' ) ) {
return;
wp_send_json_error( __( 'You are not allowed to perform this action', 'gp-premium' ) );
return; // Just in case.
}
delete_option( 'generate_dynamic_css_output' );
@ -243,4 +250,4 @@ class GeneratePress_Sites_Restore {
}
}
GeneratePress_Sites_Restore::get_instance();
GeneratePress_Sites_Restore::get_instance();

View File

@ -549,7 +549,8 @@ class GeneratePress_Site {
check_ajax_referer( 'generate_sites_nonce', 'nonce' );
if ( ! current_user_can( 'manage_options' ) ) {
return;
wp_send_json_error( __( 'You are not allowed to perform this action', 'gp-premium' ) );
return; // Just in case.
}
$theme_mods = GeneratePress_Sites_Helper::get_theme_mods();
@ -584,7 +585,8 @@ class GeneratePress_Site {
check_ajax_referer( 'generate_sites_nonce', 'nonce' );
if ( ! current_user_can( 'manage_options' ) ) {
return;
wp_send_json_error( __( 'You are not allowed to perform this action', 'gp-premium' ) );
return; // Just in case.
}
$settings = GeneratePress_Sites_Helper::get_options( $this->directory . 'options.json' );
@ -624,7 +626,8 @@ class GeneratePress_Site {
check_ajax_referer( 'generate_sites_nonce', 'nonce' );
if ( ! current_user_can( 'manage_options' ) ) {
return;
wp_send_json_error( __( 'You are not allowed to perform this action', 'gp-premium' ) );
return; // Just in case.
}
if ( ! GeneratePress_Sites_Helper::file_exists( $this->directory . 'options.json' ) ) {
@ -781,7 +784,8 @@ class GeneratePress_Site {
check_ajax_referer( 'generate_sites_nonce', 'nonce' );
if ( ! current_user_can( 'manage_options' ) ) {
return;
wp_send_json_error( __( 'You are not allowed to perform this action', 'gp-premium' ) );
return; // Just in case.
}
// Increase PHP max execution time.
@ -808,7 +812,8 @@ class GeneratePress_Site {
check_ajax_referer( 'generate_sites_nonce', 'nonce' );
if ( ! current_user_can( 'manage_options' ) ) {
return;
wp_send_json_error( __( 'You are not allowed to perform this action', 'gp-premium' ) );
return; // Just in case.
}
// Increase PHP max execution time.
@ -852,7 +857,8 @@ class GeneratePress_Site {
check_ajax_referer( 'generate_sites_nonce', 'nonce' );
if ( ! current_user_can( 'manage_options' ) ) {
return;
wp_send_json_error( __( 'You are not allowed to perform this action', 'gp-premium' ) );
return; // Just in case.
}
$widgets_path = $this->directory . 'widgets.wie';
@ -882,7 +888,8 @@ class GeneratePress_Site {
check_ajax_referer( 'generate_sites_nonce', 'nonce' );
if ( ! current_user_can( 'manage_options' ) ) {
return;
wp_send_json_error( __( 'You are not allowed to perform this action', 'gp-premium' ) );
return; // Just in case.
}
$backup_data = get_option( '_generatepress_site_library_backup', array() );
@ -980,7 +987,8 @@ class GeneratePress_Site {
check_ajax_referer( 'generate_sites_nonce', 'nonce' );
if ( ! current_user_can( 'manage_options' ) ) {
return;
wp_send_json_error( __( 'You are not allowed to perform this action', 'gp-premium' ) );
return; // Just in case.
}
$settings = GeneratePress_Sites_Helper::get_options( $this->directory . 'options.json' );
@ -1029,7 +1037,8 @@ class GeneratePress_Site {
check_ajax_referer( 'generate_sites_nonce', 'nonce' );
if ( ! current_user_can( 'manage_options' ) ) {
return;
wp_send_json_error( __( 'You are not allowed to perform this action', 'gp-premium' ) );
return; // Just in case.
}
if ( GeneratePress_Sites_Helper::file_exists( $this->directory . 'options.json' ) ) {

View File

@ -15,21 +15,21 @@
.wc-related-upsell-mobile-columns-1 .related ul.products,
.wc-related-upsell-mobile-columns-1 .up-sells ul.products {
-ms-grid-columns: 1fr;
grid-template-columns: 1fr;
grid-template-columns: repeat(1,minmax(0, 1fr));
}
.woocommerce #wc-column-container.wc-mobile-columns-2 .products,
.wc-related-upsell-mobile-columns-2 .related ul.products,
.wc-related-upsell-mobile-columns-2 .up-sells ul.products {
-ms-grid-columns: 1fr 1fr;
grid-template-columns: 1fr 1fr;
grid-template-columns: repeat(2,minmax(0, 1fr));
}
.woocommerce #wc-column-container.wc-mobile-columns-3 .products,
.wc-related-upsell-mobile-columns-3 .related ul.products,
.wc-related-upsell-mobile-columns-3 .up-sells ul.products {
-ms-grid-columns: 1fr 1fr 1fr;
grid-template-columns: 1fr 1fr 1fr;
grid-template-columns: repeat(3,minmax(0, 1fr));
}
.woocommerce ul.products li.product a img {
@ -212,3 +212,7 @@
.add-to-cart-panel .product-price {
font-size: 13px;
}
.add-to-cart-panel:not(.item-added):not(.show-sticky-add-to-cart) {
pointer-events: none;
}

View File

@ -1 +1 @@
.woocommerce-product-gallery{margin-right:0}.woocommerce .woocommerce-ordering,.woocommerce-page .woocommerce-ordering{float:none}.woocommerce .woocommerce-ordering select{max-width:100%}.wc-related-upsell-mobile-columns-1 .related ul.products,.wc-related-upsell-mobile-columns-1 .up-sells ul.products,.woocommerce #wc-column-container.wc-mobile-columns-1 .products{-ms-grid-columns:1fr;grid-template-columns:1fr}.wc-related-upsell-mobile-columns-2 .related ul.products,.wc-related-upsell-mobile-columns-2 .up-sells ul.products,.woocommerce #wc-column-container.wc-mobile-columns-2 .products{-ms-grid-columns:1fr 1fr;grid-template-columns:1fr 1fr}.wc-related-upsell-mobile-columns-3 .related ul.products,.wc-related-upsell-mobile-columns-3 .up-sells ul.products,.woocommerce #wc-column-container.wc-mobile-columns-3 .products{-ms-grid-columns:1fr 1fr 1fr;grid-template-columns:1fr 1fr 1fr}.woocommerce ul.products li.product a img{width:auto;margin-left:auto;margin-right:auto}.woocommerce div.product .woocommerce-tabs .panel,.woocommerce div.product .woocommerce-tabs ul.tabs,.woocommerce form .woocommerce-billing-fields__field-wrapper .form-row-first,.woocommerce form .woocommerce-billing-fields__field-wrapper .form-row-last,.woocommerce-page form .woocommerce-billing-fields__field-wrapper .form-row-first,.woocommerce-page form .woocommerce-billing-fields__field-wrapper .form-row-last{float:none;width:100%}.woocommerce div.product .woocommerce-tabs .panel{margin-top:20px}.wc-tabs .active a:after{transform:rotate(90deg);padding-right:3px}#customer_details+#wc_checkout_add_ons,#order_review,#order_review_heading,.woocommerce .col2-set,.woocommerce-page .col2-set{width:100%;float:none;margin-right:0}.woocommerce ul.products li.product.woocommerce-image-align-left .wc-product-image,.woocommerce ul.products li.product.woocommerce-image-align-right .wc-product-image{float:none;margin:0}.woocommerce #content div.product div.images,.woocommerce div.product div.images,.woocommerce ul.products li.product.woocommerce-image-align-left a .wc-product-image img,.woocommerce ul.products li.product.woocommerce-image-align-right a .wc-product-image img,.woocommerce-account .woocommerce-MyAccount-navigation,.woocommerce-page #content div.product div.images,.woocommerce-page div.product div.images{width:100%}.woocommerce .related ul.products li.product,.woocommerce .up-sells ul.products li.product,.woocommerce-page .related ul.products li.product,.woocommerce-page .up-sells ul.products li.product,.woocommerce-page[class*=columns-] .related ul.products li.product,.woocommerce-page[class*=columns-] .up-sells ul.products li.product,.woocommerce[class*=columns-] .related ul.products li.product,.woocommerce[class*=columns-] .up-sells ul.products li.product{width:100%;margin-left:0;margin-right:0}.woocommerce-MyAccount-navigation li.is-active a:after{content:"\e901"}#wc-mini-cart{display:none}.do-quantity-buttons div.quantity{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}.woocommerce div.product .woocommerce-tabs ul.tabs{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.woocommerce div.product .woocommerce-tabs ul.tabs li{border-left-width:1px}.woocommerce div.product .woocommerce-tabs ul.tabs li:last-child{border-bottom-color:rgba(0,0,0,.08);border-bottom-width:1px}.woocommerce .coupon .button{font-size:14px;padding:10px}.woocommerce .woocommerce-ordering{margin-bottom:0}.add-to-cart-panel{bottom:0;top:auto;-webkit-transform:translateY(0)!important;-ms-transform:translateY(0)!important;transform:translateY(0)!important}.add-to-cart-panel .continue-shopping:not(.has-svg-icon):before{content:"\f00d";font-family:'GP Premium';line-height:1em;width:1.28571429em;text-align:center;display:inline-block;padding:10px}#wc-sticky-cart-panel .quantity,.add-to-cart-panel .continue-shopping-text{display:none}.add-to-cart-panel .continue-shopping{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5;margin-left:auto;margin-right:0;position:absolute;top:-20px;left:10px;height:50px;width:50px;text-align:center;border-radius:50%;line-height:50px;cursor:pointer}.add-to-cart-panel .continue-shopping .gp-icon{display:block}.add-to-cart-panel .cart,.add-to-cart-panel .product-image{-ms-flex-negative:0;flex-shrink:0}.add-to-cart-panel .product-title{padding-right:20px;margin-left:10px}.add-to-cart-panel .cart-info{margin-right:auto}.add-to-cart-panel .product-price{font-size:13px}
.woocommerce-product-gallery{margin-right:0}.woocommerce .woocommerce-ordering,.woocommerce-page .woocommerce-ordering{float:none}.woocommerce .woocommerce-ordering select{max-width:100%}.wc-related-upsell-mobile-columns-1 .related ul.products,.wc-related-upsell-mobile-columns-1 .up-sells ul.products,.woocommerce #wc-column-container.wc-mobile-columns-1 .products{-ms-grid-columns:1fr;grid-template-columns:repeat(1,minmax(0,1fr))}.wc-related-upsell-mobile-columns-2 .related ul.products,.wc-related-upsell-mobile-columns-2 .up-sells ul.products,.woocommerce #wc-column-container.wc-mobile-columns-2 .products{-ms-grid-columns:1fr 1fr;grid-template-columns:repeat(2,minmax(0,1fr))}.wc-related-upsell-mobile-columns-3 .related ul.products,.wc-related-upsell-mobile-columns-3 .up-sells ul.products,.woocommerce #wc-column-container.wc-mobile-columns-3 .products{-ms-grid-columns:1fr 1fr 1fr;grid-template-columns:repeat(3,minmax(0,1fr))}.woocommerce ul.products li.product a img{width:auto;margin-left:auto;margin-right:auto}.woocommerce div.product .woocommerce-tabs .panel,.woocommerce div.product .woocommerce-tabs ul.tabs,.woocommerce form .woocommerce-billing-fields__field-wrapper .form-row-first,.woocommerce form .woocommerce-billing-fields__field-wrapper .form-row-last,.woocommerce-page form .woocommerce-billing-fields__field-wrapper .form-row-first,.woocommerce-page form .woocommerce-billing-fields__field-wrapper .form-row-last{float:none;width:100%}.woocommerce div.product .woocommerce-tabs .panel{margin-top:20px}.wc-tabs .active a:after{transform:rotate(90deg);padding-right:3px}#customer_details+#wc_checkout_add_ons,#order_review,#order_review_heading,.woocommerce .col2-set,.woocommerce-page .col2-set{width:100%;float:none;margin-right:0}.woocommerce ul.products li.product.woocommerce-image-align-left .wc-product-image,.woocommerce ul.products li.product.woocommerce-image-align-right .wc-product-image{float:none;margin:0}.woocommerce #content div.product div.images,.woocommerce div.product div.images,.woocommerce ul.products li.product.woocommerce-image-align-left a .wc-product-image img,.woocommerce ul.products li.product.woocommerce-image-align-right a .wc-product-image img,.woocommerce-account .woocommerce-MyAccount-navigation,.woocommerce-page #content div.product div.images,.woocommerce-page div.product div.images{width:100%}.woocommerce .related ul.products li.product,.woocommerce .up-sells ul.products li.product,.woocommerce-page .related ul.products li.product,.woocommerce-page .up-sells ul.products li.product,.woocommerce-page[class*=columns-] .related ul.products li.product,.woocommerce-page[class*=columns-] .up-sells ul.products li.product,.woocommerce[class*=columns-] .related ul.products li.product,.woocommerce[class*=columns-] .up-sells ul.products li.product{width:100%;margin-left:0;margin-right:0}.woocommerce-MyAccount-navigation li.is-active a:after{content:"\e901"}#wc-mini-cart{display:none}.do-quantity-buttons div.quantity{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}.woocommerce div.product .woocommerce-tabs ul.tabs{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.woocommerce div.product .woocommerce-tabs ul.tabs li{border-left-width:1px}.woocommerce div.product .woocommerce-tabs ul.tabs li:last-child{border-bottom-color:rgba(0,0,0,.08);border-bottom-width:1px}.woocommerce .coupon .button{font-size:14px;padding:10px}.woocommerce .woocommerce-ordering{margin-bottom:0}.add-to-cart-panel{bottom:0;top:auto;-webkit-transform:translateY(0)!important;-ms-transform:translateY(0)!important;transform:translateY(0)!important}.add-to-cart-panel .continue-shopping:not(.has-svg-icon):before{content:"\f00d";font-family:'GP Premium';line-height:1em;width:1.28571429em;text-align:center;display:inline-block;padding:10px}#wc-sticky-cart-panel .quantity,.add-to-cart-panel .continue-shopping-text{display:none}.add-to-cart-panel .continue-shopping{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5;margin-left:auto;margin-right:0;position:absolute;top:-20px;left:10px;height:50px;width:50px;text-align:center;border-radius:50%;line-height:50px;cursor:pointer}.add-to-cart-panel .continue-shopping .gp-icon{display:block}.add-to-cart-panel .cart,.add-to-cart-panel .product-image{-ms-flex-negative:0;flex-shrink:0}.add-to-cart-panel .product-title{padding-right:20px;margin-left:10px}.add-to-cart-panel .cart-info{margin-right:auto}.add-to-cart-panel .product-price{font-size:13px}.add-to-cart-panel:not(.item-added):not(.show-sticky-add-to-cart){pointer-events:none}

View File

@ -198,35 +198,35 @@
.wc-related-upsell-columns-6 .related ul.products,
.wc-related-upsell-columns-6 .up-sells ul.products {
-ms-grid-columns: 1fr 50px 1fr 50px 1fr 50px 1fr 50px 1fr 50px 1fr;
grid-template-columns: repeat(6, 1fr);
grid-template-columns: repeat(6,minmax(0, 1fr));
}
.wc-columns-container.wc-columns-5 .products,
.wc-related-upsell-columns-5 .related ul.products,
.wc-related-upsell-columns-5 .up-sells ul.products {
-ms-grid-columns: 1fr 50px 1fr 50px 1fr 50px 1fr 50px 1fr;
grid-template-columns: repeat(5, 1fr);
grid-template-columns: repeat(5,minmax(0, 1fr));
}
.woocommerce .wc-columns-container.wc-columns-4 .products,
.wc-related-upsell-columns-4 .related ul.products,
.wc-related-upsell-columns-4 .up-sells ul.products {
-ms-grid-columns: (1fr)[4];
grid-template-columns: repeat(4, 1fr);
grid-template-columns: repeat(4,minmax(0, 1fr));
}
.woocommerce .wc-columns-container.wc-columns-3 .products,
.wc-related-upsell-columns-3 .related ul.products,
.wc-related-upsell-columns-3 .up-sells ul.products {
-ms-grid-columns: (1fr)[3];
grid-template-columns: repeat(3, 1fr);
grid-template-columns: repeat(3,minmax(0, 1fr));
}
.woocommerce .wc-columns-container.wc-columns-2 .products,
.wc-related-upsell-columns-2 .related ul.products,
.wc-related-upsell-columns-2 .up-sells ul.products {
-ms-grid-columns: (1fr)[2];
grid-template-columns: repeat(2, 1fr);
grid-template-columns: repeat(2,minmax(0, 1fr));
}
.woocommerce .wc-columns-container.wc-columns-1 .products,
@ -756,6 +756,7 @@ nav span.count {
-webkit-transform: translate(-50%,0px);
-ms-transform: translate(-50%,0px);
transform: translate(-50%,0px);
top: 0;
}
.woocommerce ul.products li.product a img {

File diff suppressed because one or more lines are too long

View File

@ -85,7 +85,7 @@ function generatepress_woocommerce_customize_register( $wp_customize ) {
array(
'section' => 'generate_woocommerce_layout',
'type' => 'generatepress-customizer-title',
'title' => __( 'General','generate-woocommerce' ),
'title' => __( 'General', 'gp-premium' ),
'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname'
)
)
@ -205,7 +205,7 @@ function generatepress_woocommerce_customize_register( $wp_customize ) {
array(
'section' => 'generate_woocommerce_layout',
'type' => 'generatepress-customizer-title',
'title' => __( 'Shop','generate-woocommerce' ),
'title' => __( 'Shop', 'gp-premium' ),
'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname'
)
)
@ -691,7 +691,7 @@ function generatepress_woocommerce_customize_register( $wp_customize ) {
array(
'section' => 'generate_woocommerce_layout',
'type' => 'generatepress-customizer-title',
'title' => __( 'Single Product','generate-woocommerce' ),
'title' => __( 'Single Product', 'gp-premium' ),
'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname'
)
)
@ -713,7 +713,7 @@ function generatepress_woocommerce_customize_register( $wp_customize ) {
'label' => __( 'Sidebar Layout', 'gp-premium' ),
'section' => 'generate_woocommerce_layout',
'choices' => array(
'inherit' => __( 'Inherit','generate-woocommerce' ),
'inherit' => __( 'Inherit', 'gp-premium' ),
'left-sidebar' => __( 'Sidebar / Content', 'gp-premium' ),
'right-sidebar' => __( 'Content / Sidebar', 'gp-premium' ),
'no-sidebar' => __( 'Content (no sidebars)', 'gp-premium' ),
@ -1002,7 +1002,7 @@ function generatepress_woocommerce_customize_register( $wp_customize ) {
array(
'section' => 'generate_woocommerce_layout',
'type' => 'generatepress-customizer-title',
'title' => __( 'Checkout','generate-woocommerce' ),
'title' => __( 'Checkout', 'gp-premium' ),
'settings' => ( isset( $wp_customize->selective_refresh ) ) ? array() : 'blogname'
)
)
@ -1022,7 +1022,7 @@ function generatepress_woocommerce_customize_register( $wp_customize ) {
array(
'type' => 'checkbox',
'label' => __( 'Distraction-free mode', 'gp-premium' ),
'description' => __( 'Remove unnecessary distractions like sidebars, footer widgets and sticky menus.','generate-woocommerce' ),
'description' => __( 'Remove unnecessary distractions like sidebars, footer widgets and sticky menus.', 'gp-premium' ),
'section' => 'generate_woocommerce_layout',
'settings' => 'generate_woocommerce_settings[distraction_free]',
)

View File

@ -526,12 +526,9 @@ function generatepress_wc_cart_link() {
$icon ? 'has-svg-icon' : '',
esc_attr__( 'View your shopping cart', 'gp-premium' ),
$icon,
sprintf (
_n(
'<span class="number-of-items ' . $no_items . '">%d</span>',
'<span class="number-of-items ' . $no_items . '">%d</span>',
WC()->cart->get_cart_contents_count()
),
sprintf(
'<span class="number-of-items %1$s">%2$s</span>',
$no_items,
WC()->cart->get_cart_contents_count()
),
$legacy_icon,