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
File: functions.php
'light' => esc_html__( 'Light', 'Divi' ),
[500] Fix | Delete
'dark' => esc_html__( 'Dark', 'Divi' ),
[501] Fix | Delete
);
[502] Fix | Delete
$post_bg_color = ( $bg_color = get_post_meta( $post_id, '_et_post_bg_color', true ) ) && '' !== $bg_color
[503] Fix | Delete
? $bg_color
[504] Fix | Delete
: '#ffffff';
[505] Fix | Delete
$post_use_bg_color = get_post_meta( $post_id, '_et_post_use_bg_color', true )
[506] Fix | Delete
? true
[507] Fix | Delete
: false;
[508] Fix | Delete
$post_bg_layout = ( $layout = get_post_meta( $post_id, '_et_post_bg_layout', true ) ) && '' !== $layout
[509] Fix | Delete
? $layout
[510] Fix | Delete
: 'light';
[511] Fix | Delete
[512] Fix | Delete
$tb_layouts = et_theme_builder_get_template_layouts( ET_Theme_Builder_Request::from_post( $post_id ) );
[513] Fix | Delete
$container = array( 'et_pb_page_settings_container' );
[514] Fix | Delete
[515] Fix | Delete
if ( ! empty( $tb_layouts ) ) {
[516] Fix | Delete
$container[] = 'et_pb_page_settings_container--theme-builder';
[517] Fix | Delete
[518] Fix | Delete
if ( ! empty( $tb_layouts ) && $tb_layouts[ ET_THEME_BUILDER_HEADER_LAYOUT_POST_TYPE ]['override'] ) {
[519] Fix | Delete
$container[] = 'et_pb_page_settings_container--tb-has-header';
[520] Fix | Delete
}
[521] Fix | Delete
[522] Fix | Delete
if ( ! empty( $tb_layouts ) && $tb_layouts[ ET_THEME_BUILDER_BODY_LAYOUT_POST_TYPE ]['override'] ) {
[523] Fix | Delete
$container[] = 'et_pb_page_settings_container--tb-has-body';
[524] Fix | Delete
}
[525] Fix | Delete
[526] Fix | Delete
if ( ! empty( $tb_layouts ) && $tb_layouts[ ET_THEME_BUILDER_FOOTER_LAYOUT_POST_TYPE ]['override'] ) {
[527] Fix | Delete
$container[] = 'et_pb_page_settings_container--tb-has-footer';
[528] Fix | Delete
}
[529] Fix | Delete
}
[530] Fix | Delete
?>
[531] Fix | Delete
[532] Fix | Delete
<div class="<?php echo esc_attr( implode( ' ', $container ) ); ?>">
[533] Fix | Delete
<p class="et_pb_page_settings et_pb_page_layout_settings">
[534] Fix | Delete
<label for="et_pb_page_layout" style="display: block; font-weight: bold; margin-bottom: 5px;"><?php esc_html_e( 'Page Layout', 'Divi' ); ?>: </label>
[535] Fix | Delete
[536] Fix | Delete
<select id="et_pb_page_layout" name="et_pb_page_layout">
[537] Fix | Delete
<?php
[538] Fix | Delete
foreach ( $page_layouts as $layout_value => $layout_name ) {
[539] Fix | Delete
printf( '<option value="%2$s"%3$s%4$s>%1$s</option>',
[540] Fix | Delete
esc_html( $layout_name ),
[541] Fix | Delete
esc_attr( $layout_value ),
[542] Fix | Delete
selected( $layout_value, $page_layout, false ),
[543] Fix | Delete
'et_full_width_page' === $layout_value && ! $is_builder_active ? ' style="display: none;"' : ''
[544] Fix | Delete
);
[545] Fix | Delete
} ?>
[546] Fix | Delete
</select>
[547] Fix | Delete
</p>
[548] Fix | Delete
<p class="et_pb_page_settings et_pb_side_nav_settings" style="display: none;">
[549] Fix | Delete
<label for="et_pb_side_nav" style="display: block; font-weight: bold; margin-bottom: 5px;"><?php esc_html_e( 'Dot Navigation', 'Divi' ); ?>: </label>
[550] Fix | Delete
[551] Fix | Delete
<select id="et_pb_side_nav" name="et_pb_side_nav">
[552] Fix | Delete
<option value="off" <?php selected( 'off', $side_nav ); ?>><?php esc_html_e( 'Off', 'Divi' ); ?></option>
[553] Fix | Delete
<option value="on" <?php selected( 'on', $side_nav ); ?>><?php esc_html_e( 'On', 'Divi' ); ?></option>
[554] Fix | Delete
</select>
[555] Fix | Delete
</p>
[556] Fix | Delete
<p class="et_pb_page_settings et_pb_nav_settings">
[557] Fix | Delete
<label for="et_pb_post_hide_nav" style="display: block; font-weight: bold; margin-bottom: 5px;"><?php esc_html_e( 'Hide Nav Before Scroll', 'Divi' ); ?>: </label>
[558] Fix | Delete
[559] Fix | Delete
<select id="et_pb_post_hide_nav" name="et_pb_post_hide_nav">
[560] Fix | Delete
<option value="default" <?php selected( 'default', $post_hide_nav ); ?>><?php esc_html_e( 'Default', 'Divi' ); ?></option>
[561] Fix | Delete
<option value="no" <?php selected( 'no', $post_hide_nav ); ?>><?php esc_html_e( 'Off', 'Divi' ); ?></option>
[562] Fix | Delete
<option value="on" <?php selected( 'on', $post_hide_nav ); ?>><?php esc_html_e( 'On', 'Divi' ); ?></option>
[563] Fix | Delete
</select>
[564] Fix | Delete
</p>
[565] Fix | Delete
[566] Fix | Delete
<?php if ( 'post' === $post->post_type ) : ?>
[567] Fix | Delete
<p class="et_pb_page_settings et_pb_single_title" style="display: none;">
[568] Fix | Delete
<label for="et_single_title" style="display: block; font-weight: bold; margin-bottom: 5px;"><?php esc_html_e( 'Post Title', 'Divi' ); ?>: </label>
[569] Fix | Delete
[570] Fix | Delete
<select id="et_single_title" name="et_single_title">
[571] Fix | Delete
<option value="on" <?php selected( 'on', $show_title ); ?>><?php esc_html_e( 'Show', 'Divi' ); ?></option>
[572] Fix | Delete
<option value="off" <?php selected( 'off', $show_title ); ?>><?php esc_html_e( 'Hide', 'Divi' ); ?></option>
[573] Fix | Delete
</select>
[574] Fix | Delete
</p>
[575] Fix | Delete
[576] Fix | Delete
<p class="et_divi_quote_settings et_divi_audio_settings et_divi_link_settings et_divi_format_setting et_pb_page_settings">
[577] Fix | Delete
<label for="et_post_use_bg_color" style="display: block; font-weight: bold; margin-bottom: 5px;"><?php esc_html_e( 'Use Background Color', 'Divi' ); ?></label>
[578] Fix | Delete
<input name="et_post_use_bg_color" type="checkbox" id="et_post_use_bg_color" <?php checked( $post_use_bg_color ); ?> />
[579] Fix | Delete
</p>
[580] Fix | Delete
[581] Fix | Delete
<p class="et_post_bg_color_setting et_divi_format_setting et_pb_page_settings">
[582] Fix | Delete
<input id="et_post_bg_color" name="et_post_bg_color" class="color-picker-hex" type="text" maxlength="7" placeholder="<?php esc_attr_e( 'Hex Value', 'Divi' ); ?>" value="<?php echo esc_attr( $post_bg_color ); ?>" data-default-color="#ffffff" />
[583] Fix | Delete
</p>
[584] Fix | Delete
[585] Fix | Delete
<p class="et_divi_quote_settings et_divi_audio_settings et_divi_link_settings et_divi_format_setting">
[586] Fix | Delete
<label for="et_post_bg_layout" style="font-weight: bold; margin-bottom: 5px;"><?php esc_html_e( 'Text Color', 'Divi' ); ?>: </label>
[587] Fix | Delete
<select id="et_post_bg_layout" name="et_post_bg_layout">
[588] Fix | Delete
<?php
[589] Fix | Delete
foreach ( $layouts as $layout_name => $layout_title )
[590] Fix | Delete
printf( '<option value="%s"%s>%s</option>',
[591] Fix | Delete
esc_attr( $layout_name ),
[592] Fix | Delete
selected( $layout_name, $post_bg_layout, false ),
[593] Fix | Delete
esc_html( $layout_title )
[594] Fix | Delete
);
[595] Fix | Delete
?>
[596] Fix | Delete
</select>
[597] Fix | Delete
</p>
[598] Fix | Delete
<?php endif;
[599] Fix | Delete
[600] Fix | Delete
if ( 'project' === $post->post_type ) : ?>
[601] Fix | Delete
<p class="et_pb_page_settings et_pb_project_nav" style="display: none;">
[602] Fix | Delete
<label for="et_project_nav" style="display: block; font-weight: bold; margin-bottom: 5px;"><?php esc_html_e( 'Project Navigation', 'Divi' ); ?>: </label>
[603] Fix | Delete
[604] Fix | Delete
<select id="et_project_nav" name="et_project_nav">
[605] Fix | Delete
<option value="off" <?php selected( 'off', $project_nav ); ?>><?php esc_html_e( 'Hide', 'Divi' ); ?></option>
[606] Fix | Delete
<option value="on" <?php selected( 'on', $project_nav ); ?>><?php esc_html_e( 'Show', 'Divi' ); ?></option>
[607] Fix | Delete
</select>
[608] Fix | Delete
</p>
[609] Fix | Delete
<?php endif; ?>
[610] Fix | Delete
[611] Fix | Delete
<?php if ( 'product' === $post->post_type && $is_builder_active ) : ?>
[612] Fix | Delete
<?php
[613] Fix | Delete
$product_page_layouts = et_builder_wc_get_page_layouts( 'Divi' );
[614] Fix | Delete
$product_page_layout = get_post_meta( $post_id, '_et_pb_product_page_layout', true );
[615] Fix | Delete
[616] Fix | Delete
// Get the default set at Builder level when `$product_page_layout` isn't set at single Product page.
[617] Fix | Delete
if ( empty( $product_page_layout ) ) {
[618] Fix | Delete
$product_page_layout = et_get_option( 'et_pb_woocommerce_page_layout' );
[619] Fix | Delete
}
[620] Fix | Delete
?>
[621] Fix | Delete
<p class="et_pb_product_page_settings et_pb_product_page_layout_settings">
[622] Fix | Delete
<label for="et_pb_product_page_layout"
[623] Fix | Delete
style="display: block; font-weight: bold; margin-bottom: 5px;"><?php esc_html_e( 'Product Content', 'Divi' ); ?>
[624] Fix | Delete
: </label>
[625] Fix | Delete
[626] Fix | Delete
<select id="et_pb_product_page_layout" name="et_pb_product_page_layout">
[627] Fix | Delete
<?php
[628] Fix | Delete
foreach ( $product_page_layouts as $layout_value => $layout_name ) {
[629] Fix | Delete
printf( '<option value="%2$s"%3$s>%1$s</option>',
[630] Fix | Delete
esc_html( $layout_name ),
[631] Fix | Delete
esc_attr( $layout_value ),
[632] Fix | Delete
selected( $layout_value, $product_page_layout, false )
[633] Fix | Delete
);
[634] Fix | Delete
}
[635] Fix | Delete
?>
[636] Fix | Delete
</select>
[637] Fix | Delete
</p>
[638] Fix | Delete
<?php endif; ?>
[639] Fix | Delete
</div>
[640] Fix | Delete
<?php
[641] Fix | Delete
}
[642] Fix | Delete
endif;
[643] Fix | Delete
[644] Fix | Delete
function et_divi_post_settings_save_details( $post_id, $post ) {
[645] Fix | Delete
global $pagenow;
[646] Fix | Delete
[647] Fix | Delete
if ( 'post.php' !== $pagenow || ! $post || ! is_object( $post ) ) {
[648] Fix | Delete
return;
[649] Fix | Delete
}
[650] Fix | Delete
[651] Fix | Delete
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
[652] Fix | Delete
return;
[653] Fix | Delete
}
[654] Fix | Delete
[655] Fix | Delete
$post_type = get_post_type_object( $post->post_type );
[656] Fix | Delete
if ( ! current_user_can( $post_type->cap->edit_post, $post_id ) ) {
[657] Fix | Delete
return;
[658] Fix | Delete
}
[659] Fix | Delete
[660] Fix | Delete
if ( ! isset( $_POST['et_settings_nonce'] ) || ! wp_verify_nonce( $_POST['et_settings_nonce'], basename( __FILE__ ) ) ) {
[661] Fix | Delete
return;
[662] Fix | Delete
}
[663] Fix | Delete
[664] Fix | Delete
if ( isset( $_POST['et_post_use_bg_color'] ) )
[665] Fix | Delete
update_post_meta( $post_id, '_et_post_use_bg_color', true );
[666] Fix | Delete
else
[667] Fix | Delete
delete_post_meta( $post_id, '_et_post_use_bg_color' );
[668] Fix | Delete
[669] Fix | Delete
if ( isset( $_POST['et_post_bg_color'] ) )
[670] Fix | Delete
update_post_meta( $post_id, '_et_post_bg_color', sanitize_text_field( $_POST['et_post_bg_color'] ) );
[671] Fix | Delete
else
[672] Fix | Delete
delete_post_meta( $post_id, '_et_post_bg_color' );
[673] Fix | Delete
[674] Fix | Delete
if ( isset( $_POST['et_post_bg_layout'] ) )
[675] Fix | Delete
update_post_meta( $post_id, '_et_post_bg_layout', sanitize_text_field( $_POST['et_post_bg_layout'] ) );
[676] Fix | Delete
else
[677] Fix | Delete
delete_post_meta( $post_id, '_et_post_bg_layout' );
[678] Fix | Delete
[679] Fix | Delete
if ( isset( $_POST['et_single_title'] ) )
[680] Fix | Delete
update_post_meta( $post_id, '_et_pb_show_title', sanitize_text_field( $_POST['et_single_title'] ) );
[681] Fix | Delete
else
[682] Fix | Delete
delete_post_meta( $post_id, '_et_pb_show_title' );
[683] Fix | Delete
[684] Fix | Delete
if ( isset( $_POST['et_pb_post_hide_nav'] ) )
[685] Fix | Delete
update_post_meta( $post_id, '_et_pb_post_hide_nav', sanitize_text_field( $_POST['et_pb_post_hide_nav'] ) );
[686] Fix | Delete
else
[687] Fix | Delete
delete_post_meta( $post_id, '_et_pb_post_hide_nav' );
[688] Fix | Delete
[689] Fix | Delete
if ( isset( $_POST['et_project_nav'] ) )
[690] Fix | Delete
update_post_meta( $post_id, '_et_pb_project_nav', sanitize_text_field( $_POST['et_project_nav'] ) );
[691] Fix | Delete
else
[692] Fix | Delete
delete_post_meta( $post_id, '_et_pb_project_nav' );
[693] Fix | Delete
[694] Fix | Delete
if ( isset( $_POST['et_pb_page_layout'] ) ) {
[695] Fix | Delete
update_post_meta( $post_id, '_et_pb_page_layout', sanitize_text_field( $_POST['et_pb_page_layout'] ) );
[696] Fix | Delete
} else {
[697] Fix | Delete
delete_post_meta( $post_id, '_et_pb_page_layout' );
[698] Fix | Delete
}
[699] Fix | Delete
[700] Fix | Delete
if ( isset( $_POST['et_pb_side_nav'] ) ) {
[701] Fix | Delete
update_post_meta( $post_id, '_et_pb_side_nav', sanitize_text_field( $_POST['et_pb_side_nav'] ) );
[702] Fix | Delete
} else {
[703] Fix | Delete
delete_post_meta( $post_id, '_et_pb_side_nav' );
[704] Fix | Delete
}
[705] Fix | Delete
[706] Fix | Delete
if ( isset( $_POST['et_pb_product_page_layout'] ) ) {
[707] Fix | Delete
update_post_meta( $post_id, '_et_pb_product_page_layout', sanitize_text_field( $_POST['et_pb_product_page_layout'] ) );
[708] Fix | Delete
} else {
[709] Fix | Delete
delete_post_meta( $post_id, '_et_pb_product_page_layout' );
[710] Fix | Delete
}
[711] Fix | Delete
}
[712] Fix | Delete
add_action( 'save_post', 'et_divi_post_settings_save_details', 10, 2 );
[713] Fix | Delete
[714] Fix | Delete
/**
[715] Fix | Delete
* Return the list of languages which support one font
[716] Fix | Delete
* @return array
[717] Fix | Delete
*/
[718] Fix | Delete
if ( ! function_exists( 'et_get_one_font_languages' ) ) :
[719] Fix | Delete
function et_get_one_font_languages() {
[720] Fix | Delete
$one_font_languages = array(
[721] Fix | Delete
'ja' => array(
[722] Fix | Delete
'language_name' => 'Japanese',
[723] Fix | Delete
'google_font_url' => '//fonts.googleapis.com/earlyaccess/notosansjapanese.css',
[724] Fix | Delete
'font_family' => "'Noto Sans Japanese', serif",
[725] Fix | Delete
),
[726] Fix | Delete
'ko_KR' => array(
[727] Fix | Delete
'language_name' => 'Korean',
[728] Fix | Delete
'google_font_url' => '//fonts.googleapis.com/earlyaccess/hanna.css',
[729] Fix | Delete
'font_family' => "'Hanna', serif",
[730] Fix | Delete
),
[731] Fix | Delete
'ms_MY' => array(
[732] Fix | Delete
'language_name' => 'Malay',
[733] Fix | Delete
'google_font_url' => '//fonts.googleapis.com/earlyaccess/notosansmalayalam.css',
[734] Fix | Delete
'font_family' => "'Noto Sans Malayalam', serif",
[735] Fix | Delete
),
[736] Fix | Delete
'zh_CN' => array(
[737] Fix | Delete
'language_name' => 'Chinese',
[738] Fix | Delete
'google_font_url' => '//fonts.googleapis.com/earlyaccess/cwtexfangsong.css',
[739] Fix | Delete
'font_family' => "'cwTeXFangSong', serif",
[740] Fix | Delete
),
[741] Fix | Delete
);
[742] Fix | Delete
[743] Fix | Delete
return $one_font_languages;
[744] Fix | Delete
}
[745] Fix | Delete
endif;
[746] Fix | Delete
[747] Fix | Delete
/**
[748] Fix | Delete
* Return the list of languages which supported one font previously
[749] Fix | Delete
* @return array
[750] Fix | Delete
*/
[751] Fix | Delete
if ( ! function_exists( 'et_get_old_one_font_languages' ) ) :
[752] Fix | Delete
function et_get_old_one_font_languages() {
[753] Fix | Delete
$old_one_font_languages = array(
[754] Fix | Delete
'he_IL' => array(
[755] Fix | Delete
'language_name' => 'Hebrew',
[756] Fix | Delete
'google_font_url' => '//fonts.googleapis.com/earlyaccess/alefhebrew.css',
[757] Fix | Delete
'font_family' => 'Alef Hebrew',
[758] Fix | Delete
),
[759] Fix | Delete
'ar' => array(
[760] Fix | Delete
'language_name' => 'Arabic',
[761] Fix | Delete
'google_font_url' => '//fonts.googleapis.com/earlyaccess/lateef.css',
[762] Fix | Delete
'font_family' => 'Lateef',
[763] Fix | Delete
),
[764] Fix | Delete
'th' => array(
[765] Fix | Delete
'language_name' => 'Thai',
[766] Fix | Delete
'google_font_url' => '//fonts.googleapis.com/earlyaccess/notosansthai.css',
[767] Fix | Delete
'font_family' => 'Noto Sans Thai',
[768] Fix | Delete
),
[769] Fix | Delete
);
[770] Fix | Delete
[771] Fix | Delete
return $old_one_font_languages;
[772] Fix | Delete
}
[773] Fix | Delete
endif;
[774] Fix | Delete
[775] Fix | Delete
/**
[776] Fix | Delete
* Return custom default font-family for the languages which supported one font previously
[777] Fix | Delete
* @param string
[778] Fix | Delete
* @return string
[779] Fix | Delete
*/
[780] Fix | Delete
if ( ! function_exists( 'et_pb_get_specific_default_font' ) ) :
[781] Fix | Delete
function et_pb_get_specific_default_font( $font_family ) {
[782] Fix | Delete
// do nothing if font is not default
[783] Fix | Delete
if ( ! in_array( $font_family, array( 'none', '' ) ) ) {
[784] Fix | Delete
return $font_family;
[785] Fix | Delete
}
[786] Fix | Delete
[787] Fix | Delete
$site_domain = get_locale();
[788] Fix | Delete
[789] Fix | Delete
// array of the languages which were "one font languages" earlier and have specific defaults
[790] Fix | Delete
$specific_defaults = et_get_old_one_font_languages();
[791] Fix | Delete
[792] Fix | Delete
if ( isset( $specific_defaults[ $site_domain ] ) ) {
[793] Fix | Delete
return $specific_defaults[ $site_domain ]['font_family'];
[794] Fix | Delete
}
[795] Fix | Delete
[796] Fix | Delete
return $font_family;
[797] Fix | Delete
}
[798] Fix | Delete
endif;
[799] Fix | Delete
[800] Fix | Delete
function et_divi_customize_register( $wp_customize ) {
[801] Fix | Delete
global $wp_version;
[802] Fix | Delete
[803] Fix | Delete
// Get WP major version
[804] Fix | Delete
$wp_major_version = substr( $wp_version, 0, 3 );
[805] Fix | Delete
[806] Fix | Delete
$wp_customize->remove_section( 'title_tagline' );
[807] Fix | Delete
$wp_customize->remove_section( 'background_image' );
[808] Fix | Delete
$wp_customize->remove_section( 'colors' );
[809] Fix | Delete
$wp_customize->register_control_type( 'ET_Divi_Customize_Color_Alpha_Control' );
[810] Fix | Delete
[811] Fix | Delete
if ( version_compare( $wp_major_version, '4.9', '>=' ) ) {
[812] Fix | Delete
wp_register_script( 'wp-color-picker-alpha', get_template_directory_uri() . '/includes/builder/scripts/ext/wp-color-picker-alpha.min.js', array( 'jquery', 'wp-color-picker' ) );
[813] Fix | Delete
wp_localize_script( 'wp-color-picker-alpha', 'et_pb_color_picker_strings', apply_filters( 'et_pb_color_picker_strings_builder', array(
[814] Fix | Delete
'legacy_pick' => esc_html__( 'Select', 'et_builder' ),
[815] Fix | Delete
'legacy_current' => esc_html__( 'Current Color', 'et_builder' ),
[816] Fix | Delete
) ) );
[817] Fix | Delete
} else {
[818] Fix | Delete
wp_register_script( 'wp-color-picker-alpha', get_template_directory_uri() . '/includes/builder/scripts/ext/wp-color-picker-alpha-48.min.js', array( 'jquery', 'wp-color-picker' ) );
[819] Fix | Delete
}
[820] Fix | Delete
[821] Fix | Delete
$option_set_name = 'et_customizer_option_set';
[822] Fix | Delete
$option_set_allowed_values = apply_filters( 'et_customizer_option_set_allowed_values', array( 'module', 'theme' ) );
[823] Fix | Delete
[824] Fix | Delete
$customizer_option_set = '';
[825] Fix | Delete
[826] Fix | Delete
/**
[827] Fix | Delete
* Set a transient,
[828] Fix | Delete
* if 'et_customizer_option_set' query parameter is set to one of the allowed values
[829] Fix | Delete
*/
[830] Fix | Delete
if ( isset( $_GET[ $option_set_name ] ) && in_array( $_GET[ $option_set_name ], $option_set_allowed_values ) ) {
[831] Fix | Delete
$customizer_option_set = $_GET[ $option_set_name ];
[832] Fix | Delete
[833] Fix | Delete
set_transient( 'et_divi_customizer_option_set', $customizer_option_set, DAY_IN_SECONDS );
[834] Fix | Delete
}
[835] Fix | Delete
[836] Fix | Delete
if ( '' === $customizer_option_set && ( $et_customizer_option_set_value = get_transient( 'et_divi_customizer_option_set' ) ) ) {
[837] Fix | Delete
$customizer_option_set = $et_customizer_option_set_value;
[838] Fix | Delete
}
[839] Fix | Delete
[840] Fix | Delete
et_builder_init_global_settings();
[841] Fix | Delete
[842] Fix | Delete
// Determine if current request is Design Preview Link. Design Preview Link was added on
[843] Fix | Delete
// WordPress 4.9 and enables user to share customizer change without the need to publish the
[844] Fix | Delete
// customizer change first: save customizer change as draft, copy the link, and share it with
[845] Fix | Delete
// collaborator. Design Preview Link works on non-logged in user
[846] Fix | Delete
// @see https://codex.wordpress.org/Version_4.9
[847] Fix | Delete
$is_customizer_public_shared_link = ! is_admin() && is_customize_preview() && ! $wp_customize->get_messenger_channel();
[848] Fix | Delete
[849] Fix | Delete
// display wp error screen if theme customizer disabled for current user
[850] Fix | Delete
if ( ! et_pb_is_allowed( 'theme_customizer' ) && ! $is_customizer_public_shared_link ) {
[851] Fix | Delete
wp_die( esc_html__( "you don't have sufficient permissions to access this page", 'Divi' ) );
[852] Fix | Delete
}
[853] Fix | Delete
[854] Fix | Delete
et_divi_customizer_theme_settings( $wp_customize );
[855] Fix | Delete
}
[856] Fix | Delete
add_action( 'customize_register', 'et_divi_customize_register' );
[857] Fix | Delete
[858] Fix | Delete
if ( ! function_exists( 'et_divi_customizer_theme_settings' ) ) :
[859] Fix | Delete
/**
[860] Fix | Delete
* @param \WP_Customize_Manager $wp_customize
[861] Fix | Delete
*/
[862] Fix | Delete
function et_divi_customizer_theme_settings( $wp_customize ) {
[863] Fix | Delete
$site_domain = get_locale();
[864] Fix | Delete
[865] Fix | Delete
$google_fonts = et_builder_get_fonts( array(
[866] Fix | Delete
'prepend_standard_fonts' => false,
[867] Fix | Delete
) );
[868] Fix | Delete
[869] Fix | Delete
$user_fonts = et_builder_get_custom_fonts();
[870] Fix | Delete
[871] Fix | Delete
// combine google fonts with custom user fonts
[872] Fix | Delete
$google_fonts = array_merge( $user_fonts, $google_fonts );
[873] Fix | Delete
[874] Fix | Delete
$et_domain_fonts = array(
[875] Fix | Delete
'ru_RU' => 'cyrillic',
[876] Fix | Delete
'uk' => 'cyrillic',
[877] Fix | Delete
'bg_BG' => 'cyrillic',
[878] Fix | Delete
'vi' => 'vietnamese',
[879] Fix | Delete
'el' => 'greek',
[880] Fix | Delete
'ar' => 'arabic',
[881] Fix | Delete
'he_IL' => 'hebrew',
[882] Fix | Delete
'th' => 'thai',
[883] Fix | Delete
'si_lk' => 'sinhala',
[884] Fix | Delete
'bn_bd' => 'bengali',
[885] Fix | Delete
'ta_lk' => 'tamil',
[886] Fix | Delete
'te' => 'telegu',
[887] Fix | Delete
'km' => 'khmer',
[888] Fix | Delete
'kn' => 'kannada',
[889] Fix | Delete
'ml_in' => 'malayalam',
[890] Fix | Delete
);
[891] Fix | Delete
[892] Fix | Delete
$et_one_font_languages = et_get_one_font_languages();
[893] Fix | Delete
[894] Fix | Delete
$font_choices = array();
[895] Fix | Delete
$font_choices['none'] = array(
[896] Fix | Delete
'label' => 'Default Theme Font'
[897] Fix | Delete
);
[898] Fix | Delete
[899] Fix | Delete
$removed_fonts_mapping = et_builder_old_fonts_mapping();
[900] Fix | Delete
[901] Fix | Delete
foreach ( $google_fonts as $google_font_name => $google_font_properties ) {
[902] Fix | Delete
$use_parent_font = false;
[903] Fix | Delete
[904] Fix | Delete
if ( isset( $removed_fonts_mapping[ $google_font_name ] ) ) {
[905] Fix | Delete
$parent_font = $removed_fonts_mapping[ $google_font_name ]['parent_font'];
[906] Fix | Delete
$google_font_properties['character_set'] = $google_fonts[ $parent_font ]['character_set'];
[907] Fix | Delete
$use_parent_font = true;
[908] Fix | Delete
}
[909] Fix | Delete
[910] Fix | Delete
if ( '' !== $site_domain && isset( $et_domain_fonts[$site_domain] ) && isset( $google_font_properties['character_set'] ) && false === strpos( $google_font_properties['character_set'], $et_domain_fonts[$site_domain] ) ) {
[911] Fix | Delete
continue;
[912] Fix | Delete
}
[913] Fix | Delete
[914] Fix | Delete
$font_choices[ $google_font_name ] = array(
[915] Fix | Delete
'label' => $google_font_name,
[916] Fix | Delete
'data' => array(
[917] Fix | Delete
'parent_font' => $use_parent_font ? $google_font_properties['parent_font'] : '',
[918] Fix | Delete
'parent_styles' => $use_parent_font ? $google_fonts[$parent_font]['styles'] : $google_font_properties['styles'],
[919] Fix | Delete
'current_styles' => $use_parent_font && isset( $google_fonts[$parent_font]['styles'] ) && isset( $google_font_properties['styles'] ) ? $google_font_properties['styles'] : '',
[920] Fix | Delete
'parent_subset' => $use_parent_font && isset( $google_fonts[$parent_font]['character_set'] ) ? $google_fonts[$parent_font]['character_set'] : '',
[921] Fix | Delete
'standard' => isset( $google_font_properties['standard'] ) && $google_font_properties['standard'] ? 'on' : 'off',
[922] Fix | Delete
)
[923] Fix | Delete
);
[924] Fix | Delete
}
[925] Fix | Delete
[926] Fix | Delete
$wp_customize->add_panel( 'et_divi_general_settings' , array(
[927] Fix | Delete
'title' => esc_html__( 'General Settings', 'Divi' ),
[928] Fix | Delete
'priority' => 1,
[929] Fix | Delete
) );
[930] Fix | Delete
[931] Fix | Delete
$wp_customize->add_section( 'title_tagline', array(
[932] Fix | Delete
'title' => esc_html__( 'Site Identity', 'Divi' ),
[933] Fix | Delete
'panel' => 'et_divi_general_settings',
[934] Fix | Delete
) );
[935] Fix | Delete
[936] Fix | Delete
$wp_customize->add_section( 'et_divi_general_layout' , array(
[937] Fix | Delete
'title' => esc_html__( 'Layout Settings', 'Divi' ),
[938] Fix | Delete
'panel' => 'et_divi_general_settings',
[939] Fix | Delete
) );
[940] Fix | Delete
[941] Fix | Delete
$wp_customize->add_section( 'et_divi_general_typography' , array(
[942] Fix | Delete
'title' => esc_html__( 'Typography', 'Divi' ),
[943] Fix | Delete
'panel' => 'et_divi_general_settings',
[944] Fix | Delete
) );
[945] Fix | Delete
[946] Fix | Delete
$wp_customize->add_panel( 'et_divi_mobile' , array(
[947] Fix | Delete
'title' => esc_html__( 'Mobile Styles', 'Divi' ),
[948] Fix | Delete
'priority' => 6,
[949] Fix | Delete
) );
[950] Fix | Delete
[951] Fix | Delete
$wp_customize->add_section( 'et_divi_mobile_tablet' , array(
[952] Fix | Delete
'title' => esc_html__( 'Tablet', 'Divi' ),
[953] Fix | Delete
'panel' => 'et_divi_mobile',
[954] Fix | Delete
) );
[955] Fix | Delete
[956] Fix | Delete
$wp_customize->add_section( 'et_divi_mobile_phone' , array(
[957] Fix | Delete
'title' => esc_html__( 'Phone', 'Divi' ),
[958] Fix | Delete
'panel' => 'et_divi_mobile',
[959] Fix | Delete
) );
[960] Fix | Delete
[961] Fix | Delete
$wp_customize->add_section( 'et_divi_mobile_menu' , array(
[962] Fix | Delete
'title' => esc_html__( 'Mobile Menu', 'Divi' ),
[963] Fix | Delete
'panel' => 'et_divi_mobile',
[964] Fix | Delete
) );
[965] Fix | Delete
[966] Fix | Delete
$wp_customize->add_section( 'et_divi_general_background' , array(
[967] Fix | Delete
'title' => esc_html__( 'Background', 'Divi' ),
[968] Fix | Delete
'panel' => 'et_divi_general_settings',
[969] Fix | Delete
) );
[970] Fix | Delete
[971] Fix | Delete
$wp_customize->add_panel( 'et_divi_header_panel', array(
[972] Fix | Delete
'title' => esc_html__( 'Header & Navigation', 'Divi' ),
[973] Fix | Delete
'priority' => 2,
[974] Fix | Delete
) );
[975] Fix | Delete
[976] Fix | Delete
$wp_customize->add_section( 'et_divi_header_layout' , array(
[977] Fix | Delete
'title' => esc_html__( 'Header Format', 'Divi' ),
[978] Fix | Delete
'panel' => 'et_divi_header_panel',
[979] Fix | Delete
) );
[980] Fix | Delete
[981] Fix | Delete
$wp_customize->add_section( 'et_divi_header_primary' , array(
[982] Fix | Delete
'title' => esc_html__( 'Primary Menu Bar', 'Divi' ),
[983] Fix | Delete
'panel' => 'et_divi_header_panel',
[984] Fix | Delete
) );
[985] Fix | Delete
[986] Fix | Delete
$wp_customize->add_section( 'et_divi_header_secondary' , array(
[987] Fix | Delete
'title' => esc_html__( 'Secondary Menu Bar', 'Divi' ),
[988] Fix | Delete
'panel' => 'et_divi_header_panel',
[989] Fix | Delete
) );
[990] Fix | Delete
[991] Fix | Delete
$wp_customize->add_section( 'et_divi_header_slide' , array(
[992] Fix | Delete
'title' => esc_html__( 'Slide In & Fullscreen Header Settings', 'Divi' ),
[993] Fix | Delete
'panel' => 'et_divi_header_panel',
[994] Fix | Delete
) );
[995] Fix | Delete
[996] Fix | Delete
$wp_customize->add_section( 'et_divi_header_fixed' , array(
[997] Fix | Delete
'title' => esc_html__( 'Fixed Navigation Settings', 'Divi' ),
[998] Fix | Delete
'panel' => 'et_divi_header_panel',
[999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function