This is a fresh installation of %1$s theme. Don\'t forget to go to ePanel to set it up. This message will disappear once you have clicked the Save button within the theme\'s options page.
', $themename ) ), esc_html( wp_get_theme() ), esc_url( admin_url( 'themes.php?page=core_functions.php' ) ) );
}
}
}
add_filter( 'body_class', 'et_add_fullwidth_body_class' );
function et_add_fullwidth_body_class( $classes ){
$fullwidth_view = false;
if ( is_page_template( 'page-full.php' ) ) $fullwidth_view = true;
if ( is_page() || is_single() ) {
$et_ptemplate_settings = get_post_meta( get_queried_object_id(), 'et_ptemplate_settings', true );
$fullwidth = isset( $et_ptemplate_settings['et_fullwidthpage'] ) ? (bool) $et_ptemplate_settings['et_fullwidthpage'] : false;
if ( $fullwidth ) $fullwidth_view = true;
}
if ( is_single() && 'on' === get_post_meta( get_queried_object_id(), '_et_full_post', true ) ) $fullwidth_view = true;
$classes[] = apply_filters( 'et_fullwidth_view_body_class', $fullwidth_view ) ? 'et_fullwidth_view' : 'et_includes_sidebar';
return $classes;
}
/**
* Enqueue legacy shortcodes' CSS.
*
* @since ??
*/
function et_add_legacy_shortcode_css() {
wp_enqueue_style(
'et-shortcodes-css',
ET_SHORTCODES_DIR . '/css/shortcodes-legacy.css',
array(),
ET_SHORTCODES_VERSION,
'all'
);
wp_enqueue_style(
'et-shortcodes-responsive-css',
ET_SHORTCODES_DIR . '/css/shortcodes_responsive.css',
false,
ET_SHORTCODES_VERSION,
'all'
);
}
/**
* Enqueue legacy shortcode JS.
*
* @return void
* @since ??
*/
function et_add_legacy_shortcode_js() {
global $themename;
$shortcode_strings_handle = apply_filters( 'et_shortcodes_strings_handle', 'et-shortcodes-js' );
wp_enqueue_script( 'et-shortcodes-js', ET_SHORTCODES_DIR . '/js/et_shortcodes_frontend.js', array( 'jquery' ), ET_SHORTCODES_VERSION, false );
wp_localize_script(
$shortcode_strings_handle,
'et_shortcodes_strings',
array(
'previous' => esc_html__( 'Previous', $themename ),
'next' => esc_html__( 'Next', $themename ),
)
);
}
/**
* Enqueue responsive shortcode CSS in legacy themes when the ePanel option is enabled.
*
* @since ??
*/
function et_add_responsive_shortcodes_css() {
global $shortname;
if ( 'on' === et_get_option( $shortname . '_responsive_shortcodes', 'on' ) )
wp_enqueue_style( 'et-shortcodes-responsive-css', ET_SHORTCODES_DIR . '/css/shortcodes_responsive.css', false, ET_SHORTCODES_VERSION, 'all' );
}
/**
* Loads theme settings
*
*/
if ( ! function_exists( 'et_load_core_options' ) ) {
function et_load_core_options() {
global $shortname;
require_once get_template_directory() . esc_attr( "/options_{$shortname}.php" );
}
}
/**
* Adds custom css option content to
*
*/
function et_add_custom_css() {
// use default wp custom css system starting from WP 4.7
// fallback to our legacy custom css system otherwise
if ( function_exists( 'wp_get_custom_css_post' ) ) {
return;
}
global $shortname;
$custom_css = et_get_option( "{$shortname}_custom_css" );
if ( empty( $custom_css ) ) return;
/**
* The theme doesn't strip slashes from custom css, when saving to the database,
* so it does that before outputting the code on front-end
*/
echo '';
}
add_action( 'wp_head', 'et_add_custom_css', 100 );
if ( ! function_exists( 'et_get_google_fonts' ) ) :
/**
* Returns the list of popular google fonts
* Fallback to websafe fonts if disabled
*/
function et_get_google_fonts() {
$websafe_fonts = et_core_get_websafe_fonts();
$google_fonts = et_core_use_google_fonts() ? et_core_get_saved_google_fonts() : $websafe_fonts;
return apply_filters( 'et_google_fonts', $google_fonts );
}
endif;
if ( ! function_exists( 'et_get_websafe_font_stack' ) ) :
/**
* Determines a websafe font stack, using font type
*
*/
function et_get_websafe_font_stack( $type = 'sans-serif' ) {
$font_stack = '';
switch ( $type ) {
case 'sans-serif':
$font_stack = 'Helvetica, Arial, Lucida, sans-serif';
break;
case 'serif':
$font_stack = 'Georgia, "Times New Roman", serif';
break;
case 'cursive':
$font_stack = 'cursive';
break;
}
return $font_stack;
}
endif;
if ( ! function_exists( 'et_gf_attach_font' ) ) :
/**
* Attaches Google Font to given css elements
*
*/
function et_gf_attach_font( $et_gf_font_name, $elements ) {
$google_fonts = et_get_google_fonts();
printf( '%s { font-family: \'%s\', %s; }',
esc_html( $elements ),
esc_html( $et_gf_font_name ),
et_core_esc_previously( et_get_websafe_font_stack( $google_fonts[$et_gf_font_name]['type'] ) )
);
}
endif;
if ( ! function_exists( 'et_gf_enqueue_fonts' ) ) :
/**
* Enqueues Google Fonts
*
*/
function et_gf_enqueue_fonts( $et_gf_font_names ) {
global $shortname;
if ( ! is_array( $et_gf_font_names ) || empty( $et_gf_font_names ) || ! et_core_use_google_fonts() ) {
return;
}
$google_fonts = et_get_google_fonts();
$protocol = is_ssl() ? 'https' : 'http';
foreach ( $et_gf_font_names as $et_gf_font_name ) {
$google_font_character_set = $google_fonts[$et_gf_font_name]['character_set'];
// By default, only latin and latin-ext subsets are loaded, all available subsets can be enabled in ePanel
if ( 'false' === et_get_option( "{$shortname}_gf_enable_all_character_sets", 'false' ) ) {
$latin_ext = '';
if ( false !== strpos( $google_fonts[$et_gf_font_name]['character_set'], 'latin-ext' ) )
$latin_ext = ',latin-ext';
$google_font_character_set = "latin{$latin_ext}";
}
$query_args = array(
'family' => sprintf( '%s:%s',
str_replace( ' ', '+', $et_gf_font_name ),
apply_filters( 'et_gf_set_styles', $google_fonts[$et_gf_font_name]['styles'], $et_gf_font_name )
),
'subset' => apply_filters( 'et_gf_set_character_set', $google_font_character_set, $et_gf_font_name ),
);
$et_gf_font_name_slug = strtolower( str_replace( ' ', '-', $et_gf_font_name ) );
wp_enqueue_style( 'et-gf-' . $et_gf_font_name_slug, esc_url( add_query_arg( $query_args, "$protocol://fonts.googleapis.com/css" ) ), array(), null );
}
}
endif;
if ( ! function_exists( 'et_pb_get_google_api_key' ) ) :
function et_pb_get_google_api_key() {
$google_api_option = get_option( 'et_google_api_settings' );
$google_api_key = isset( $google_api_option['api_key'] ) ? $google_api_option['api_key'] : '';
return $google_api_key;
}
endif;
if ( ! function_exists( 'et_uc_theme_name' ) ) :
/**
* Fixes the bug with lowercase theme name, preventing a theme to update correctly,
* when an update is being performed via Themes page
*/
function et_uc_theme_name( $key, $raw_key ) {
if ( ! ( is_admin() && isset( $_REQUEST['action'] ) && 'update-theme' === $_REQUEST['action'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.NoNonceVerification
return $key;
}
$theme_info = wp_get_theme();
if ( is_child_theme() ) {
$theme_info = wp_get_theme( $theme_info->parent_theme );
}
$theme_name = $theme_info->display( 'Name' );
if ( $raw_key !== $theme_name ) {
return $key;
}
return $theme_name;
}
add_filter( 'sanitize_key', 'et_uc_theme_name', 10, 2 );
endif;
if ( ! function_exists( 'et_core_exists_in_active_plugins' ) ) :
function et_core_exists_in_active_plugins() {
$result = defined( 'ET_BUILDER_PLUGIN_DIR' )
|| defined( 'ET_BLOOM_PLUGIN_DIR' )
|| defined( 'ET_MONARCH_PLUGIN_DIR' );
return $result;
}
endif;