upgraded to 4.14
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
<?php
|
||||
|
||||
// Note, this will be updated automatically during grunt release task
|
||||
$ET_CORE_VERSION = '4.13.0';
|
||||
$ET_CORE_VERSION = '4.14.4';
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1639,6 +1639,10 @@ class ET_Core_Portability {
|
||||
* @return array
|
||||
*/
|
||||
protected function get_data_images( $data, $force = false ) {
|
||||
if ( empty( $data ) ) {
|
||||
return array();
|
||||
}
|
||||
|
||||
$images = array();
|
||||
$images_src = array();
|
||||
$basenames = array(
|
||||
@ -1663,8 +1667,19 @@ class ET_Core_Portability {
|
||||
}
|
||||
|
||||
foreach ( $data as $value ) {
|
||||
if ( is_array( $value ) || is_object( $value ) ) {
|
||||
$images = array_merge( $images, $this->get_data_images( (array) $value ) );
|
||||
// If the $value is an object, but not a Post object then it's unlikely to contain any image data.
|
||||
if ( is_object( $value ) && ! $value instanceof WP_Post ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( is_array( $value ) ) {
|
||||
$images = array_merge( $images, $this->get_data_images( $value ) );
|
||||
$value = implode( '|', $value );
|
||||
} elseif ( $value instanceof WP_Post ) {
|
||||
// If the $value is a Post object, we need only the post content.
|
||||
$value = (array) $value->post_content;
|
||||
$images = array_merge( $images, $this->get_data_images( $value ) );
|
||||
$value = implode( '|', $value );
|
||||
}
|
||||
|
||||
// Extract images from HTML or shortcodes.
|
||||
|
@ -67,8 +67,24 @@ class ET_Core_API_Spam_ReCaptcha extends ET_Core_API_Spam_Provider {
|
||||
}
|
||||
|
||||
public function is_enabled() {
|
||||
return isset( $this->data['site_key'], $this->data['secret_key'] )
|
||||
$has_recaptcha_module = true;
|
||||
|
||||
if ( class_exists( 'ET_Dynamic_Assets' ) ) {
|
||||
$et_dynamic_module_framework = et_builder_dynamic_module_framework();
|
||||
$enabled = et_builder_is_frontend() && 'on' === $et_dynamic_module_framework;
|
||||
|
||||
if ( $enabled ) {
|
||||
$et_dynamic_assets = ET_Dynamic_Assets::init();
|
||||
$saved_shortcodes = $et_dynamic_assets->get_saved_page_shortcodes();
|
||||
$recaptcha_modules = array( 'et_pb_contact_form', 'et_pb_signup' );
|
||||
$has_recaptcha_module = ! empty( array_intersect( $saved_shortcodes, $recaptcha_modules ) );
|
||||
}
|
||||
}
|
||||
|
||||
$has_key = isset( $this->data['site_key'], $this->data['secret_key'] )
|
||||
&& et_()->all( array( $this->data['site_key'], $this->data['secret_key'] ) );
|
||||
|
||||
return $has_key && $has_recaptcha_module;
|
||||
}
|
||||
|
||||
/**
|
||||
|
2
core/components/cache/Directory.php
vendored
2
core/components/cache/Directory.php
vendored
@ -83,7 +83,7 @@ class ET_Core_Cache_Directory {
|
||||
}
|
||||
|
||||
$this->can_write = $can_write || $can_create;
|
||||
$this->path = $path;
|
||||
$this->path = et_()->normalize_path( $path );
|
||||
$this->url = $url;
|
||||
|
||||
$this->_maybe_adjust_path_for_multisite( $uploads_dir_info );
|
||||
|
@ -1041,6 +1041,46 @@ class ET_Core_Data_Utils {
|
||||
$buffer[15]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Append/Prepend to comma separated selectors.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* @see UtilsTest::testAppendPrependCommaSeparatedSelectors()
|
||||
*
|
||||
* @param string $css_selector Comma separated CSS selectors.
|
||||
* @param string $value Value to append/prepend.
|
||||
* @param string $prefix_suffix Values can be `prefix` or `suffix`.
|
||||
* @param bool $is_space_required Is space required? // phpcs:ignore Squiz.Commenting.FunctionComment.ParamCommentFullStop -- Respecting punctuation.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function append_prepend_comma_separated_selectors(
|
||||
$css_selector,
|
||||
$value,
|
||||
$prefix_suffix,
|
||||
$is_space_required = true
|
||||
) {
|
||||
$css_selectors = explode( ',', $css_selector );
|
||||
$css_selectors_processed = array();
|
||||
$is_prefix = 'prefix' === $prefix_suffix;
|
||||
|
||||
foreach ( $css_selectors as $selector ) {
|
||||
$selector = rtrim( ltrim( $selector ) );
|
||||
if ( $is_prefix && $is_space_required ) {
|
||||
$css_selectors_processed[] = sprintf( '%2$s %1$s', $selector, $value );
|
||||
} elseif ( $is_prefix && ! $is_space_required ) {
|
||||
$css_selectors_processed[] = sprintf( '%2$s%1$s', $selector, $value );
|
||||
} elseif ( ! $is_prefix && $is_space_required ) {
|
||||
$css_selectors_processed[] = sprintf( '%1$s %2$s', $selector, $value );
|
||||
} elseif ( ! $is_prefix && ! $is_space_required ) {
|
||||
$css_selectors_processed[] = sprintf( '%1$s%2$s', $selector, $value );
|
||||
}
|
||||
}
|
||||
|
||||
return implode( ',', $css_selectors_processed );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -265,20 +265,29 @@ function et_core_get_main_fonts() {
|
||||
endif;
|
||||
|
||||
|
||||
if ( ! function_exists( 'et_core_get_theme_info' ) ):
|
||||
function et_core_get_theme_info( $key ) {
|
||||
static $theme_info = null;
|
||||
if ( ! function_exists( 'et_core_get_theme_info' ) ) :
|
||||
/**
|
||||
* Gets Theme Info.
|
||||
*
|
||||
* Gets Parent theme's info even when child theme is used.
|
||||
*
|
||||
* @param string $key One of WP_Theme class public properties.
|
||||
*
|
||||
* @returns string
|
||||
*/
|
||||
function et_core_get_theme_info( $key ) {
|
||||
static $theme_info = null;
|
||||
|
||||
if ( ! $theme_info ) {
|
||||
$theme_info = wp_get_theme();
|
||||
if ( ! $theme_info ) {
|
||||
$theme_info = wp_get_theme();
|
||||
|
||||
if ( defined( 'STYLESHEETPATH' ) && is_child_theme() ) {
|
||||
$theme_info = wp_get_theme( $theme_info->parent_theme );
|
||||
if ( defined( 'STYLESHEETPATH' ) && is_child_theme() ) {
|
||||
$theme_info = wp_get_theme( $theme_info->parent_theme );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $theme_info->display( $key );
|
||||
}
|
||||
return $theme_info->display( $key );
|
||||
}
|
||||
endif;
|
||||
|
||||
|
||||
@ -875,7 +884,8 @@ if ( ! function_exists( 'et_requeue_child_theme_styles' ) ) :
|
||||
|
||||
foreach ( $styles->registered as $handle => $style ) {
|
||||
if ( preg_match( '/' . $template_directory_uri . '.*/', $style->src ) ) {
|
||||
et_core_replace_enqueued_style( $style->src, '', $theme_version, '', $style_dep, false );
|
||||
$style_version = isset( $style->ver ) ? $style->ver : $theme_version;
|
||||
et_core_replace_enqueued_style( $style->src, '', $style_version, '', $style_dep, false );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user