Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-conte.../themes/Divi/includes/builder
File: core.php
// has false publicly_queryable setting
[5000] Fix | Delete
if ( $post_id && $post_type && is_user_logged_in() && $is_unqueryable ) {
[5001] Fix | Delete
$args['et_post_id'] = $post_id;
[5002] Fix | Delete
$args['et_post_id_nonce'] = wp_create_nonce( 'et_post_id_' . $post_id );
[5003] Fix | Delete
$args['et_post_type'] = $post_type;
[5004] Fix | Delete
$args['et_post_type_nonce'] = wp_create_nonce( 'et_post_type_' . $post_type );
[5005] Fix | Delete
}
[5006] Fix | Delete
}
[5007] Fix | Delete
[5008] Fix | Delete
return add_query_arg( $args, et_fb_prepare_ssl_link( $url ? $url : get_the_permalink() ) );
[5009] Fix | Delete
}
[5010] Fix | Delete
endif;
[5011] Fix | Delete
[5012] Fix | Delete
/**
[5013] Fix | Delete
* Create a VB url.
[5014] Fix | Delete
* @param string $url Post url.
[5015] Fix | Delete
* @return string.
[5016] Fix | Delete
*/
[5017] Fix | Delete
if ( ! function_exists( 'et_fb_get_vb_url' ) ) :
[5018] Fix | Delete
function et_fb_get_vb_url( $url = false ) {
[5019] Fix | Delete
return et_fb_get_builder_url( $url );
[5020] Fix | Delete
}
[5021] Fix | Delete
endif;
[5022] Fix | Delete
[5023] Fix | Delete
/**
[5024] Fix | Delete
* Create a BFB url.
[5025] Fix | Delete
* @param string $url Post url.
[5026] Fix | Delete
* @return string.
[5027] Fix | Delete
*/
[5028] Fix | Delete
if ( ! function_exists( 'et_fb_get_bfb_url' ) ) :
[5029] Fix | Delete
function et_fb_get_bfb_url( $url = false, $is_new_page = false, $custom_page_id = false ) {
[5030] Fix | Delete
return et_fb_get_builder_url( $url, 'bfb', $is_new_page, $custom_page_id );
[5031] Fix | Delete
}
[5032] Fix | Delete
endif;
[5033] Fix | Delete
[5034] Fix | Delete
[5035] Fix | Delete
/**
[5036] Fix | Delete
* Filterable options for backend and visual builder. Designed to be filtered
[5037] Fix | Delete
* by theme/plugin since builder is shared accross Divi, Extra, and Divi Builder
[5038] Fix | Delete
* @return array builder options values
[5039] Fix | Delete
*/
[5040] Fix | Delete
if ( ! function_exists( 'et_builder_options' ) ) :
[5041] Fix | Delete
function et_builder_options() {
[5042] Fix | Delete
return apply_filters( 'et_builder_options', array(
[5043] Fix | Delete
'all_buttons_icon' => 'yes', // Default appearance of button icon
[5044] Fix | Delete
) );
[5045] Fix | Delete
}
[5046] Fix | Delete
endif;
[5047] Fix | Delete
[5048] Fix | Delete
/**
[5049] Fix | Delete
* Get specific builder option (fetched from et_builder_options())
[5050] Fix | Delete
* @param string option name
[5051] Fix | Delete
* @return mixed builder option value
[5052] Fix | Delete
*/
[5053] Fix | Delete
if ( ! function_exists( 'et_builder_option' ) ) :
[5054] Fix | Delete
function et_builder_option( $name ) {
[5055] Fix | Delete
$options = et_builder_options();
[5056] Fix | Delete
[5057] Fix | Delete
$option = isset( $options[ $name ] ) ? $options[ $name ] : false;
[5058] Fix | Delete
[5059] Fix | Delete
return apply_filters( "et_builder_option_{$name}", $option );
[5060] Fix | Delete
}
[5061] Fix | Delete
endif;
[5062] Fix | Delete
[5063] Fix | Delete
/**
[5064] Fix | Delete
* Pass thru semantical previously escaped acknowledgement
[5065] Fix | Delete
*
[5066] Fix | Delete
* @deprecated {@see et_core_esc_previously()}
[5067] Fix | Delete
*
[5068] Fix | Delete
* @since 3.17.1 Deprecated
[5069] Fix | Delete
*
[5070] Fix | Delete
* @param string value being passed through
[5071] Fix | Delete
* @return string
[5072] Fix | Delete
*/
[5073] Fix | Delete
function et_esc_previously( $passthru ) {
[5074] Fix | Delete
et_debug( "You're Doing It Wrong! Attempted to call " . __FUNCTION__ . "(), use et_core_esc_previously() instead." );
[5075] Fix | Delete
return $passthru;
[5076] Fix | Delete
}
[5077] Fix | Delete
[5078] Fix | Delete
/**
[5079] Fix | Delete
* Pass thru semantical escaped by WordPress core acknowledgement
[5080] Fix | Delete
*
[5081] Fix | Delete
* @deprecated {@see et_core_esc_wp()}
[5082] Fix | Delete
*
[5083] Fix | Delete
* @since 3.17.1 Deprecated
[5084] Fix | Delete
*
[5085] Fix | Delete
* @param string value being passed through
[5086] Fix | Delete
* @return string
[5087] Fix | Delete
*/
[5088] Fix | Delete
[5089] Fix | Delete
function et_esc_wp( $passthru ) {
[5090] Fix | Delete
et_debug( "You're Doing It Wrong! Attempted to call " . __FUNCTION__ . "(), use et_core_esc_wp() instead." );
[5091] Fix | Delete
return $passthru;
[5092] Fix | Delete
}
[5093] Fix | Delete
[5094] Fix | Delete
/**
[5095] Fix | Delete
* Pass thru semantical intentionally unescaped acknowledgement
[5096] Fix | Delete
*
[5097] Fix | Delete
* @deprecated {@see et_core_intentionally_unescaped()}
[5098] Fix | Delete
*
[5099] Fix | Delete
* @since 3.17.1 Deprecated
[5100] Fix | Delete
*
[5101] Fix | Delete
* @param string value being passed through
[5102] Fix | Delete
* @param string excuse the value is allowed to be unescaped
[5103] Fix | Delete
* @return string
[5104] Fix | Delete
*/
[5105] Fix | Delete
[5106] Fix | Delete
function et_intentionally_unescaped( $passthru, $excuse ) {
[5107] Fix | Delete
et_debug( "You're Doing It Wrong! Attempted to call " . __FUNCTION__ . "(), use et_core_intentionally_unescaped() instead." );
[5108] Fix | Delete
[5109] Fix | Delete
// Add valid excuses as they arise
[5110] Fix | Delete
$valid_excuses = array(
[5111] Fix | Delete
'cap_based_sanitized',
[5112] Fix | Delete
'fixed_string',
[5113] Fix | Delete
'react_jsx',
[5114] Fix | Delete
'underscore_template',
[5115] Fix | Delete
);
[5116] Fix | Delete
[5117] Fix | Delete
if ( ! in_array( $excuse, $valid_excuses ) ) {
[5118] Fix | Delete
et_debug( "You're Doing It Wrong! This is not a valid excuse to not escape the passed value." );
[5119] Fix | Delete
}
[5120] Fix | Delete
[5121] Fix | Delete
return $passthru;
[5122] Fix | Delete
}
[5123] Fix | Delete
[5124] Fix | Delete
/**
[5125] Fix | Delete
* Sanitize value depending on user capability
[5126] Fix | Delete
*
[5127] Fix | Delete
* @deprecated {@see et_core_sanitize_value_by_cap()}
[5128] Fix | Delete
*
[5129] Fix | Delete
* @since 3.17.1 Deprecated
[5130] Fix | Delete
*
[5131] Fix | Delete
* @return string value being passed through
[5132] Fix | Delete
*/
[5133] Fix | Delete
function et_sanitize_value_by_cap( $passthru, $sanitize_function = 'et_sanitize_html_input_text', $cap = 'unfiltered_html' ) {
[5134] Fix | Delete
et_debug( "You're Doing It Wrong! Attempted to call " . __FUNCTION__ . "(), use et_core_sanitize_value_by_cap() instead." );
[5135] Fix | Delete
[5136] Fix | Delete
if ( ! current_user_can( $cap ) ) {
[5137] Fix | Delete
$passthru = $sanitize_function( $passthru );
[5138] Fix | Delete
}
[5139] Fix | Delete
[5140] Fix | Delete
return $passthru;
[5141] Fix | Delete
}
[5142] Fix | Delete
[5143] Fix | Delete
/**
[5144] Fix | Delete
* Pass thru semantical intentionally unsanitized acknowledgement
[5145] Fix | Delete
*
[5146] Fix | Delete
* @deprecated {@see et_core_intentinally_unsanitized()}
[5147] Fix | Delete
*
[5148] Fix | Delete
* @since 3.17.1 Deprecated
[5149] Fix | Delete
*
[5150] Fix | Delete
* @param string value being passed through
[5151] Fix | Delete
* @param string excuse the value is allowed to be unsanitized
[5152] Fix | Delete
* @return string
[5153] Fix | Delete
*/
[5154] Fix | Delete
[5155] Fix | Delete
function et_intentionally_unsanitized( $passthru, $excuse ) {
[5156] Fix | Delete
et_debug( "You're Doing It Wrong! Attempted to call " . __FUNCTION__ . "(), use et_core_intentionally_unsanitized() instead." );
[5157] Fix | Delete
[5158] Fix | Delete
// Add valid excuses as they arise
[5159] Fix | Delete
$valid_excuses = array();
[5160] Fix | Delete
[5161] Fix | Delete
if ( ! in_array( $excuse, $valid_excuses ) ) {
[5162] Fix | Delete
et_debug( "You're Doing It Wrong! This is not a valid excuse to not sanitize the passed value." );
[5163] Fix | Delete
}
[5164] Fix | Delete
[5165] Fix | Delete
return $passthru;
[5166] Fix | Delete
}
[5167] Fix | Delete
[5168] Fix | Delete
/**
[5169] Fix | Delete
* Prevent delimiter-separated string from having duplicate item
[5170] Fix | Delete
* @param string delimiter-separated string
[5171] Fix | Delete
* @param string delimiter
[5172] Fix | Delete
* @return string filtered delimiter-separated string
[5173] Fix | Delete
*/
[5174] Fix | Delete
function et_prevent_duplicate_item( $stringList, $delimiter ) {
[5175] Fix | Delete
$list = explode( $delimiter, $stringList );
[5176] Fix | Delete
[5177] Fix | Delete
return implode( $delimiter, array_unique( $list ) );
[5178] Fix | Delete
}
[5179] Fix | Delete
[5180] Fix | Delete
/**
[5181] Fix | Delete
* Determining whether unminified scripts should be loaded or not.
[5182] Fix | Delete
* @return bool
[5183] Fix | Delete
*/
[5184] Fix | Delete
function et_load_unminified_scripts() {
[5185] Fix | Delete
static $should_load = null;
[5186] Fix | Delete
[5187] Fix | Delete
if ( null === $should_load ) {
[5188] Fix | Delete
$is_script_debug = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG;
[5189] Fix | Delete
[5190] Fix | Delete
$should_load = apply_filters( 'et_load_unminified_scripts', $is_script_debug );
[5191] Fix | Delete
}
[5192] Fix | Delete
[5193] Fix | Delete
return $should_load;
[5194] Fix | Delete
}
[5195] Fix | Delete
[5196] Fix | Delete
/**
[5197] Fix | Delete
* Determining whether unminified styles should be loaded or not
[5198] Fix | Delete
*/
[5199] Fix | Delete
function et_load_unminified_styles() {
[5200] Fix | Delete
static $should_load = null;
[5201] Fix | Delete
[5202] Fix | Delete
if ( null === $should_load ) {
[5203] Fix | Delete
$is_script_debug = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG;
[5204] Fix | Delete
[5205] Fix | Delete
$should_load = apply_filters( 'et_load_unminified_styles', $is_script_debug );
[5206] Fix | Delete
}
[5207] Fix | Delete
[5208] Fix | Delete
return $should_load;
[5209] Fix | Delete
}
[5210] Fix | Delete
[5211] Fix | Delete
/**
[5212] Fix | Delete
* Enable / Disable classic editor based on saved option in Theme Options page.
[5213] Fix | Delete
* Only applies to versions of WordPress that have the Gutenberg editor.
[5214] Fix | Delete
*
[5215] Fix | Delete
* @since 3.18
[5216] Fix | Delete
*
[5217] Fix | Delete
* @param bool
[5218] Fix | Delete
*
[5219] Fix | Delete
* @return bool
[5220] Fix | Delete
*/
[5221] Fix | Delete
function et_builder_enable_classic_editor( $enable ) {
[5222] Fix | Delete
if ( 'on' === et_get_option( 'et_enable_classic_editor', 'off' ) ) {
[5223] Fix | Delete
return true;
[5224] Fix | Delete
}
[5225] Fix | Delete
[5226] Fix | Delete
return $enable;
[5227] Fix | Delete
}
[5228] Fix | Delete
if ( version_compare( $GLOBALS['wp_version'], '5.0-beta', '>=' ) ) {
[5229] Fix | Delete
add_filter( 'et_builder_enable_classic_editor', 'et_builder_enable_classic_editor' );
[5230] Fix | Delete
}
[5231] Fix | Delete
[5232] Fix | Delete
/**
[5233] Fix | Delete
* Check whether the BFB is enabled.
[5234] Fix | Delete
*
[5235] Fix | Delete
* @since 3.18
[5236] Fix | Delete
*
[5237] Fix | Delete
* @return bool
[5238] Fix | Delete
*/
[5239] Fix | Delete
function et_builder_bfb_enabled() {
[5240] Fix | Delete
return apply_filters( 'et_builder_bfb_enabled', false );
[5241] Fix | Delete
}
[5242] Fix | Delete
[5243] Fix | Delete
/**
[5244] Fix | Delete
* Check whether BFB is activated for this site or not.
[5245] Fix | Delete
*
[5246] Fix | Delete
* @since 3.28
[5247] Fix | Delete
*
[5248] Fix | Delete
* @return bool
[5249] Fix | Delete
*/
[5250] Fix | Delete
function et_builder_bfb_activated() {
[5251] Fix | Delete
$bfb_settings = get_option( 'et_bfb_settings' );
[5252] Fix | Delete
$enabled = isset( $bfb_settings['enable_bfb'] ) && 'on' === $bfb_settings['enable_bfb'];
[5253] Fix | Delete
return $enabled;
[5254] Fix | Delete
}
[5255] Fix | Delete
[5256] Fix | Delete
/**
[5257] Fix | Delete
* Check whether the VB is loaded through TB.
[5258] Fix | Delete
*
[5259] Fix | Delete
* @since 4.0
[5260] Fix | Delete
*
[5261] Fix | Delete
* @return bool
[5262] Fix | Delete
*/
[5263] Fix | Delete
function et_builder_tb_enabled() {
[5264] Fix | Delete
// Layout Block uses abstracted visual builder on modal originally introduced in TB. However,
[5265] Fix | Delete
// TB needs different Divi capability, hence adjust it for Layout Block Builder
[5266] Fix | Delete
$is_layout_block = ET_GB_Block_Layout::is_layout_block_preview();
[5267] Fix | Delete
$builder_capability = $is_layout_block ? 'use_visual_builder' : 'theme_builder';
[5268] Fix | Delete
[5269] Fix | Delete
return et_core_is_fb_enabled() && et_pb_is_allowed( $builder_capability ) && isset( $_GET['et_tb'] ) && '1' === $_GET['et_tb'];
[5270] Fix | Delete
}
[5271] Fix | Delete
[5272] Fix | Delete
/**
[5273] Fix | Delete
* Check if the current screen is the Theme Builder administration screen.
[5274] Fix | Delete
*
[5275] Fix | Delete
* @since 4.0
[5276] Fix | Delete
*
[5277] Fix | Delete
* @return bool
[5278] Fix | Delete
*/
[5279] Fix | Delete
function et_builder_is_tb_admin_screen() {
[5280] Fix | Delete
global $pagenow;
[5281] Fix | Delete
[5282] Fix | Delete
return is_admin() && 'admin.php' === $pagenow && isset( $_GET['page'] ) && 'et_theme_builder' === $_GET['page'];
[5283] Fix | Delete
}
[5284] Fix | Delete
[5285] Fix | Delete
if ( ! function_exists( 'et_builder_filter_bfb_enabled') ):
[5286] Fix | Delete
/**
[5287] Fix | Delete
* Theme implementation for BFB enabled check.
[5288] Fix | Delete
*
[5289] Fix | Delete
* @since 3.18
[5290] Fix | Delete
*
[5291] Fix | Delete
* @return bool
[5292] Fix | Delete
*/
[5293] Fix | Delete
function et_builder_filter_bfb_enabled() {
[5294] Fix | Delete
global $pagenow;
[5295] Fix | Delete
[5296] Fix | Delete
$enabled = et_builder_bfb_activated();
[5297] Fix | Delete
[5298] Fix | Delete
if ( is_admin() && ! in_array( $pagenow, array( 'post.php', 'post-new.php', 'admin-ajax.php' ) ) ) {
[5299] Fix | Delete
$enabled = false;
[5300] Fix | Delete
} else if ( ! is_admin() && ! isset( $_GET['et_bfb'] ) ) {
[5301] Fix | Delete
$enabled = false;
[5302] Fix | Delete
} else if ( ! et_pb_is_allowed( 'use_visual_builder' ) ) {
[5303] Fix | Delete
$enabled = false;
[5304] Fix | Delete
}
[5305] Fix | Delete
[5306] Fix | Delete
return $enabled;
[5307] Fix | Delete
}
[5308] Fix | Delete
endif;
[5309] Fix | Delete
[5310] Fix | Delete
if ( ! function_exists( 'et_builder_is_fresh_install') ):
[5311] Fix | Delete
/**
[5312] Fix | Delete
* Get whether the builder is freshly installed.
[5313] Fix | Delete
*
[5314] Fix | Delete
* @since 3.18
[5315] Fix | Delete
*
[5316] Fix | Delete
* @return bool
[5317] Fix | Delete
*/
[5318] Fix | Delete
function et_builder_is_fresh_install() {
[5319] Fix | Delete
return apply_filters( 'et_builder_is_fresh_install', false );
[5320] Fix | Delete
}
[5321] Fix | Delete
endif;
[5322] Fix | Delete
[5323] Fix | Delete
if ( ! function_exists( 'et_builder_filter_is_fresh_install') ):
[5324] Fix | Delete
/**
[5325] Fix | Delete
* Theme implementation for fresh install check.
[5326] Fix | Delete
*
[5327] Fix | Delete
* @since 3.18
[5328] Fix | Delete
*
[5329] Fix | Delete
* @return bool
[5330] Fix | Delete
*/
[5331] Fix | Delete
function et_builder_filter_is_fresh_install() {
[5332] Fix | Delete
global $shortname;
[5333] Fix | Delete
[5334] Fix | Delete
return false === et_get_option( $shortname . '_logo' );
[5335] Fix | Delete
}
[5336] Fix | Delete
endif;
[5337] Fix | Delete
[5338] Fix | Delete
/**
[5339] Fix | Delete
* Determine whether current request is AJAX request for loading BB data
[5340] Fix | Delete
*
[5341] Fix | Delete
* @since 3.28
[5342] Fix | Delete
*
[5343] Fix | Delete
* @todo remove & replace this function with `et_builder_is_loading_data()` once PR #6325 is merged
[5344] Fix | Delete
*
[5345] Fix | Delete
* @return bool
[5346] Fix | Delete
*/
[5347] Fix | Delete
function et_builder_is_loading_bb_data() {
[5348] Fix | Delete
return isset( $_POST['action'] ) && in_array( $_POST['action'], array( 'et_pb_get_backbone_templates', 'et_pb_get_backbone_template' ) ); // phpcs:ignore WordPress.Security.NonceVerification.NoNonceVerification
[5349] Fix | Delete
}
[5350] Fix | Delete
[5351] Fix | Delete
/**
[5352] Fix | Delete
* Determine whether current request is classic builder (BB) edit page
[5353] Fix | Delete
*
[5354] Fix | Delete
* @since 3.28
[5355] Fix | Delete
*
[5356] Fix | Delete
* @return bool
[5357] Fix | Delete
*/
[5358] Fix | Delete
function et_builder_is_bb_page() {
[5359] Fix | Delete
// BB Is definitely on backend
[5360] Fix | Delete
if ( ! is_admin() ) {
[5361] Fix | Delete
return false;
[5362] Fix | Delete
}
[5363] Fix | Delete
[5364] Fix | Delete
// BB page is on either post new or edit post page in backend
[5365] Fix | Delete
global $pagenow;
[5366] Fix | Delete
[5367] Fix | Delete
if ( ! in_array( $pagenow, array( 'post.php', 'post-new.php' ) ) ) {
[5368] Fix | Delete
return false;
[5369] Fix | Delete
}
[5370] Fix | Delete
[5371] Fix | Delete
// If BFB is activated, this is definitely not BB page
[5372] Fix | Delete
if ( et_builder_bfb_enabled() ) {
[5373] Fix | Delete
return false;
[5374] Fix | Delete
}
[5375] Fix | Delete
[5376] Fix | Delete
// Check if current post type has builder activated
[5377] Fix | Delete
if ( 'post-new.php' === $pagenow ) {
[5378] Fix | Delete
$post_type = isset( $_GET['post_type'] ) ? $_GET['post_type'] : 'post';
[5379] Fix | Delete
} else {
[5380] Fix | Delete
$post_id = isset( $_GET['post'] ) ? $_GET['post'] : false;
[5381] Fix | Delete
$post_type = get_post_type( $post_id );
[5382] Fix | Delete
}
[5383] Fix | Delete
[5384] Fix | Delete
return et_builder_enabled_for_post_type( $post_type );
[5385] Fix | Delete
}
[5386] Fix | Delete
[5387] Fix | Delete
if ( ! function_exists( 'et_builder_toggle_bfb') ):
[5388] Fix | Delete
/**
[5389] Fix | Delete
* Toggle BFB.
[5390] Fix | Delete
*
[5391] Fix | Delete
* @since 3.18
[5392] Fix | Delete
*
[5393] Fix | Delete
* @param bool $enable
[5394] Fix | Delete
*
[5395] Fix | Delete
* @return void
[5396] Fix | Delete
*/
[5397] Fix | Delete
function et_builder_toggle_bfb( $enable ) {
[5398] Fix | Delete
do_action( 'et_builder_toggle_bfb', $enable );
[5399] Fix | Delete
}
[5400] Fix | Delete
endif;
[5401] Fix | Delete
[5402] Fix | Delete
if ( ! function_exists( 'et_builder_action_toggle_bfb') ):
[5403] Fix | Delete
/**
[5404] Fix | Delete
* Theme implementation for BFB toggle.
[5405] Fix | Delete
*
[5406] Fix | Delete
* @since 3.18
[5407] Fix | Delete
*
[5408] Fix | Delete
* @param bool $enable
[5409] Fix | Delete
*
[5410] Fix | Delete
* @return void
[5411] Fix | Delete
*/
[5412] Fix | Delete
function et_builder_action_toggle_bfb( $enable ) {
[5413] Fix | Delete
$bfb_value = $enable ? 'on' : 'off';
[5414] Fix | Delete
[5415] Fix | Delete
et_update_option( '', $bfb_value, true, 'et_bfb_settings', 'enable_bfb' );
[5416] Fix | Delete
}
[5417] Fix | Delete
endif;
[5418] Fix | Delete
[5419] Fix | Delete
if ( ! function_exists( 'et_builder_show_bfb_welcome_modal' ) ) :
[5420] Fix | Delete
/**
[5421] Fix | Delete
* Show the BFB welcome modal.
[5422] Fix | Delete
*
[5423] Fix | Delete
* @since 3.18
[5424] Fix | Delete
*
[5425] Fix | Delete
* @return void
[5426] Fix | Delete
*/
[5427] Fix | Delete
function et_builder_show_bfb_welcome_modal() {
[5428] Fix | Delete
global $pagenow;
[5429] Fix | Delete
[5430] Fix | Delete
// Cancel if BFB is not enabled yet
[5431] Fix | Delete
if ( ! et_builder_bfb_enabled() ) {
[5432] Fix | Delete
return;
[5433] Fix | Delete
}
[5434] Fix | Delete
[5435] Fix | Delete
// Cancel if current request is not editing screen
[5436] Fix | Delete
if ( ! in_array( $pagenow, array( 'post.php', 'post-new.php' ) ) ) {
[5437] Fix | Delete
return;
[5438] Fix | Delete
}
[5439] Fix | Delete
[5440] Fix | Delete
// Cancel if current edit screen use Gutenberg. `use_block_editor_for_post_type()` was added
[5441] Fix | Delete
// after v5.0 so check for its existance first in case current WP version is below 5.0
[5442] Fix | Delete
if ( function_exists( 'use_block_editor_for_post_type' ) && use_block_editor_for_post_type( get_post_type() ) ) {
[5443] Fix | Delete
return;
[5444] Fix | Delete
}
[5445] Fix | Delete
[5446] Fix | Delete
// Cancel if current edit screen doesn't use builder
[5447] Fix | Delete
if ( ! et_pb_is_pagebuilder_used() ) {
[5448] Fix | Delete
return;
[5449] Fix | Delete
}
[5450] Fix | Delete
[5451] Fix | Delete
// Cancel if assigned transient doesn't exist
[5452] Fix | Delete
if ( ! get_transient( 'et_builder_show_bfb_welcome_modal' ) ) {
[5453] Fix | Delete
return;
[5454] Fix | Delete
}
[5455] Fix | Delete
[5456] Fix | Delete
// Clear Builder assets cache to avoid double reloading of BFB after theme update.
[5457] Fix | Delete
et_fb_delete_builder_assets();
[5458] Fix | Delete
[5459] Fix | Delete
// Clear Builder assets cache to avoid double reloading of BFB after theme update.
[5460] Fix | Delete
et_fb_delete_builder_assets();
[5461] Fix | Delete
[5462] Fix | Delete
delete_transient( 'et_builder_show_bfb_welcome_modal' );
[5463] Fix | Delete
?>
[5464] Fix | Delete
<div class="et-core-modal-overlay et-builder-bfb-welcome-modal" style="z-index: 9999999999;">
[5465] Fix | Delete
<div class="et-core-modal">
[5466] Fix | Delete
<div class="et-core-modal-header">
[5467] Fix | Delete
<h3 class="et-core-modal-title"><?php esc_html_e( 'Welcome To The New Builder', 'et_builder' ); ?></h3>
[5468] Fix | Delete
</div>
[5469] Fix | Delete
[5470] Fix | Delete
<div class="et-core-modal-content">
[5471] Fix | Delete
<p><?php esc_html_e( 'You are now using the latest Divi Builder experience! This new version of the builder comes with many interface enhancements that were previously only available in the Visual Builder. It also improves performance and takes advantage of the latest builder technology. You can still switch back to the Classic Builder in your Divi Theme Options, however, we recommend familiarizing yourself with the new version and everything it has to offer.', 'et_builder' ); ?></p>
[5472] Fix | Delete
<p><a href="https://www.elegantthemes.com/blog/theme-releases/introducing-the-new-divi-builder-experience" target="_blank"><?php esc_html_e( 'Learn more about the new experience here.', 'et_builder' ); ?></a></p>
[5473] Fix | Delete
</div>
[5474] Fix | Delete
[5475] Fix | Delete
<div class="et_pb_prompt_buttons">
[5476] Fix | Delete
<a href="#" class="et-core-modal-action" data-et-core-modal="close"><?php esc_html_e( 'Start Building', 'et_builder' ); ?></a>
[5477] Fix | Delete
</div>
[5478] Fix | Delete
</div>
[5479] Fix | Delete
</div> );
[5480] Fix | Delete
<script>
[5481] Fix | Delete
jQuery(document).ready(function() {
[5482] Fix | Delete
etCore.modalOpen(jQuery('.et-builder-bfb-welcome-modal:first'));
[5483] Fix | Delete
});
[5484] Fix | Delete
</script>
[5485] Fix | Delete
<?php
[5486] Fix | Delete
}
[5487] Fix | Delete
endif;
[5488] Fix | Delete
add_action( 'admin_footer', 'et_builder_show_bfb_welcome_modal' );
[5489] Fix | Delete
[5490] Fix | Delete
if ( ! function_exists( 'et_builder_prepare_bfb') ):
[5491] Fix | Delete
/**
[5492] Fix | Delete
* Maybe queue BFB opt-in modal.
[5493] Fix | Delete
*
[5494] Fix | Delete
* @since 3.18
[5495] Fix | Delete
*
[5496] Fix | Delete
* @return void
[5497] Fix | Delete
*/
[5498] Fix | Delete
function et_builder_prepare_bfb() {
[5499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function