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
/home/sportsfe.../httpdocs/clone/wp-conte.../themes/Divi/includes/builder/frontend...
File: helpers.php
<?php
[0] Fix | Delete
[1] Fix | Delete
function et_fb_shortcode_tags() {
[2] Fix | Delete
global $shortcode_tags;
[3] Fix | Delete
[4] Fix | Delete
$shortcode_tag_names = array();
[5] Fix | Delete
foreach ( $shortcode_tags as $shortcode_tag_name => $shortcode_tag_cb ) {
[6] Fix | Delete
$shortcode_tag_names[] = $shortcode_tag_name;
[7] Fix | Delete
}
[8] Fix | Delete
return implode( '|', $shortcode_tag_names );
[9] Fix | Delete
}
[10] Fix | Delete
[11] Fix | Delete
function et_fb_prepare_library_cats() {
[12] Fix | Delete
$raw_categories_array = apply_filters( 'et_pb_new_layout_cats_array', get_terms( 'layout_category', array( 'hide_empty' => false ) ) );
[13] Fix | Delete
$clean_categories_array = array();
[14] Fix | Delete
[15] Fix | Delete
if ( is_array( $raw_categories_array ) && ! empty( $raw_categories_array ) ) {
[16] Fix | Delete
foreach( $raw_categories_array as $category ) {
[17] Fix | Delete
$clean_categories_array[] = array(
[18] Fix | Delete
'name' => html_entity_decode( $category->name ),
[19] Fix | Delete
'id' => $category->term_id,
[20] Fix | Delete
'slug' => $category->slug,
[21] Fix | Delete
);
[22] Fix | Delete
}
[23] Fix | Delete
}
[24] Fix | Delete
[25] Fix | Delete
return $clean_categories_array;
[26] Fix | Delete
}
[27] Fix | Delete
[28] Fix | Delete
function et_fb_get_layout_type( $post_id ) {
[29] Fix | Delete
return et_fb_get_layout_term_slug( $post_id, 'layout_type' );
[30] Fix | Delete
}
[31] Fix | Delete
[32] Fix | Delete
function et_fb_get_layout_term_slug( $post_id, $term_name ) {
[33] Fix | Delete
$post_terms = wp_get_post_terms( $post_id, $term_name );
[34] Fix | Delete
$slug = $post_terms[0]->slug;
[35] Fix | Delete
[36] Fix | Delete
return $slug;
[37] Fix | Delete
}
[38] Fix | Delete
[39] Fix | Delete
function et_fb_comments_template() {
[40] Fix | Delete
return ET_BUILDER_DIR . 'comments_template.php';
[41] Fix | Delete
}
[42] Fix | Delete
[43] Fix | Delete
function et_fb_modify_comments_request( $params ) {
[44] Fix | Delete
// modify the request parameters the way it doesn't change the result just to make request with unique parameters
[45] Fix | Delete
$params->query_vars['type__not_in'] = 'et_pb_comments_random_type_9999';
[46] Fix | Delete
}
[47] Fix | Delete
[48] Fix | Delete
function et_fb_comments_submit_button( $submit_button ) {
[49] Fix | Delete
return sprintf(
[50] Fix | Delete
'<button name="%1$s" type="submit" id="%2$s" class="%3$s">%4$s</button>',
[51] Fix | Delete
esc_attr( 'submit' ),
[52] Fix | Delete
esc_attr( 'et_pb_submit' ),
[53] Fix | Delete
esc_attr( 'submit et_pb_button' ),
[54] Fix | Delete
esc_html_x( 'Submit Comment', 'et_builder' )
[55] Fix | Delete
);
[56] Fix | Delete
}
[57] Fix | Delete
[58] Fix | Delete
/**
[59] Fix | Delete
* Generate custom comments number for Comments Module preview in Theme Builder.
[60] Fix | Delete
*
[61] Fix | Delete
* @return string
[62] Fix | Delete
*/
[63] Fix | Delete
function et_builder_set_comments_number() {
[64] Fix | Delete
return '12';
[65] Fix | Delete
}
[66] Fix | Delete
[67] Fix | Delete
/**
[68] Fix | Delete
* Generate Dummy comment for Comments Module preview in Theme Builder.
[69] Fix | Delete
*
[70] Fix | Delete
* @return WP_Comment[]
[71] Fix | Delete
*/
[72] Fix | Delete
function et_builder_add_fake_comments() {
[73] Fix | Delete
return array( new WP_Comment( (object) array(
[74] Fix | Delete
'comment_author' => 'Jane Doe',
[75] Fix | Delete
'comment_date' => '2019-01-01 12:00:00',
[76] Fix | Delete
'comment_content' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pulvinar nulla eu purus pharetra mollis. Nullam fringilla, ligula sit amet placerat rhoncus, arcu dui hendrerit ligula, ac rutrum mi neque quis orci. Morbi at tortor non eros feugiat commodo.',
[77] Fix | Delete
'comment_approved' => '1',
[78] Fix | Delete
) ) );
[79] Fix | Delete
}
[80] Fix | Delete
[81] Fix | Delete
/**
[82] Fix | Delete
* Append all default comment fields such as Author, Email, Website to Comment field for Comments Module preview in Theme Builder.
[83] Fix | Delete
* @see comment_form() in /wp-includes/comment-template.php
[84] Fix | Delete
*
[85] Fix | Delete
* @return string
[86] Fix | Delete
*/
[87] Fix | Delete
function et_builder_set_comment_fields( $field ) {
[88] Fix | Delete
$req = get_option( 'require_name_email' );
[89] Fix | Delete
$commenter = wp_get_current_commenter();
[90] Fix | Delete
$html_req = $req ? " required='required'" : '';
[91] Fix | Delete
[92] Fix | Delete
$author = sprintf(
[93] Fix | Delete
'<p class="comment-form-author"><label for="author">%1$s%2$s</label><input id="author" name="author" type="text" value="%3$s" size="30" maxlength="245"%4$s /></p>',
[94] Fix | Delete
esc_html__( 'Name', 'et_builder' ),
[95] Fix | Delete
$req ? ' <span class="required">*</span>' : '',
[96] Fix | Delete
esc_attr( $commenter['comment_author'] ),
[97] Fix | Delete
et_core_intentionally_unescaped( $html_req, 'fixed_string' )
[98] Fix | Delete
);
[99] Fix | Delete
[100] Fix | Delete
$email = sprintf(
[101] Fix | Delete
'<p class="comment-form-email"><label for="email">%1$s%2$s</label><input id="email" name="email" type="email" value="%3$s" size="30" maxlength="100" aria-describedby="email-notes"%4$s /></p>',
[102] Fix | Delete
esc_html__( 'Email', 'et_builder' ),
[103] Fix | Delete
$req ? ' <span class="required">*</span>' : '',
[104] Fix | Delete
esc_attr( $commenter['comment_author_email'] ),
[105] Fix | Delete
et_core_intentionally_unescaped( $html_req, 'fixed_string' )
[106] Fix | Delete
);
[107] Fix | Delete
[108] Fix | Delete
$url = sprintf(
[109] Fix | Delete
'<p class="comment-form-url"><label for="url">%1$s</label><input id="url" name="url" type="url" value="%2$s" size="30" maxlength="200" /></p>',
[110] Fix | Delete
esc_html__( 'Website', 'et_builder' ),
[111] Fix | Delete
esc_attr( $commenter['comment_author_url'] )
[112] Fix | Delete
);
[113] Fix | Delete
[114] Fix | Delete
return $field . $author . $email . $url;
[115] Fix | Delete
}
[116] Fix | Delete
[117] Fix | Delete
// comments template cannot be generated via AJAX so prepare it beforehand
[118] Fix | Delete
function et_fb_get_comments_markup() {
[119] Fix | Delete
global $post;
[120] Fix | Delete
[121] Fix | Delete
$post_type = isset( $post->post_type ) ? $post->post_type : false;
[122] Fix | Delete
[123] Fix | Delete
// Modify the Comments content for the Comment Module preview in TB.
[124] Fix | Delete
if ( et_theme_builder_is_layout_post_type( $post_type ) ) {
[125] Fix | Delete
add_filter( 'comments_open', '__return_true' );
[126] Fix | Delete
add_filter( 'comment_form_field_comment', 'et_builder_set_comment_fields' );
[127] Fix | Delete
add_filter( 'get_comments_number', 'et_builder_set_comments_number' );
[128] Fix | Delete
add_filter( 'comments_array', 'et_builder_add_fake_comments' );
[129] Fix | Delete
}
[130] Fix | Delete
[131] Fix | Delete
// Modify the comments request to make sure it's unique.
[132] Fix | Delete
// Otherwise WP generates SQL error and doesn't allow multiple comments sections on single page
[133] Fix | Delete
add_action( 'pre_get_comments', 'et_fb_modify_comments_request', 1 );
[134] Fix | Delete
[135] Fix | Delete
// include custom comments_template to display the comment section with Divi style
[136] Fix | Delete
add_filter( 'comments_template', 'et_fb_comments_template' );
[137] Fix | Delete
[138] Fix | Delete
// Modify submit button to be advanced button style ready
[139] Fix | Delete
add_filter( 'comment_form_submit_button', 'et_fb_comments_submit_button' );
[140] Fix | Delete
[141] Fix | Delete
// Custom action before calling comments_template.
[142] Fix | Delete
do_action( 'et_fb_before_comments_template' );
[143] Fix | Delete
[144] Fix | Delete
ob_start();
[145] Fix | Delete
comments_template( '', true );
[146] Fix | Delete
$comments_content = ob_get_contents();
[147] Fix | Delete
ob_end_clean();
[148] Fix | Delete
[149] Fix | Delete
// Custom action after calling comments_template.
[150] Fix | Delete
do_action( 'et_fb_after_comments_template' );
[151] Fix | Delete
[152] Fix | Delete
// remove all the actions and filters to not break the default comments section from theme
[153] Fix | Delete
remove_filter( 'comments_template', 'et_fb_comments_template' );
[154] Fix | Delete
remove_action( 'pre_get_comments', 'et_fb_modify_comments_request', 1 );
[155] Fix | Delete
[156] Fix | Delete
return $comments_content;
[157] Fix | Delete
}
[158] Fix | Delete
[159] Fix | Delete
// List of shortcode wrappers that requires adjustment in VB. Plugins which uses fullscreen dimension
[160] Fix | Delete
// tend to apply negative positioning which looks inappropriate on VB's shortcode mechanism
[161] Fix | Delete
function et_fb_known_shortcode_wrappers() {
[162] Fix | Delete
return apply_filters( 'et_fb_known_shortcode_wrappers', array(
[163] Fix | Delete
'removeLeft' => array(
[164] Fix | Delete
'.fullscreen-container', // revolution slider,
[165] Fix | Delete
'.esg-container-fullscreen-forcer', // essential grid
[166] Fix | Delete
'.ls-wp-fullwidth-helper', // layer slider
[167] Fix | Delete
),
[168] Fix | Delete
) );
[169] Fix | Delete
}
[170] Fix | Delete
[171] Fix | Delete
function et_builder_autosave_interval() {
[172] Fix | Delete
return apply_filters( 'et_builder_autosave_interval', et_builder_heartbeat_interval() / 2 );
[173] Fix | Delete
}
[174] Fix | Delete
[175] Fix | Delete
function et_fb_heartbeat_settings($settings) {
[176] Fix | Delete
$settings['suspension'] = 'disable';
[177] Fix | Delete
$settings['interval'] = et_builder_heartbeat_interval();
[178] Fix | Delete
return $settings;
[179] Fix | Delete
}
[180] Fix | Delete
add_filter( 'heartbeat_settings', 'et_fb_heartbeat_settings', 11 );
[181] Fix | Delete
[182] Fix | Delete
// This function is used to add dynamic helpers whose content changes frequently
[183] Fix | Delete
// because depending on the current post or options that can be edited by the user.
[184] Fix | Delete
function et_fb_get_dynamic_backend_helpers() {
[185] Fix | Delete
global $post;
[186] Fix | Delete
[187] Fix | Delete
$layout_type = '';
[188] Fix | Delete
$layout_scope = '';
[189] Fix | Delete
$layout_built_for = '';
[190] Fix | Delete
[191] Fix | Delete
// Override $post data if current visual builder is rendering layout block; This is needed
[192] Fix | Delete
// because block editor might be used in CPT that has no frontend such as reusable block's
[193] Fix | Delete
// `wp_block` CPT so layout block preview needs to be rendered using latest / other post
[194] Fix | Delete
// frontend. To correctly render and update the layout, adjust post ID and other data accordingly
[195] Fix | Delete
$is_layout_block_preview = ET_GB_Block_Layout::is_layout_block_preview();
[196] Fix | Delete
[197] Fix | Delete
if ( $is_layout_block_preview && isset( $_GET['et_post_id' ] ) ) {
[198] Fix | Delete
$et_post_id = (int) $_GET['et_post_id'];
[199] Fix | Delete
[200] Fix | Delete
$post = get_post( $et_post_id );
[201] Fix | Delete
}
[202] Fix | Delete
[203] Fix | Delete
$post_type = isset( $post->post_type ) ? $post->post_type : false;
[204] Fix | Delete
$post_id = isset( $post->ID ) ? $post->ID : false;
[205] Fix | Delete
$post_status = isset( $post->post_status ) ? $post->post_status : false;
[206] Fix | Delete
$post_title = isset( $post->post_title ) ? esc_attr( $post->post_title ) : false;
[207] Fix | Delete
$post_thumbnail_alt = has_post_thumbnail() ? get_post_meta( get_post_thumbnail_id(), '_wp_attachment_image_alt', true ) : false;
[208] Fix | Delete
$post_thumbnail_title = has_post_thumbnail() ? get_post( get_post_thumbnail_id() )->post_title : false;
[209] Fix | Delete
$current_user = wp_get_current_user();
[210] Fix | Delete
[211] Fix | Delete
if ( 'et_pb_layout' === $post_type ) {
[212] Fix | Delete
$layout_type = et_fb_get_layout_type( $post_id );
[213] Fix | Delete
$layout_scope = et_fb_get_layout_term_slug( $post_id, 'scope' );
[214] Fix | Delete
$layout_built_for = get_post_meta( $post_id, '_et_pb_built_for_post_type', 'page' );
[215] Fix | Delete
}
[216] Fix | Delete
[217] Fix | Delete
$current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
[218] Fix | Delete
[219] Fix | Delete
// disable product tour on the app launch, so it won't be started next time.
[220] Fix | Delete
if ( et_builder_is_product_tour_enabled() ) {
[221] Fix | Delete
et_fb_disable_product_tour();
[222] Fix | Delete
}
[223] Fix | Delete
[224] Fix | Delete
$theme_builder_layouts = et_theme_builder_get_template_layouts();
[225] Fix | Delete
[226] Fix | Delete
// In some cases when page created using Polylang
[227] Fix | Delete
// it may have predefined content, so inital content is not empty.
[228] Fix | Delete
$has_predefined_content = isset( $_GET['from_post'] ) && 'empty' !== $_GET['from_post'] ? 'yes' : 'no';
[229] Fix | Delete
[230] Fix | Delete
// Validate the Theme Builder body layout and its post content module, if any.
[231] Fix | Delete
$has_tb_layouts = ! empty( $theme_builder_layouts );
[232] Fix | Delete
$is_tb_layout = et_theme_builder_is_layout_post_type( $post_type );
[233] Fix | Delete
$tb_body_layout = et_()->array_get( $theme_builder_layouts, ET_THEME_BUILDER_BODY_LAYOUT_POST_TYPE, array() );
[234] Fix | Delete
$tb_body_has_post_content = $tb_body_layout && et_theme_builder_layout_has_post_content( $tb_body_layout );
[235] Fix | Delete
$has_valid_body_layout = ! $has_tb_layouts || $is_tb_layout || $tb_body_has_post_content;
[236] Fix | Delete
[237] Fix | Delete
// Prepare a Post Content module failure notification if there are any
[238] Fix | Delete
// Theme Builder layouts active for the current request.
[239] Fix | Delete
$post_content_failure_notification = '';
[240] Fix | Delete
if ( ! empty( $theme_builder_layouts ) ) {
[241] Fix | Delete
$post_content_failure_notification = et_theme_builder_get_failure_notification_modal(
[242] Fix | Delete
get_the_title( $theme_builder_layouts[ ET_THEME_BUILDER_TEMPLATE_POST_TYPE ] ),
[243] Fix | Delete
$theme_builder_layouts[ ET_THEME_BUILDER_BODY_LAYOUT_POST_TYPE ]['enabled']
[244] Fix | Delete
);
[245] Fix | Delete
}
[246] Fix | Delete
[247] Fix | Delete
$helpers = array(
[248] Fix | Delete
'site_url' => get_site_url(),
[249] Fix | Delete
'locale' => get_user_locale(),
[250] Fix | Delete
'debug' => defined( 'ET_DEBUG' ) && ET_DEBUG,
[251] Fix | Delete
'postId' => $post_id,
[252] Fix | Delete
'postTitle' => $post_title,
[253] Fix | Delete
'postStatus' => $post_status,
[254] Fix | Delete
'postType' => $post_type,
[255] Fix | Delete
'postMeta' => $post,
[256] Fix | Delete
'postThumbnailAlt' => $post_thumbnail_alt,
[257] Fix | Delete
'postThumbnailTitle' => $post_thumbnail_title,
[258] Fix | Delete
'isCustomPostType' => et_builder_is_post_type_custom( $post_type ) ? 'yes' : 'no',
[259] Fix | Delete
'layoutType' => $layout_type,
[260] Fix | Delete
'layoutScope' => $layout_scope,
[261] Fix | Delete
'layoutBuiltFor' => $layout_built_for,
[262] Fix | Delete
'hasPredefinedContent' => $has_predefined_content,
[263] Fix | Delete
'publishCapability' => ( is_page() && ! current_user_can( 'publish_pages' ) ) || ( ! is_page() && ! current_user_can( 'publish_posts' ) ) ? 'no_publish' : 'publish',
[264] Fix | Delete
'ajaxUrl' => is_ssl() ? admin_url( 'admin-ajax.php' ) : admin_url( 'admin-ajax.php', 'http' ),
[265] Fix | Delete
'et_account' => et_core_get_et_account(),
[266] Fix | Delete
'productTourStatus' => et_builder_is_product_tour_enabled() ? 'on' : 'off',
[267] Fix | Delete
'gutterWidth' => (string) et_get_option( 'gutter_width', '3' ),
[268] Fix | Delete
'sectionPadding' => et_get_option( 'section_padding', 4 ),
[269] Fix | Delete
'cookie_path' => SITECOOKIEPATH,
[270] Fix | Delete
'etBuilderAccentColor' => et_builder_accent_color(),
[271] Fix | Delete
'gmt_offset_string' => et_pb_get_gmt_offset_string(),
[272] Fix | Delete
'currentUserDisplayName' => $current_user->display_name,
[273] Fix | Delete
'currentRole' => et_pb_get_current_user_role(),
[274] Fix | Delete
'currentUserCapabilities' => array(
[275] Fix | Delete
'manageOptions' => current_user_can( 'manage_options' ),
[276] Fix | Delete
),
[277] Fix | Delete
'exportUrl' => et_fb_get_portability_export_url(),
[278] Fix | Delete
'nonces' => et_fb_get_nonces(),
[279] Fix | Delete
'currentPage' => et_fb_current_page_params(),
[280] Fix | Delete
'appPreferences' => et_fb_app_preferences(),
[281] Fix | Delete
'pageSettingsFields' => ET_Builder_Settings::get_fields(),
[282] Fix | Delete
'pageSettingsValues' => ET_Builder_Settings::get_values(),
[283] Fix | Delete
'abTestingSubjects' => false !== ( $all_subjects_raw = get_post_meta( $post_id, '_et_pb_ab_subjects', true ) ) ? explode( ',', $all_subjects_raw ) : array(),
[284] Fix | Delete
'productTourText' => et_fb_get_product_tour_text( $post_id ),
[285] Fix | Delete
'show_page_creation' => $is_layout_block_preview ? '' : get_post_meta( $post_id, '_et_pb_show_page_creation', true ),
[286] Fix | Delete
'mediaButtons' => et_builder_get_media_buttons(),
[287] Fix | Delete
'shortcode_tags' => et_fb_shortcode_tags(),
[288] Fix | Delete
'customizer' => array(
[289] Fix | Delete
'tablet' => array(
[290] Fix | Delete
'sectionHeight' => et_get_option( 'tablet_section_height' ),
[291] Fix | Delete
),
[292] Fix | Delete
'phone' => array(
[293] Fix | Delete
'sectionHeight' => et_get_option( 'phone_section_height' ),
[294] Fix | Delete
),
[295] Fix | Delete
),
[296] Fix | Delete
'abTesting' => et_builder_ab_options( $post->ID ),
[297] Fix | Delete
'conditionalTags' => et_fb_conditional_tag_params(),
[298] Fix | Delete
'commentsModuleMarkup' => et_fb_get_comments_markup(),
[299] Fix | Delete
'failureNotification' => et_builder_get_failure_notification_modal(),
[300] Fix | Delete
'noBrowserSupportNotification' => et_builder_get_no_browser_notification_modal(),
[301] Fix | Delete
/**
[302] Fix | Delete
* Filters taxonomies array.
[303] Fix | Delete
*
[304] Fix | Delete
* @param array Array of all registered taxonomies.
[305] Fix | Delete
*/
[306] Fix | Delete
'getTaxonomies' => apply_filters( 'et_fb_taxonomies', et_fb_get_taxonomy_terms() ),
[307] Fix | Delete
[308] Fix | Delete
/**
[309] Fix | Delete
* Filters taxonomy labels.
[310] Fix | Delete
*
[311] Fix | Delete
* @param array Array of labels for all registered taxonomies.
[312] Fix | Delete
*/
[313] Fix | Delete
'getTaxonomyLabels' => apply_filters( 'et_fb_taxonomy_labels', et_fb_get_taxonomy_labels() ),
[314] Fix | Delete
'urls' => array(
[315] Fix | Delete
'loginFormUrl' => esc_url( site_url( 'wp-login.php', 'login_post' ) ),
[316] Fix | Delete
'forgotPasswordUrl' => esc_url( wp_lostpassword_url() ),
[317] Fix | Delete
'logoutUrl' => esc_url( wp_logout_url() ),
[318] Fix | Delete
'logoutUrlRedirect' => esc_url( wp_logout_url( $current_url ) ),
[319] Fix | Delete
'themeOptionsUrl' => esc_url( et_pb_get_options_page_link() ),
[320] Fix | Delete
'builderPreviewStyle' => ET_BUILDER_URI . '/styles/preview.css',
[321] Fix | Delete
'themeCustomizerUrl' => et_pb_is_allowed( 'theme_customizer' ) ? add_query_arg( array(
[322] Fix | Delete
'et_customizer_option_set' => 'theme',
[323] Fix | Delete
'url' => urlencode( $current_url )
[324] Fix | Delete
), admin_url( 'customize.php' ) ) : false,
[325] Fix | Delete
'roleEditorUrl' => current_user_can( 'manage_options' ) ? add_query_arg( array( 'page' => 'et_divi_role_editor' ), admin_url( 'admin.php' ) ) : false,
[326] Fix | Delete
'manageLibraryUrl' => current_user_can( 'manage_options' ) ? add_query_arg( array( 'post_type' => 'et_pb_layout' ), admin_url( 'edit.php' ) ) : false,
[327] Fix | Delete
'ajaxUrl' => is_ssl() ? admin_url( 'admin-ajax.php' ) : admin_url( 'admin-ajax.php', 'http' ),
[328] Fix | Delete
),
[329] Fix | Delete
'defaults' => array(
[330] Fix | Delete
'et_pb_countdown_timer' => array(
[331] Fix | Delete
'date_time' => gmdate( 'Y-m-d H:i', current_time( 'timestamp' ) + ( 30 * 86400 ) ), // next 30 days from current day
[332] Fix | Delete
),
[333] Fix | Delete
),
[334] Fix | Delete
'themeBuilder' => array(
[335] Fix | Delete
'isLayout' => et_theme_builder_is_layout_post_type( $post_type ),
[336] Fix | Delete
'layoutPostTypes' => et_theme_builder_get_layout_post_types(),
[337] Fix | Delete
'bodyLayoutPostType' => ET_THEME_BUILDER_BODY_LAYOUT_POST_TYPE,
[338] Fix | Delete
'postContentModules' => et_theme_builder_get_post_content_modules(),
[339] Fix | Delete
'hasValidBodyLayout' => $has_valid_body_layout,
[340] Fix | Delete
'noPostContentFailureNotification' => $post_content_failure_notification,
[341] Fix | Delete
),
[342] Fix | Delete
'i18n' => array(
[343] Fix | Delete
'modules' => array(
[344] Fix | Delete
'login' => array(
[345] Fix | Delete
'loginAs' => sprintf( esc_html__( 'Login as %s', 'et_builder' ), $current_user->display_name ),
[346] Fix | Delete
),
[347] Fix | Delete
'postContent' => array(
[348] Fix | Delete
'placeholder' =>
[349] Fix | Delete
'<div class="et_pb_section"><div class="et_pb_row"><div class="et_pb_column et_pb_column_4_4">
[350] Fix | Delete
<h1>Post Content Heading 1</h1>
[351] Fix | Delete
<p>Post Content Paragraph Text. Lorem ipsum dolor sit amet, <a href="#">consectetur adipiscing elit</a>. Ut vitae congue libero, nec finibus purus. Vestibulum egestas orci vel ornare venenatis. Sed et ultricies turpis. Donec sit amet rhoncus erat. Phasellus volutpat vitae mi eu aliquam.</p>
[352] Fix | Delete
<h2>Post Content Heading 2</h2>
[353] Fix | Delete
<p>Curabitur a commodo sapien, at pellentesque velit. Vestibulum ornare vulputate. Mauris tempus massa orci, vitae lacinia tortor maximus sit amet. In hac habitasse platea dictumst. Praesent id tincidunt dolor. Morbi gravida sapien convallis sapien tempus consequat. </p>
[354] Fix | Delete
<h3>Post Content Heading 3</h3>
[355] Fix | Delete
<blockquote>
[356] Fix | Delete
<p>Post Content Block Quote. Vehicula velit ut felis semper, non convallis dolor fermentum. Sed sapien nisl, tempus ut semper sed, congue quis leo. Integer nec suscipit lacus. Duis luctus eros dui, nec finibus lectus tempor nec. Pellentesque at tincidunt turpis.</p>
[357] Fix | Delete
</blockquote>
[358] Fix | Delete
<img src="' . ET_BUILDER_PLACEHOLDER_LANDSCAPE_IMAGE_DATA . '" alt="" />
[359] Fix | Delete
<h4>Post Content Heading 4</h4>
[360] Fix | Delete
<ul>
[361] Fix | Delete
<li>Vestibulum posuere</li>
[362] Fix | Delete
<li>Mi interdum nunc dignissim auctor</li>
[363] Fix | Delete
<li>Cras non dignissim quam, at volutpat massa</li>
[364] Fix | Delete
</ul>
[365] Fix | Delete
<h5>Post Content Heading 5</h5>
[366] Fix | Delete
<ol>
[367] Fix | Delete
<li>Ut mattis orci in scelerisque tempus</li>
[368] Fix | Delete
<li>Velit urna sagittis arcu</li>
[369] Fix | Delete
<li>Mon ultrices risus lectus non nisl</li>
[370] Fix | Delete
</ol>
[371] Fix | Delete
<h6>Post Content Heading 6</h6>
[372] Fix | Delete
<p>posuere nec lectus sit amet, pulvinar dapibus sapien. Donec placerat erat ac fermentum accumsan. Nunc in scelerisque dui. Etiam vitae purus velit. Proin dictum auctor mi, eu congue odio tempus et. Curabitur ac semper ligula. Praesent purus ligula, ultricies vel porta ac, elementum et lacus. Nullam vitae augue aliquet, condimentum est ut, vehicula sapien. Donec euismod, sem et elementum finibus, lacus mauris pulvinar enim, nec faucibus sapien neque quis sem. Vivamus suscipit tortor eget felis porttitor volutpat. Lorem ipsum dolor sit amet, consectetur adipiscing elit. </p>
[373] Fix | Delete
</div></div></div>',
[374] Fix | Delete
),
[375] Fix | Delete
),
[376] Fix | Delete
'modals' => array(
[377] Fix | Delete
'pageSettings' => array(
[378] Fix | Delete
'title' => ET_Builder_Settings::get_title(),
[379] Fix | Delete
'toggles' => ET_Builder_Settings::get_toggles(),
[380] Fix | Delete
),
[381] Fix | Delete
),
[382] Fix | Delete
),
[383] Fix | Delete
'globalPresets' => ET_Builder_Element::get_global_presets(),
[384] Fix | Delete
'module_cache_filename_id' => ET_Builder_Element::get_cache_filename_id( $post_type ),
[385] Fix | Delete
'registeredPostTypeOptions' => et_get_registered_post_type_options(),
[386] Fix | Delete
);
[387] Fix | Delete
[388] Fix | Delete
$helpers['css'] = array(
[389] Fix | Delete
'wrapperPrefix' => ET_BUILDER_CSS_WRAPPER_PREFIX,
[390] Fix | Delete
'containerPrefix' => ET_BUILDER_CSS_CONTAINER_PREFIX,
[391] Fix | Delete
'layoutPrefix' => ET_BUILDER_CSS_LAYOUT_PREFIX,
[392] Fix | Delete
'prefix' => ET_BUILDER_CSS_PREFIX,
[393] Fix | Delete
);
[394] Fix | Delete
[395] Fix | Delete
$custom_defaults_unmigrated = et_get_option( ET_Builder_Global_Presets_Settings::CUSTOM_DEFAULTS_UNMIGRATED_OPTION, false );
[396] Fix | Delete
[397] Fix | Delete
if ( $custom_defaults_unmigrated ) {
[398] Fix | Delete
$helpers['customDefaultsUnmigrated'] = ET_Builder_Global_Presets_Settings::migrate_custom_defaults_to_global_presets( $custom_defaults_unmigrated );
[399] Fix | Delete
}
[400] Fix | Delete
[401] Fix | Delete
$helpers['dynamicContentFields'] = et_builder_get_dynamic_content_fields( $post_id, 'edit' );
[402] Fix | Delete
[403] Fix | Delete
return $helpers;
[404] Fix | Delete
}
[405] Fix | Delete
[406] Fix | Delete
// This function is used to add static helpers whose content changes rarely
[407] Fix | Delete
// eg: google fonts, module defaults and so on.
[408] Fix | Delete
function et_fb_get_static_backend_helpers($post_type) {
[409] Fix | Delete
$custom_user_fonts = et_builder_get_custom_fonts();
[410] Fix | Delete
$use_google_fonts = et_core_use_google_fonts();
[411] Fix | Delete
$websafe_fonts = et_builder_get_websafe_fonts();
[412] Fix | Delete
$google_fonts = $websafe_fonts;
[413] Fix | Delete
[414] Fix | Delete
if ( $use_google_fonts ) {
[415] Fix | Delete
$google_fonts = array_merge( $websafe_fonts, et_builder_get_google_fonts() ) ;
[416] Fix | Delete
ksort( $google_fonts );
[417] Fix | Delete
}
[418] Fix | Delete
[419] Fix | Delete
$google_fonts = array_merge( array( 'Default' => array() ), $google_fonts );
[420] Fix | Delete
[421] Fix | Delete
/**
[422] Fix | Delete
* Filters modules list.
[423] Fix | Delete
*
[424] Fix | Delete
* @param array $modules_array.
[425] Fix | Delete
*/
[426] Fix | Delete
$fb_modules_array = apply_filters( 'et_fb_modules_array', ET_Builder_Element::get_modules_array( $post_type, true ) );
[427] Fix | Delete
[428] Fix | Delete
/**
[429] Fix | Delete
* Filters modules list which affect "Add New Row" button position.
[430] Fix | Delete
*
[431] Fix | Delete
* @param array $modules_list.
[432] Fix | Delete
*/
[433] Fix | Delete
$modules_row_overlapping_add_new = apply_filters( 'et_fb_modules_row_overlapping_add_new', array(
[434] Fix | Delete
'et_pb_counters',
[435] Fix | Delete
'et_pb_post_nav',
[436] Fix | Delete
'et_pb_search',
[437] Fix | Delete
'et_pb_social_media_follow',
[438] Fix | Delete
) );
[439] Fix | Delete
[440] Fix | Delete
$modules_defaults = array(
[441] Fix | Delete
'title' => _x( 'Your Title Goes Here', 'Modules dummy content', 'et_builder' ),
[442] Fix | Delete
'subtitle' => _x( 'Subtitle goes Here', 'et_builder' ),
[443] Fix | Delete
'body' => _x( '<p>Your content goes here. Edit or remove this text inline or in the module Content settings. You can also style every aspect of this content in the module Design settings and even apply custom CSS to this text in the module Advanced settings.</p>',
[444] Fix | Delete
'et_builder' ),
[445] Fix | Delete
'number' => 50,
[446] Fix | Delete
'button' => _x( 'Click Here', 'Modules dummy content', 'et_builder' ),
[447] Fix | Delete
'image' => array(
[448] Fix | Delete
'landscape' => ET_BUILDER_PLACEHOLDER_LANDSCAPE_IMAGE_DATA,
[449] Fix | Delete
'portrait' => ET_BUILDER_PLACEHOLDER_PORTRAIT_IMAGE_DATA,
[450] Fix | Delete
),
[451] Fix | Delete
'video' => 'https://www.youtube.com/watch?v=FkQuawiGWUw',
[452] Fix | Delete
);
[453] Fix | Delete
[454] Fix | Delete
$woocommerce_modules_defaults = array(
[455] Fix | Delete
'price' => '',
[456] Fix | Delete
);
[457] Fix | Delete
[458] Fix | Delete
/**
[459] Fix | Delete
* App preferences
[460] Fix | Delete
*/
[461] Fix | Delete
$app_preferences = et_fb_app_preferences_settings();
[462] Fix | Delete
[463] Fix | Delete
/**
[464] Fix | Delete
* ETBuilderBackend
[465] Fix | Delete
* @var array $helpers
[466] Fix | Delete
*/
[467] Fix | Delete
$helpers = array(
[468] Fix | Delete
'blog_id' => get_current_blog_id(),
[469] Fix | Delete
'diviLibraryUrl' => ET_BUILDER_DIVI_LIBRARY_URL,
[470] Fix | Delete
'autosaveInterval' => et_builder_autosave_interval(),
[471] Fix | Delete
'shortcodeObject' => array(),
[472] Fix | Delete
'autosaveShortcodeObject' => array(),
[473] Fix | Delete
'tinymcePlugins' => apply_filters( 'et_fb_tinymce_plugins', array(
[474] Fix | Delete
'autolink',
[475] Fix | Delete
'link',
[476] Fix | Delete
'image',
[477] Fix | Delete
'lists',
[478] Fix | Delete
'print',
[479] Fix | Delete
'preview',
[480] Fix | Delete
'autoresize',
[481] Fix | Delete
'textcolor',
[482] Fix | Delete
'table',
[483] Fix | Delete
'paste',
[484] Fix | Delete
'fullscreen',
[485] Fix | Delete
'charmap',
[486] Fix | Delete
'emoticons',
[487] Fix | Delete
'wpview',
[488] Fix | Delete
) ),
[489] Fix | Delete
'tinymceSkinUrl' => ET_FB_ASSETS_URI . '/vendors/tinymce-skin',
[490] Fix | Delete
'tinymceCSSFiles' => esc_url( includes_url( 'js/tinymce' ) . '/skins/wordpress/wp-content.css' ),
[491] Fix | Delete
'images_uri' => ET_BUILDER_URI .'/images',
[492] Fix | Delete
'optionTemplate' => array(
[493] Fix | Delete
'fieldNamePrefix' => et_pb_option_template()->template_prefix,
[494] Fix | Delete
'templates' => et_pb_option_template()->templates(),
[495] Fix | Delete
'data' => et_pb_option_template()->all(),
[496] Fix | Delete
),
[497] Fix | Delete
'componentDefinitions' => array(
[498] Fix | Delete
'generalFields' => array(),
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function