updated plugin GP Premium version 2.0.3

This commit is contained in:
2021-07-25 23:25:02 +00:00
committed by Gitium
parent d7964b08bd
commit 3ef36355e9
154 changed files with 6153 additions and 9541 deletions

View File

@ -47,7 +47,14 @@ function generate_premium_get_media_query( $name ) {
function generate_get_css_print_method() {
$mode = apply_filters( 'generatepress_dynamic_css_print_method', 'inline' );
if ( ( function_exists( 'is_customize_preview' ) && is_customize_preview() ) || is_preview() ) {
if (
( function_exists( 'is_customize_preview' ) && is_customize_preview() )
||
is_preview()
||
// AMP inlines all CSS, so inlining from the start improves CSS processing performance.
( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() )
) {
return 'inline';
}
@ -57,3 +64,24 @@ function generate_get_css_print_method() {
return $mode;
}
/**
* Check to see if we have a Block Element.
*
* @since 2.0.0
* @param string $element The type of element to check.
* @param boolean $block_element Whether it's a block element or not.
*/
function generate_has_active_element( $element, $block_element ) {
global $generate_elements;
if ( ! empty( $generate_elements ) ) {
foreach ( (array) $generate_elements as $key => $data ) {
if ( $element === $data['type'] && $block_element === $data['is_block_element'] ) {
return true;
}
}
}
return false;
}