parent_theme ); } $theme_version = $theme_info->display( 'Version' ); return $theme_version; } endif; if ( ! function_exists( 'et_options_stored_in_one_row' ) ) { function et_options_stored_in_one_row(){ global $et_store_options_in_one_row; return isset( $et_store_options_in_one_row ) ? (bool) $et_store_options_in_one_row : false; } } /* sync custom CSS from ePanel with WP custom CSS option introduced in WP 4.7 */ if ( ! function_exists( 'et_sync_custom_css_options' ) ) { function et_sync_custom_css_options() { global $shortname; $legacy_custom_css = wp_unslash( et_get_option( "{$shortname}_custom_css" ) ); // nothing to sync if no custom css saved in ePanel if ( '' === $legacy_custom_css || ! $legacy_custom_css || empty( $legacy_custom_css ) ) { set_theme_mod( 'et_pb_css_synced', 'yes' ); return; } // don't proceed with the sync logic if the custom CSS option does not exist if ( ! function_exists( 'wp_get_custom_css' ) ) { return; } $css_synced = get_theme_mod( 'et_pb_css_synced', 'no' ); // get custom css string from WP customizer $wp_custom_css = wp_get_custom_css(); // force sync if the current custom CSS is empty if ( 'yes' === $css_synced && '' !== $wp_custom_css ) { return; } // ePanel is completely synced with Customizer if ( $wp_custom_css === $legacy_custom_css || false !== strpos( $wp_custom_css, $legacy_custom_css ) ) { set_theme_mod( 'et_pb_css_synced', 'yes' ); return; } // merge custom css from WP customizer with ePanel custom css $updated_custom_css = $legacy_custom_css . ' ' . $wp_custom_css; $updated_status = wp_update_custom_css_post( $updated_custom_css ); // set theme mod in case of success if ( is_object( $updated_status ) && ! empty( $updated_status ) ) { set_theme_mod( 'et_pb_css_synced', 'yes' ); } } } add_action( 'init', 'et_sync_custom_css_options' ); /** * sync custom CSS from WP custom CSS option introduced in WP 4.7 with theme options for backward compatibility * it should be removed after a few WP major updates when we fully migrate to WP custom CSS system */ if ( ! function_exists( 'et_back_sync_custom_css_options' ) ) { function et_back_sync_custom_css_options( $data ) { global $shortname; if ( ! empty( $data ) && isset( $data['css'] ) ) { et_update_option( "{$shortname}_custom_css", $data['css'] ); } return $data; } } add_filter( 'update_custom_css_data', 'et_back_sync_custom_css_options' ); if ( ! function_exists( 'et_update_custom_css_data_cb' ) ): function et_update_custom_css_data_cb( $data ) { ET_Core_PageResource::remove_static_resources( 'all', 'all' ); return $data; } add_filter( 'update_custom_css_data', 'et_update_custom_css_data_cb' ); endif; if ( ! function_exists( 'et_epanel_handle_custom_css_output' ) ): function et_epanel_handle_custom_css_output( $css, $stylesheet ) { global $wp_current_filter, $shortname; /** @see ET_Core_SupportCenter::toggle_safe_mode */ if ( et_core_is_safe_mode_active() ) { return $css; } if ( ! $css || ! in_array( 'wp_head', $wp_current_filter ) || is_admin() && ! is_customize_preview() ) { return $css; } $post_id = et_core_page_resource_get_the_ID(); $is_preview = is_preview() || isset( $_GET['et_pb_preview_nonce'] ) || is_customize_preview(); // phpcs:ignore WordPress.Security.NonceVerification.NoNonceVerification $is_singular = et_core_page_resource_is_singular(); $disabled_global = 'off' === et_get_option( 'et_pb_static_css_file', 'on' ); $disabled_post = $disabled_global || ( $is_singular && 'off' === get_post_meta( $post_id, '_et_pb_static_css_file', true ) ); $forced_inline = $is_preview || $disabled_global || $disabled_post || post_password_required(); $builder_in_footer = 'on' === et_get_option( 'et_pb_css_in_footer', 'off' ); $unified_styles = $is_singular && ! $forced_inline && ! $builder_in_footer && et_core_is_builder_used_on_current_request(); $resource_owner = $unified_styles ? 'core' : $shortname; $resource_slug = $unified_styles ? 'unified' : 'customizer'; if ( $is_preview ) { // Don't let previews cause existing saved static css files to be modified. $resource_slug .= '-preview'; } if ( function_exists( 'et_fb_is_enabled' ) && et_fb_is_enabled() ) { $resource_slug .= '-vb'; } if ( ! $unified_styles ) { $post_id = 'global'; } $styles_manager = et_core_page_resource_get( $resource_owner, $resource_slug, $post_id, 30 ); if ( $styles_manager->forced_inline || ! $styles_manager->has_file() ) { $styles_manager->set_data( $css, 30 ); } return ''; // We're handling the custom CSS output ourselves. } add_filter( 'wp_get_custom_css', 'et_epanel_handle_custom_css_output', 999, 2 ); endif; if ( ! function_exists( 'et_get_option' ) ) { /** * Gets option value from the single theme option, stored as an array in the database * if all options stored in one row. * Stores the serialized array with theme options into the global variable on the first function run on the page. * * If options are stored as separate rows in database, it simply uses get_option() function. * * @param string $option_name Theme option name. * @param string $default_value Default value that should be set if the theme option isn't set. * @param string $used_for_object "Object" name that should be translated into corresponding "object" if WPML is activated. * @param bool $force_default_value Is return provided default. * @param bool $is_global_setting Is Global Setting. * @param string $global_setting_main_name Global Setting name. * @param string $global_setting_sub_name Global Setting sub name. * @param bool $is_product_setting Product setting flag. * @return mixed Theme option value or false if not found. */ function et_get_option( $option_name, $default_value = '', $used_for_object = '', $force_default_value = false, $is_global_setting = false, $global_setting_main_name = '', $global_setting_sub_name = '', $is_product_setting = false ) { global $et_theme_options, $shortname; $et_one_row_option_name = ''; if ( $is_global_setting ) { $option_value = ''; $et_global_setting = get_option( $global_setting_main_name ); if ( false !== $et_global_setting && isset( $et_global_setting[ $global_setting_sub_name ] ) ) { $option_value = $et_global_setting[ $global_setting_sub_name ]; } } elseif ( $is_product_setting ) { $et_product_setting_name = 'et_' . $shortname . '_' . $option_name; $option_value = $force_default_value ? get_option( $et_product_setting_name, $default_value ) : get_option( $et_product_setting_name ); } elseif ( et_options_stored_in_one_row() ) { $et_theme_options_name = 'et_' . $shortname; if ( ! isset( $et_theme_options ) || is_customize_preview() ) { $et_theme_options = get_option( $et_theme_options_name ); } $option_value = isset( $et_theme_options[$option_name] ) ? $et_theme_options[$option_name] : false; $et_one_row_option_name = $et_theme_options_name . '_' . $option_name; } else { $option_value = $force_default_value ? get_option( $option_name, $default_value ) : get_option( $option_name ); } // option value might be equal to false, so check if the option is not set in the database if ( et_options_stored_in_one_row() && ! $is_product_setting && ! isset( $et_theme_options[ $option_name ] ) && ( ! empty( $default_value ) || $force_default_value ) ) { $option_value = $default_value; } if ( ! empty( $used_for_object ) && in_array( $used_for_object, array( 'page', 'category' ) ) && is_array( $option_value ) ) $option_value = et_generate_wpml_ids( $option_value, $used_for_object ); if ( ! empty( $et_one_row_option_name ) ) { $option_value = apply_filters( 'et_get_option_' . $et_one_row_option_name, $option_value, $et_one_row_option_name ); } return $option_value; } } if ( ! function_exists( 'et_update_option' ) ) { /** * Update option value in theme option, stored as an array in the database * if all options stored in one row. * * If options are stored as separate rows in database, it simply uses update_option() function. * * @param string $option_name Theme option name. * @param string $new_value Theme option value. * @param bool $is_new_global_setting Global setting flag. * @param string $global_setting_main_name Global setting name. * @param string $global_setting_sub_name Global setting sub name. * @param bool $is_product_setting Product setting flag. */ function et_update_option( $option_name, $new_value, $is_new_global_setting = false, $global_setting_main_name = '', $global_setting_sub_name = '', $is_product_setting = false ) { global $et_theme_options, $shortname; if ( $is_new_global_setting && '' !== $global_setting_main_name && '' !== $global_setting_sub_name ) { $global_setting = get_option( $global_setting_main_name, array() ); // $global_setting has to be array otherwise setting can't be saved so it needs // to be treated as empty array if ( ! is_array( $global_setting ) ) { $global_setting = array(); } $global_setting[ $global_setting_sub_name ] = $new_value; update_option( $global_setting_main_name, $global_setting ); } elseif ( $is_product_setting ) { $et_product_setting_name = 'et_' . $shortname . '_' . $option_name; // Update option and disable autoload of this option. update_option( $et_product_setting_name, $new_value, false ); } elseif ( et_options_stored_in_one_row() ) { $et_theme_options_name = 'et_' . $shortname; if ( ! isset( $et_theme_options ) || is_customize_preview() ) { $et_theme_options = get_option( $et_theme_options_name ); } $et_theme_options[ $option_name ] = $new_value; update_option( $et_theme_options_name, $et_theme_options ); } else { update_option( $option_name, $new_value ); } } } if ( ! function_exists( 'et_delete_option' ) ) { function et_delete_option( $option_name ){ global $et_theme_options, $shortname; if ( et_options_stored_in_one_row() ) { $et_theme_options_name = 'et_' . $shortname; if ( ! isset( $et_theme_options ) ) $et_theme_options = get_option( $et_theme_options_name ); unset( $et_theme_options[$option_name] ); update_option( $et_theme_options_name, $et_theme_options ); } else { delete_option( $option_name ); } } } /*this function allows for the auto-creation of post excerpts*/ if ( ! function_exists( 'truncate_post' ) ) { /** * Truncate post content to generate post excerpt. * * @since ?? Add new paramter $is_words_length to cut the text based on words length. * * @param integer $amount Amount of text that should be kept. * @param boolean $echo Whether to print the output or not. * @param object $post Post object. * @param boolean $strip_shortcodes Whether to strip the shortcodes or not. * @param boolean $is_words_length Whether to cut the text based on words length or not. * * @return string Generated post post excerpt. */ function truncate_post( $amount, $echo = true, $post = '', $strip_shortcodes = false, $is_words_length = false ) { global $shortname; if ( empty( $post ) ) global $post; if ( post_password_required( $post ) ) { $post_excerpt = get_the_password_form(); if ( $echo ) { echo et_core_intentionally_unescaped( $post_excerpt, 'html' ); return; } return $post_excerpt; } $post_excerpt = apply_filters( 'the_excerpt', $post->post_excerpt ); if ( 'on' === et_get_option( $shortname . '_use_excerpt' ) && ! empty( $post_excerpt ) ) { if ( $echo ) { echo et_core_intentionally_unescaped( $post_excerpt, 'html' ); } else { return $post_excerpt; } } else { // get the post content $truncate = $post->post_content; // remove caption shortcode from the post content $truncate = preg_replace( '@\[caption[^\]]*?\].*?\[\/caption]@si', '', $truncate ); // remove post nav shortcode from the post content $truncate = preg_replace( '@\[et_pb_post_nav[^\]]*?\].*?\[\/et_pb_post_nav]@si', '', $truncate ); // Remove audio shortcode from post content to prevent unwanted audio file on the excerpt // due to unparsed audio shortcode $truncate = preg_replace( '@\[audio[^\]]*?\].*?\[\/audio]@si', '', $truncate ); // Remove embed shortcode from post content $truncate = preg_replace( '@\[embed[^\]]*?\].*?\[\/embed]@si', '', $truncate ); // Remove script and style tags from the post content $truncate = wp_strip_all_tags( $truncate ); if ( $strip_shortcodes ) { $truncate = et_strip_shortcodes( $truncate ); $truncate = et_builder_strip_dynamic_content( $truncate ); } else { // Check if content should be overridden with a custom value. $custom = apply_filters( 'et_truncate_post_use_custom_content', false, $truncate, $post ); // apply content filters $truncate = false === $custom ? apply_filters( 'the_content', $truncate ) : $custom; } /** * Filter automatically generated post excerpt before it gets truncated. * * @since 3.17.2 * * @param string $excerpt * @param integer $post_id */ $truncate = apply_filters( 'et_truncate_post', $truncate, $post->ID ); // decide if we need to append dots at the end of the string if ( strlen( $truncate ) <= $amount ) { $echo_out = ''; } else { $echo_out = '...'; // $amount = $amount - 3; } $trim_words = ''; if ( $is_words_length ) { // Reset `$echo_out` text because it will be added by wp_trim_words() with // default WordPress `excerpt_more` text. $echo_out = ''; $excerpt_more = apply_filters( 'excerpt_more', ' […]' ); $trim_words = wp_trim_words( $truncate, $amount, $excerpt_more ); } else { $trim_words = et_wp_trim_words( $truncate, $amount, '' ); } // trim text to a certain number of characters, also remove spaces from the end of a string ( space counts as a character ). $truncate = rtrim( $trim_words ); // remove the last word to make sure we display all words correctly if ( ! empty( $echo_out ) ) { $new_words_array = (array) explode( ' ', $truncate ); // Remove last word if word count is more than 1. if ( count( $new_words_array ) > 1 ) { array_pop( $new_words_array ); } $truncate = implode( ' ', $new_words_array ); // Dots should not add to empty string if ( '' !== $truncate ) { // append dots to the end of the string $truncate .= $echo_out; } } if ( $echo ) { echo et_core_intentionally_unescaped( $truncate, 'html' ); } else { return $truncate; } }; } } if ( ! function_exists( 'et_wp_trim_words' ) ) { function et_wp_trim_words( $text, $num_words = 55, $more = null ) { if ( null === $more ) $more = esc_html__( '…' ); // Completely remove icons so that unicode hex entities representing the icons do not get included in words. $text = preg_replace( '/ $num_words ) { array_pop( $words_array ); $text = implode( $sep, $words_array ); $text = $text . $more; } else { $text = implode( $sep, $words_array ); } return $text; } } /*this function truncates titles to create preview excerpts*/ if ( ! function_exists( 'truncate_title' ) ) { function truncate_title( $amount, $echo = true, $post = '' ) { if ( empty( $post ) ) $truncate = get_the_title(); else $truncate = $post->post_title; if ( strlen( $truncate ) <= $amount ) $echo_out = ''; else $echo_out = '...'; $truncate = et_wp_trim_words( $truncate, $amount, '' ); if ( ! empty( $echo_out ) ) $truncate .= $echo_out; if ( $echo ) echo et_core_intentionally_unescaped( $truncate, 'html' ); else return $truncate; } } /*this function allows users to use the first image in their post as their thumbnail*/ if ( ! function_exists( 'et_first_image' ) ) { function et_first_image() { global $post; $img = ''; if ( empty( $post->ID ) ) { return $img; } $unprocessed_content = $post->post_content; // truncate Post based shortcodes if Divi Builder enabled to avoid infinite loops if ( function_exists( 'et_strip_shortcodes' ) ) { $unprocessed_content = et_strip_shortcodes( $post->post_content, true ); } // Check if content should be overridden with a custom value. $custom = apply_filters( 'et_first_image_use_custom_content', false, $unprocessed_content, $post ); // apply the_content filter to execute all shortcodes and get the correct image from the processed content $processed_content = false === $custom ? apply_filters( 'the_content', $unprocessed_content ) : $custom; $output = preg_match_all( '//i', $processed_content, $matches ); if ( isset( $matches[1][0] ) ) $img = $matches[1][0]; return trim( $img ); } } /* this function gets thumbnail from Post Thumbnail or Custom field or First post image */ if ( ! function_exists( 'get_thumbnail' ) ) { function get_thumbnail($width=100, $height=100, $class='', $alttext='', $titletext='', $fullpath=false, $custom_field='', $post='') { if ( empty( $post ) ) global $post; global $shortname; $thumb_array['thumb'] = ''; $thumb_array['use_timthumb'] = true; if ($fullpath) $thumb_array['fullpath'] = ''; //full image url for lightbox $new_method = true; if ( has_post_thumbnail( $post->ID ) || 'attachment' === $post->post_type ) { $thumb_array['use_timthumb'] = false; $et_fullpath = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' ); if ( is_array( $et_fullpath ) ) { $thumb_array['fullpath'] = $et_fullpath[0]; $thumb_array['thumb'] = $thumb_array['fullpath']; } } if ( empty( $thumb_array['thumb'] ) ) { if ( empty( $custom_field ) ) $thumb_array['thumb'] = esc_attr( get_post_meta( $post->ID, 'Thumbnail', $single = true ) ); else { $thumb_array['thumb'] = esc_attr( get_post_meta( $post->ID, $custom_field, $single = true ) ); if ( empty( $thumb_array['thumb'] ) ) $thumb_array['thumb'] = esc_attr( get_post_meta( $post->ID, 'Thumbnail', $single = true ) ); } if ( '' === $thumb_array['thumb'] && et_grab_image_setting() ) { $thumb_array['thumb'] = esc_attr( et_first_image() ); if ( $fullpath ) $thumb_array['fullpath'] = $thumb_array['thumb']; } #if custom field used for small pre-cropped image, open Thumbnail custom field image in lightbox if ($fullpath) { $thumb_array['fullpath'] = $thumb_array['thumb']; if ( empty( $custom_field ) ) $thumb_array['fullpath'] = apply_filters( 'et_fullpath', et_path_reltoabs( esc_attr( $thumb_array['thumb'] ) ) ); elseif ( ! empty( $custom_field ) && get_post_meta( $post->ID, 'Thumbnail', $single = true ) ) $thumb_array['fullpath'] = apply_filters( 'et_fullpath', et_path_reltoabs( esc_attr( get_post_meta( $post->ID, 'Thumbnail', $single = true ) ) ) ); } } return $thumb_array; } } if ( ! function_exists( 'et_grab_image_setting' ) ) : /** * Filterable "Grab the first post image" setting. * "Grab the first post image" needs to be filterable so it can be disabled forcefully. * It uses et_first_image() which uses apply_filters( 'the_content' ) which could cause * a conflict with third party plugin which extensively uses 'the_content' filter (ie. BuddyPress) * @return bool */ function et_grab_image_setting() { global $shortname; // Force disable "Grab the first post image" in BuddyPress component page $is_buddypress_component = function_exists( 'bp_current_component' ) && bp_current_component(); $setting = 'on' === et_get_option( "{$shortname}_grab_image" ) && ! $is_buddypress_component; return apply_filters( 'et_grab_image_setting', $setting ); } endif; /* this function prints thumbnail from Post Thumbnail or Custom field or First post image */ if ( ! function_exists( 'print_thumbnail' ) ) { function print_thumbnail($thumbnail = '', $use_timthumb = true, $alttext = '', $width = 100, $height = 100, $class = '', $echoout = true, $forstyle = false, $resize = true, $post='', $et_post_id = '' ) { if ( is_array( $thumbnail ) ) { extract( $thumbnail ); } if ( empty( $post ) ) global $post, $et_theme_image_sizes; $output = ''; $raw = false; $thumbnail_orig = $thumbnail; $et_post_id = ! empty( $et_post_id ) ? (int) $et_post_id : $post->ID; if ( has_post_thumbnail( $et_post_id ) ) { $thumb_array['use_timthumb'] = false; $image_size_name = $width . 'x' . $height; $et_size = isset( $et_theme_image_sizes ) && array_key_exists( $image_size_name, $et_theme_image_sizes ) ? $et_theme_image_sizes[$image_size_name] : array( $width, $height ); $et_attachment_image_attributes = wp_get_attachment_image_src( get_post_thumbnail_id( $et_post_id ), $et_size ); $thumbnail = $et_attachment_image_attributes[0]; } else { $thumbnail = et_multisite_thumbnail( $thumbnail ); $cropPosition = ''; $allow_new_thumb_method = false; $new_method = true; $new_method_thumb = ''; $external_source = false; $allow_new_thumb_method = !$external_source && $new_method && empty( $cropPosition ); if ( $allow_new_thumb_method && !empty( $thumbnail ) ) { if ( 'data:image' === substr( $thumbnail, 0, 10 ) ) { $new_method_thumb = $thumbnail; $raw = true; } else { $et_crop = get_post_meta( $post->ID, 'et_nocrop', true ); $et_crop = empty( $et_crop ) ? true : false; $new_method_thumb = et_resize_image( et_path_reltoabs( $thumbnail ), $width, $height, $et_crop ); if ( is_wp_error( $new_method_thumb ) ) { $new_method_thumb = ''; } } } $thumbnail = $new_method_thumb; } if ( false === $forstyle && $resize ) { if ( $width < 480 && et_is_responsive_images_enabled() && ! $raw ) { $output = sprintf( '%2$s', esc_url( $thumbnail ), esc_attr( wp_strip_all_tags( $alttext ) ), empty( $class ) ? '' : esc_attr( $class ), $thumbnail_orig . ' 479w, ' . $thumbnail . ' 480w', '(max-width:479px) 479px, 100vw', apply_filters( 'et_print_thumbnail_dimensions', ' width="' . esc_attr( $width ) . '" height="' . esc_attr( $height ) . '"' ) ); } else { $output = sprintf( '%2$s', $raw ? $thumbnail : esc_url( $thumbnail ), esc_attr( wp_strip_all_tags( $alttext ) ), empty( $class ) ? '' : esc_attr( $class ), apply_filters( 'et_print_thumbnail_dimensions', ' width="' . esc_attr( $width ) . '" height="' . esc_attr( $height ) . '"' ) ); if ( ! $raw ) { $output = et_image_add_srcset_and_sizes( $output ); } } } else { $output = $thumbnail; } if ($echoout) echo et_core_intentionally_unescaped( $output, 'html' ); else return $output; } } if ( ! function_exists( 'et_new_thumb_resize' ) ) { function et_new_thumb_resize( $thumbnail, $width, $height, $alt='', $forstyle = false ){ global $shortname; $new_method = true; $new_method_thumb = ''; $external_source = false; $allow_new_thumb_method = !$external_source && $new_method; if ( $allow_new_thumb_method && ! empty( $thumbnail ) ) { $et_crop = true; $new_method_thumb = et_resize_image( $thumbnail, $width, $height, $et_crop ); if ( is_wp_error( $new_method_thumb ) ) $new_method_thumb = ''; } $thumb = esc_attr( $new_method_thumb ); // Bail early when $forstyle argument is true. if ( $forstyle ) { return $thumb; } $output = sprintf( '%2$s', esc_url( $thumb ), esc_attr( $alt ), esc_attr( $width ), esc_attr( $height ) ); return et_image_add_srcset_and_sizes( $output ); } } if ( ! function_exists( 'et_multisite_thumbnail' ) ) { function et_multisite_thumbnail( $thumbnail = '' ) { // do nothing if it's not a Multisite installation or current site is the main one if ( is_main_site() ) return $thumbnail; # get the real image url preg_match( '#([_0-9a-zA-Z-]+/)?files/(.+)#', $thumbnail, $matches ); if ( isset( $matches[2] ) ) { $file = rtrim( BLOGUPLOADDIR, '/' ) . '/' . str_replace( '..', '', $matches[2] ); if ( is_file( $file ) ) $thumbnail = str_replace( ABSPATH, trailingslashit( get_site_url( 1 ) ), $file ); else $thumbnail = ''; } return $thumbnail; } } if ( ! function_exists( 'et_is_portrait' ) ) { function et_is_portrait($imageurl, $post='', $ignore_cfields = false){ if ( empty( $post ) ) global $post; if ( get_post_meta( $post->ID, 'et_disable_portrait', true ) === '1' ) return false; if ( !$ignore_cfields ) { if ( get_post_meta( $post->ID, 'et_imagetype', true ) === 'l' ) return false; if ( get_post_meta( $post->ID, 'et_imagetype', true ) === 'p' ) return true; } $imageurl = et_path_reltoabs( et_multisite_thumbnail( $imageurl ) ); $et_thumb_size = @getimagesize( $imageurl ); if ( empty( $et_thumb_size ) ) { $et_thumb_size = @getimagesize( str_replace( WP_CONTENT_URL, WP_CONTENT_DIR, $imageurl ) ); if ( empty( $et_thumb_size ) ) return false; } $et_thumb_width = $et_thumb_size[0]; $et_thumb_height = $et_thumb_size[1]; $result = ($et_thumb_width < $et_thumb_height) ? true : false; return $result; } } if ( ! function_exists( 'et_path_reltoabs' ) ) { function et_path_reltoabs( $imageurl ){ if ( strpos( strtolower( $imageurl ), 'http://' ) !== false || strpos( strtolower( $imageurl ), 'https://' ) !== false ) return $imageurl; if ( strpos( strtolower( $imageurl ), $_SERVER['HTTP_HOST'] ) !== false ) return $imageurl; else { $imageurl = esc_url( apply_filters( 'et_path_relative_image', site_url() . '/' ) . $imageurl ); } return $imageurl; } } if ( ! function_exists( 'in_subcat' ) ) { function in_subcat($blogcat,$current_cat='') { $in_subcategory = false; if (cat_is_ancestor_of( $blogcat, $current_cat ) || $blogcat === $current_cat) $in_subcategory = true; return $in_subcategory; } } if ( ! function_exists( 'show_page_menu' ) ) { function show_page_menu($customClass = 'nav clearfix', $addUlContainer = true, $addHomeLink = true){ global $shortname, $themename, $exclude_pages, $strdepth, $page_menu, $is_footer; //excluded pages if ( $menupages = et_get_option( $shortname.'_menupages' ) ) { $exclude_pages = is_array( $menupages ) ? implode( ',', $menupages ) : ''; } //dropdown for pages $strdepth = ''; if ( et_get_option( $shortname.'_enable_dropdowns' ) === 'on' ) { $strdepth = "depth=".et_get_option( $shortname.'_tiers_shown_pages' ); } if ( empty( $strdepth ) ) { $strdepth = "depth=1"; } if ( $is_footer ) { $strdepth = "depth=1"; $strdepth2 = $strdepth; } $page_menu = wp_list_pages( "sort_column=".et_get_option( $shortname.'_sort_pages' )."&sort_order=".et_get_option( $shortname.'_order_page' )."&".$strdepth."&exclude=".$exclude_pages."&title_li=&echo=0" ); if ( $addUlContainer ) echo '