Upgarded to 4.17.4
This commit is contained in:
@ -156,7 +156,6 @@ function et_theme_builder_enqueue_scripts() {
|
||||
'distPath' => ET_BUILDER_URI . '/frontend-builder/build/',
|
||||
'api' => admin_url( 'admin-ajax.php' ),
|
||||
'apiErrors' => ET_Theme_Builder_Api_Errors::getMap(),
|
||||
'diviLibraryUrl' => ET_BUILDER_DIVI_LIBRARY_URL,
|
||||
'diviLibraryCustomTabs' => apply_filters( 'et_builder_library_modal_custom_tabs', array(), 'theme-builder' ),
|
||||
'nonces' => array(
|
||||
'et_builder_library_get_layouts_data' => wp_create_nonce( 'et_builder_library_get_layouts_data' ),
|
||||
@ -193,6 +192,11 @@ function et_theme_builder_enqueue_scripts() {
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
// Load Library and Cloud.
|
||||
et_builder_load_library();
|
||||
|
||||
ET_Cloud_App::load_js();
|
||||
}
|
||||
add_action( 'admin_enqueue_scripts', 'et_theme_builder_enqueue_scripts' );
|
||||
|
||||
|
@ -82,7 +82,7 @@ function et_theme_builder_filter_resolve_default_dynamic_content( $content, $nam
|
||||
$custom_format = $_->array_get( $settings, 'custom_date_format', $def( $post_id, $name, 'custom_date_format' ) );
|
||||
|
||||
if ( 'default' === $format ) {
|
||||
$format = get_option( 'date_format' );
|
||||
$format = strval( get_option( 'date_format' ) );
|
||||
}
|
||||
|
||||
if ( 'custom' === $format ) {
|
||||
|
@ -135,7 +135,7 @@ function et_theme_builder_frontend_enqueue_styles( $layouts ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ! is_singular() || et_core_is_fb_enabled() ) {
|
||||
if ( ! is_singular() && ! et_core_is_fb_enabled() ) {
|
||||
// Create styles managers so they can enqueue styles early enough.
|
||||
// What styles are created and how they are enqueued:
|
||||
// - In FE, singular post view:
|
||||
|
@ -791,8 +791,9 @@ function et_theme_builder_get_template_settings_options_for_archive_pages() {
|
||||
* @since 4.3.3
|
||||
*
|
||||
* @param boolean $show
|
||||
* @param object $taxonomy
|
||||
*/
|
||||
$show = apply_filters( 'et_theme_builder_template_settings_options_term_pages', $taxonomy->public && $taxonomy->show_ui );
|
||||
$show = apply_filters( 'et_theme_builder_template_settings_options_term_pages', $taxonomy->public && $taxonomy->show_ui, $taxonomy );
|
||||
|
||||
if ( ! $show ) {
|
||||
continue;
|
||||
@ -1195,6 +1196,11 @@ function et_theme_builder_get_template_setting_child_options( $parent, $include
|
||||
function et_theme_builder_get_template_layouts( $request = null, $cache = true, $load_from_cache = true ) {
|
||||
static $store = array();
|
||||
|
||||
// Ignore TB templates when editing cloud items.
|
||||
if ( isset( $_GET['cloudItem'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification -- This function does not change any state, and is therefore not susceptible to CSRF.
|
||||
return array();
|
||||
}
|
||||
|
||||
if ( null === $request ) {
|
||||
if ( is_embed() ) {
|
||||
// Ignore TB templates when displaying posts intended for embedding.
|
||||
|
@ -66,9 +66,11 @@ function et_theme_builder_wc_review_placeholder() {
|
||||
* @param array $conditional_tags evaluate conditional tags when current request is AJAX request
|
||||
*/
|
||||
function et_theme_builder_wc_set_global_objects( $conditional_tags = array() ) {
|
||||
$is_tb = et_()->array_get( $conditional_tags, 'is_tb', false );
|
||||
$is_tb = et_()->array_get( $conditional_tags, 'is_tb', false );
|
||||
$is_use_placeholder = $is_tb || is_et_pb_preview();
|
||||
|
||||
// Check if current request is theme builder (direct page / AJAX request)
|
||||
if ( ! et_builder_tb_enabled() && ! $is_tb ) {
|
||||
if ( ! et_builder_tb_enabled() && ! $is_use_placeholder ) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -101,7 +103,7 @@ function et_theme_builder_wc_set_global_objects( $conditional_tags = array() ) {
|
||||
// Get placeholders
|
||||
$placeholders = et_theme_builder_wc_placeholders();
|
||||
|
||||
if ( $is_tb ) {
|
||||
if ( $is_use_placeholder ) {
|
||||
$placeholder_src = wc_placeholder_img_src( 'full' );
|
||||
$placeholder_id = attachment_url_to_postid( $placeholder_src );
|
||||
|
||||
@ -131,7 +133,9 @@ function et_theme_builder_wc_set_global_objects( $conditional_tags = array() ) {
|
||||
// Set current post ID as product's ID. `ET_Theme_Builder_Woocommerce_Product_Variable_Placeholder`
|
||||
// handles all placeholder related value but product ID need to be manually set to match current
|
||||
// post's ID. This is especially needed when add-ons is used and accessing get_id() method.
|
||||
$product->set_id( $post->ID );
|
||||
if ( isset( $post->ID ) ) {
|
||||
$product->set_id( $post->ID );
|
||||
}
|
||||
|
||||
// Save modified global for later use
|
||||
$tb_wc_post = $post;
|
||||
@ -142,9 +146,16 @@ function et_theme_builder_wc_set_global_objects( $conditional_tags = array() ) {
|
||||
* Reset global objects needed to manipulate `ETBuilderBackend.currentPage.woocommerceComponents`
|
||||
*
|
||||
* @since 4.0.1
|
||||
* @since 4.14.5 Add conditional tags parameter to evaluate AJAX request.
|
||||
*
|
||||
* @param array $conditional_tags Evaluate conditional tags when current request is AJAX request.
|
||||
*/
|
||||
function et_theme_builder_wc_reset_global_objects() {
|
||||
if ( ! et_builder_tb_enabled() ) {
|
||||
function et_theme_builder_wc_reset_global_objects( $conditional_tags = array() ) {
|
||||
$is_tb = et_()->array_get( $conditional_tags, 'is_tb', false );
|
||||
$is_use_placeholder = $is_tb || is_et_pb_preview();
|
||||
|
||||
// Check if current request is theme builder (direct page / AJAX request).
|
||||
if ( ! et_builder_tb_enabled() && ! $is_use_placeholder ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user