Edit File by line
/home/barbar84/www/wp-conte.../themes/Divi/includes/builder
File: conditions.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Utility functions for checking conditions.
[2] Fix | Delete
*
[3] Fix | Delete
* To be included in this file a function must:
[4] Fix | Delete
*
[5] Fix | Delete
* * Return a bool value
[6] Fix | Delete
* * Have a name that asks a yes or no question (where the first word after
[7] Fix | Delete
* the et_ prefix is a word like: is, can, has, should, was, had, must, or will)
[8] Fix | Delete
*
[9] Fix | Delete
* @package Divi
[10] Fix | Delete
* @subpackage Builder
[11] Fix | Delete
* @since 4.0.7
[12] Fix | Delete
*/
[13] Fix | Delete
[14] Fix | Delete
// phpcs:disable Squiz.PHP.CommentedOutCode -- We may add `et_builder_()` in future.
[15] Fix | Delete
[16] Fix | Delete
/*
[17] Fix | Delete
Function Template
[18] Fix | Delete
[19] Fix | Delete
if ( ! function_exists( '' ) ):
[20] Fix | Delete
function et_builder_() {
[21] Fix | Delete
[22] Fix | Delete
}
[23] Fix | Delete
endif;
[24] Fix | Delete
[25] Fix | Delete
*/
[26] Fix | Delete
// phpcs:enable
[27] Fix | Delete
[28] Fix | Delete
// Note: Functions in this file are sorted alphabetically.
[29] Fix | Delete
[30] Fix | Delete
if ( ! function_exists( 'et_builder_is_loading_data' ) ) :
[31] Fix | Delete
/**
[32] Fix | Delete
* Determine whether builder is loading full data or not.
[33] Fix | Delete
*
[34] Fix | Delete
* @param string $type Is it a bb or vb.
[35] Fix | Delete
*
[36] Fix | Delete
* @return bool
[37] Fix | Delete
*/
[38] Fix | Delete
function et_builder_is_loading_data( $type = 'vb' ) {
[39] Fix | Delete
// phpcs:disable WordPress.Security.NonceVerification -- This function does not change any stats, hence CSRF ok.
[40] Fix | Delete
if ( 'bb' === $type ) {
[41] Fix | Delete
return 'et_pb_get_backbone_templates' === et_()->array_get( $_POST, 'action' );
[42] Fix | Delete
}
[43] Fix | Delete
[44] Fix | Delete
$data_actions = array(
[45] Fix | Delete
'et_fb_retrieve_builder_data',
[46] Fix | Delete
'et_fb_update_builder_assets',
[47] Fix | Delete
);
[48] Fix | Delete
[49] Fix | Delete
return isset( $_POST['action'] ) && in_array( $_POST['action'], $data_actions, true );
[50] Fix | Delete
// phpcs:enable
[51] Fix | Delete
}
[52] Fix | Delete
endif;
[53] Fix | Delete
[54] Fix | Delete
if ( ! function_exists( 'et_builder_should_load_all_data' ) ) :
[55] Fix | Delete
/**
[56] Fix | Delete
* Determine whether to load full builder data.
[57] Fix | Delete
*
[58] Fix | Delete
* @return bool
[59] Fix | Delete
*/
[60] Fix | Delete
function et_builder_should_load_all_data() {
[61] Fix | Delete
$needs_cached_definitions = et_core_is_fb_enabled() && ! et_fb_dynamic_asset_exists( 'definitions' );
[62] Fix | Delete
[63] Fix | Delete
return $needs_cached_definitions || ( ET_Builder_ELement::is_saving_cache() || et_builder_is_loading_data() );
[64] Fix | Delete
}
[65] Fix | Delete
endif;
[66] Fix | Delete
[67] Fix | Delete
// Note: Functions in this file are sorted alphabetically.
[68] Fix | Delete
[69] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function