コード例 #1
2
    function shortcode_callback($atts, $content = null, $function_name)
    {
        /**
         * Cached $wp_filter so it can be restored at the end of the callback.
         * This is needed because this callback uses the_content filter / calls a function
         * which uses the_content filter. WordPress doesn't support nested filter
         */
        global $wp_filter;
        $wp_filter_cache = $wp_filter;
        $module_id = $this->shortcode_atts['module_id'];
        $module_class = $this->shortcode_atts['module_class'];
        $show_arrows = $this->shortcode_atts['show_arrows'];
        $show_pagination = $this->shortcode_atts['show_pagination'];
        $parallax = $this->shortcode_atts['parallax'];
        $parallax_method = $this->shortcode_atts['parallax_method'];
        $auto = $this->shortcode_atts['auto'];
        $auto_speed = $this->shortcode_atts['auto_speed'];
        $auto_ignore_hover = $this->shortcode_atts['auto_ignore_hover'];
        $top_padding = $this->shortcode_atts['top_padding'];
        $body_font_size = $this->shortcode_atts['body_font_size'];
        $bottom_padding = $this->shortcode_atts['bottom_padding'];
        $remove_inner_shadow = $this->shortcode_atts['remove_inner_shadow'];
        $hide_content_on_mobile = $this->shortcode_atts['hide_content_on_mobile'];
        $hide_cta_on_mobile = $this->shortcode_atts['hide_cta_on_mobile'];
        $show_image_video_mobile = $this->shortcode_atts['show_image_video_mobile'];
        $background_position = $this->shortcode_atts['background_position'];
        $background_size = $this->shortcode_atts['background_size'];
        $posts_number = $this->shortcode_atts['posts_number'];
        $include_categories = $this->shortcode_atts['include_categories'];
        $show_more_button = $this->shortcode_atts['show_more_button'];
        $more_text = $this->shortcode_atts['more_text'];
        $content_source = $this->shortcode_atts['content_source'];
        $background_color = $this->shortcode_atts['background_color'];
        $show_image = $this->shortcode_atts['show_image'];
        $image_placement = $this->shortcode_atts['image_placement'];
        $background_image = $this->shortcode_atts['background_image'];
        $background_layout = $this->shortcode_atts['background_layout'];
        $use_bg_overlay = $this->shortcode_atts['use_bg_overlay'];
        $bg_overlay_color = $this->shortcode_atts['bg_overlay_color'];
        $use_text_overlay = $this->shortcode_atts['use_text_overlay'];
        $text_overlay_color = $this->shortcode_atts['text_overlay_color'];
        $orderby = $this->shortcode_atts['orderby'];
        $show_meta = $this->shortcode_atts['show_meta'];
        $button_custom = $this->shortcode_atts['custom_button'];
        $custom_icon = $this->shortcode_atts['button_icon'];
        $use_manual_excerpt = $this->shortcode_atts['use_manual_excerpt'];
        $excerpt_length = $this->shortcode_atts['excerpt_length'];
        $text_border_radius = $this->shortcode_atts['text_border_radius'];
        $dot_nav_custom_color = $this->shortcode_atts['dot_nav_custom_color'];
        $arrows_custom_color = $this->shortcode_atts['arrows_custom_color'];
        $top_padding_tablet = $this->shortcode_atts['top_padding_tablet'];
        $top_padding_phone = $this->shortcode_atts['top_padding_phone'];
        $bottom_padding_tablet = $this->shortcode_atts['bottom_padding_tablet'];
        $bottom_padding_phone = $this->shortcode_atts['bottom_padding_phone'];
        $module_class = ET_Builder_Element::add_module_order_class($module_class, $function_name);
        $hide_on_mobile_class = self::HIDE_ON_MOBILE;
        if ('' !== $top_padding || '' !== $top_padding_tablet || '' !== $top_padding_phone) {
            $padding_values = array('desktop' => $top_padding, 'tablet' => $top_padding_tablet, 'phone' => $top_padding_phone);
            et_pb_generate_responsive_css($padding_values, '%%order_class%% .et_pb_slide_description', 'padding-top', $function_name);
        }
        if ('' !== $bottom_padding || '' !== $bottom_padding_tablet || '' !== $bottom_padding_phone) {
            $padding_values = array('desktop' => $bottom_padding, 'tablet' => $bottom_padding_tablet, 'phone' => $bottom_padding_phone);
            et_pb_generate_responsive_css($padding_values, '%%order_class%% .et_pb_slide_description', 'padding-bottom', $function_name);
        }
        if ('' !== $bottom_padding || '' !== $top_padding) {
            ET_Builder_Module::set_style($function_name, array('selector' => '%%order_class%% .et_pb_slide_description', 'declaration' => 'padding-right: 0; padding-left: 0;'));
        }
        if ('default' !== $background_position && 'off' === $parallax) {
            $processed_position = str_replace('_', ' ', $background_position);
            ET_Builder_Module::set_style($function_name, array('selector' => '%%order_class%% .et_pb_slide', 'declaration' => sprintf('background-position: %1$s;', esc_html($processed_position))));
        }
        if ('default' !== $background_size && 'off' === $parallax) {
            ET_Builder_Module::set_style($function_name, array('selector' => '%%order_class%% .et_pb_slide', 'declaration' => sprintf('-moz-background-size: %1$s;
					-webkit-background-size: %1$s;
					background-size: %1$s;', esc_html($background_size))));
            if ('initial' === $background_size) {
                ET_Builder_Module::set_style($function_name, array('selector' => 'body.ie %%order_class%% .et_pb_slide', 'declaration' => sprintf('-moz-background-size: %1$s;
						-webkit-background-size: %1$s;
						background-size: %1$s;', 'auto')));
            }
        }
        if ('' !== $background_color) {
            ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%%.et_pb_post_slider', 'declaration' => sprintf('background-color: %1$s;', esc_html($background_color))));
        }
        if ('' !== $background_image) {
            ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%%, %%order_class%%.et_pb_bg_layout_dark, %%order_class%%.et_pb_bg_layout_light', 'declaration' => sprintf('background-image: url(%1$s);', esc_url($background_image))));
        }
        if ('on' === $use_bg_overlay && '' !== $bg_overlay_color) {
            ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%% .et_pb_slide .et_pb_slide_overlay_container', 'declaration' => sprintf('background-color: %1$s;', esc_html($bg_overlay_color))));
        }
        if ('on' === $use_text_overlay && '' !== $text_overlay_color) {
            ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%% .et_pb_slide .et_pb_slide_title, %%order_class%% .et_pb_slide .et_pb_slide_content', 'declaration' => sprintf('background-color: %1$s;', esc_html($text_overlay_color))));
        }
        if ('' !== $text_border_radius) {
            $border_radius_value = et_builder_process_range_value($text_border_radius);
            ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%%.et_pb_slider_with_text_overlay h2.et_pb_slide_title', 'declaration' => sprintf('-webkit-border-top-left-radius: %1$s;
					-webkit-border-top-right-radius: %1$s;
					-moz-border-radius-topleft: %1$s;
					-moz-border-radius-topright: %1$s;
					border-top-left-radius: %1$s;
					border-top-right-radius: %1$s;', esc_html($border_radius_value))));
            ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%%.et_pb_slider_with_text_overlay .et_pb_slide_content', 'declaration' => sprintf('-webkit-border-bottom-right-radius: %1$s;
					-webkit-border-bottom-left-radius: %1$s;
					-moz-border-radius-bottomright: %1$s;
					-moz-border-radius-bottomleft: %1$s;
					border-bottom-right-radius: %1$s;
					border-bottom-left-radius: %1$s;', esc_html($border_radius_value))));
        }
        $fullwidth = 'et_pb_fullwidth_post_slider' === $function_name ? 'on' : 'off';
        $class = '';
        $class .= 'off' === $fullwidth ? ' et_pb_slider_fullwidth_off' : '';
        $class .= 'off' === $show_arrows ? ' et_pb_slider_no_arrows' : '';
        $class .= 'off' === $show_pagination ? ' et_pb_slider_no_pagination' : '';
        $class .= 'on' === $parallax ? ' et_pb_slider_parallax' : '';
        $class .= 'on' === $auto ? ' et_slider_auto et_slider_speed_' . esc_attr($auto_speed) : '';
        $class .= 'on' === $auto_ignore_hover ? ' et_slider_auto_ignore_hover' : '';
        $class .= 'on' === $remove_inner_shadow ? ' et_pb_slider_no_shadow' : '';
        $class .= 'on' === $show_image_video_mobile ? ' et_pb_slider_show_image' : '';
        $class .= ' et_pb_post_slider_image_' . $image_placement;
        $class .= 'on' === $use_bg_overlay ? ' et_pb_slider_with_overlay' : '';
        $class .= 'on' === $use_text_overlay ? ' et_pb_slider_with_text_overlay' : '';
        $data_dot_nav_custom_color = '' !== $dot_nav_custom_color ? sprintf(' data-dots_color="%1$s"', esc_attr($dot_nav_custom_color)) : '';
        $data_arrows_custom_color = '' !== $arrows_custom_color ? sprintf(' data-arrows_color="%1$s"', esc_attr($arrows_custom_color)) : '';
        $args = array('posts_per_page' => (int) $posts_number);
        if ('' !== $include_categories) {
            $args['cat'] = $include_categories;
        }
        if ('date_desc' !== $orderby) {
            switch ($orderby) {
                case 'date_asc':
                    $args['orderby'] = 'date';
                    $args['order'] = 'ASC';
                    break;
                case 'title_asc':
                    $args['orderby'] = 'title';
                    $args['order'] = 'ASC';
                    break;
                case 'title_desc':
                    $args['orderby'] = 'title';
                    $args['order'] = 'DESC';
                    break;
                case 'rand':
                    $args['orderby'] = 'rand';
                    break;
            }
        }
        ob_start();
        query_posts($args);
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                $slide_class = 'off' !== $show_image && in_array($image_placement, array('left', 'right')) && has_post_thumbnail() ? ' et_pb_slide_with_image' : '';
                $slide_class .= " et_pb_bg_layout_{$background_layout}";
                ?>
			<div class="et_pb_slide et_pb_media_alignment_center<?php 
                echo esc_attr($slide_class);
                ?>
" <?php 
                if ('on' !== $parallax && 'off' !== $show_image && 'background' === $image_placement) {
                    printf('style="background-image:url(%1$s)"', esc_url(wp_get_attachment_url(get_post_thumbnail_id())));
                }
                echo $data_dot_nav_custom_color;
                echo $data_arrows_custom_color;
                ?>
>
				<?php 
                if ('on' === $parallax && 'off' !== $show_image && 'background' === $image_placement) {
                    ?>
					<div class="et_parallax_bg<?php 
                    if ('off' === $parallax_method) {
                        echo ' et_pb_parallax_css';
                    }
                    ?>
" style="background-image: url(<?php 
                    echo esc_url(wp_get_attachment_url(get_post_thumbnail_id()));
                    ?>
);"></div>
				<?php 
                }
                ?>
				<?php 
                if ('on' === $use_bg_overlay) {
                    ?>
					<div class="et_pb_slide_overlay_container"></div>
				<?php 
                }
                ?>
				<div class="et_pb_container clearfix">
					<?php 
                if ('off' !== $show_image && has_post_thumbnail() && !in_array($image_placement, array('background', 'bottom'))) {
                    ?>
						<div class="et_pb_slide_image">
							<?php 
                    the_post_thumbnail();
                    ?>
						</div>
					<?php 
                }
                ?>
					<div class="et_pb_slide_description">
						<h2 class="et_pb_slide_title"><a href="<?php 
                esc_url(the_permalink());
                ?>
"><?php 
                the_title();
                ?>
</a></h2>
						<div class="et_pb_slide_content <?php 
                if ('on' === $hide_content_on_mobile) {
                    echo esc_attr($hide_on_mobile_class);
                }
                ?>
">
							<?php 
                if ('off' !== $show_meta) {
                    printf('<p class="post-meta">%1$s | %2$s | %3$s | %4$s</p>', et_get_safe_localization(sprintf(__('by %s', 'et_builder'), '<span class="author vcard">' . et_pb_get_the_author_posts_link() . '</span>')), et_get_safe_localization(sprintf(__('%s', 'et_builder'), '<span class="published">' . esc_html(get_the_date()) . '</span>')), get_the_category_list(', '), sprintf(esc_html(_nx('1 Comment', '%s Comments', get_comments_number(), 'number of comments', 'et_builder')), number_format_i18n(get_comments_number())));
                }
                ?>
							<?php 
                $post_content = get_the_content();
                // do not display the content if it contains Blog, Post Slider, Fullwidth Post Slider, or Portfolio modules to avoid infinite loops
                if (!has_shortcode($post_content, 'et_pb_blog') && !has_shortcode($post_content, 'et_pb_portfolio') && !has_shortcode($post_content, 'et_pb_post_slider') && !has_shortcode($post_content, 'et_pb_fullwidth_post_slider')) {
                    if ('on' === $content_source) {
                        global $more;
                        $post_content = et_strip_shortcodes($post_content);
                        // page builder doesn't support more tag, so display the_content() in case of post made with page builder
                        if (et_pb_is_pagebuilder_used(get_the_ID())) {
                            $more = 1;
                            echo apply_filters('the_content', $post_content);
                        } else {
                            $more = null;
                            echo apply_filters('the_content', et_strip_shortcodes(get_the_content(esc_html__('read more...', 'et_builder'))));
                        }
                    } else {
                        if (has_excerpt() && 'off' !== $use_manual_excerpt) {
                            the_excerpt();
                        } else {
                            truncate_post(intval($excerpt_length), true, '', true);
                        }
                    }
                } else {
                    if (has_excerpt()) {
                        the_excerpt();
                    }
                }
                ?>
						</div>
						<?php 
                if ('off' !== $show_more_button && '' !== $more_text) {
                    printf('<a href="%1$s" class="et_pb_more_button et_pb_button%4$s%5$s"%3$s>%2$s</a>', esc_url(get_permalink()), esc_html($more_text), '' !== $custom_icon && 'on' === $button_custom ? sprintf(' data-icon="%1$s"', esc_attr(et_pb_process_font_icon($custom_icon))) : '', '' !== $custom_icon && 'on' === $button_custom ? ' et_pb_custom_button_icon' : '', 'on' === $hide_cta_on_mobile ? esc_attr(" {$hide_on_mobile_class}") : '');
                }
                ?>
					</div> <!-- .et_pb_slide_description -->
					<?php 
                if ('off' !== $show_image && has_post_thumbnail() && 'bottom' === $image_placement) {
                    ?>
						<div class="et_pb_slide_image">
							<?php 
                    the_post_thumbnail();
                    ?>
						</div>
					<?php 
                }
                ?>
				</div> <!-- .et_pb_container -->
			</div> <!-- .et_pb_slide -->
		<?php 
            }
            // end while
            wp_reset_query();
        }
        // end if
        $content = ob_get_contents();
        ob_end_clean();
        $output = sprintf('<div%3$s class="et_pb_module et_pb_slider et_pb_post_slider%1$s%4$s">
				<div class="et_pb_slides">
					%2$s
				</div> <!-- .et_pb_slides -->
			</div> <!-- .et_pb_slider -->
			', $class, $content, '' !== $module_id ? sprintf(' id="%1$s"', esc_attr($module_id)) : '', '' !== $module_class ? sprintf(' %1$s', esc_attr($module_class)) : '');
        // Restore $wp_filter
        $wp_filter = $wp_filter_cache;
        unset($wp_filter_cache);
        return $output;
    }
コード例 #2
0
ファイル: functions.php プロジェクト: welearncodes/traktern
function et_theme_epanel_reminder()
{
    global $shortname, $themename;
    $documentation_url = 'http://www.elegantthemes.com/gallery/divi/readme.html';
    $documentation_option_name = $shortname . '_2_4_documentation_message';
    if (false === et_get_option($shortname . '_logo') && false === et_get_option($documentation_option_name)) {
        $message = sprintf(et_get_safe_localization(__('Welcome to Divi! Before diving in to your new theme, please visit the <a style="color: #fff; font-weight: bold;" href="%1$s" target="_blank">Divi Documentation</a> page for access to dozens of in-depth tutorials.', $themename)), esc_url($documentation_url));
        printf('<div class="notice is-dismissible" style="background-color: #6C2EB9; color: #fff; border-left: none;">
				<p>%1$s</p>
			</div>', $message);
        et_update_option($documentation_option_name, 'triggered');
    }
}
コード例 #3
0
function et_pb_add_widget_area()
{
    if (!wp_verify_nonce($_POST['et_admin_load_nonce'], 'et_admin_load_nonce')) {
        die(-1);
    }
    if (!current_user_can('manage_options')) {
        die(-1);
    }
    $et_pb_widgets = get_theme_mod('et_pb_widgets');
    $number = $et_pb_widgets ? intval($et_pb_widgets['number']) + 1 : 1;
    $et_widget_area_name = sanitize_text_field($_POST['et_widget_area_name']);
    $et_pb_widgets['areas']['et_pb_widget_area_' . $number] = $et_widget_area_name;
    $et_pb_widgets['number'] = $number;
    set_theme_mod('et_pb_widgets', $et_pb_widgets);
    et_pb_force_regenerate_templates();
    printf(et_get_safe_localization(__('<strong>%1$s</strong> widget area has been created. You can create more areas, once you finish update the page to see all the areas.', 'et_builder')), esc_html($et_widget_area_name));
    die;
}
コード例 #4
0
 function get_fields()
 {
     $fields = array('background_image' => array('label' => esc_html__('Background Image', 'et_builder'), 'type' => 'upload', 'option_category' => 'basic_option', 'upload_button_text' => esc_attr__('Upload an image', 'et_builder'), 'choose_text' => esc_attr__('Choose a Background Image', 'et_builder'), 'update_text' => esc_attr__('Set As Background', 'et_builder'), 'description' => esc_html__('If defined, this image will be used as the background for this module. To remove a background image, simply delete the URL from the settings field.', 'et_builder')), 'transparent_background' => array('label' => esc_html__('Transparent Background Color', 'et_builder'), 'type' => 'yes_no_button', 'option_category' => 'color_option', 'options' => array('off' => esc_html__('No', 'et_builder'), 'on' => esc_html__('Yes', 'et_builder')), 'affects' => array('background_color'), 'description' => esc_html__('Enabling this option will remove the background color of this section, allowing the website background color or background image to show through.', 'et_builder')), 'background_color' => array('label' => esc_html__('Background Color', 'et_builder'), 'type' => 'color-alpha', 'default' => '#ffffff', 'depends_show_if' => 'off', 'description' => esc_html__('Define a custom background color for your module, or leave blank to use the default color.', 'et_builder'), 'additional_code' => '<span class="et-pb-reset-setting reset-default-color" style="display: none;"></span>'), 'background_video_mp4' => array('label' => esc_html__('Background Video MP4', 'et_builder'), 'type' => 'upload', 'option_category' => 'basic_option', 'data_type' => 'video', 'upload_button_text' => esc_attr__('Upload a video', 'et_builder'), 'choose_text' => esc_attr__('Choose a Background Video MP4 File', 'et_builder'), 'update_text' => esc_attr__('Set As Background Video', 'et_builder'), 'description' => et_get_safe_localization(__('All videos should be uploaded in both .MP4 .WEBM formats to ensure maximum compatibility in all browsers. Upload the .MP4 version here. <b>Important Note: Video backgrounds are disabled from mobile devices. Instead, your background image will be used. For this reason, you should define both a background image and a background video to ensure best results.</b>', 'et_builder')), 'computed_affects' => array('__video_background')), 'background_video_webm' => array('label' => esc_html__('Background Video Webm', 'et_builder'), 'type' => 'upload', 'option_category' => 'basic_option', 'data_type' => 'video', 'upload_button_text' => esc_attr__('Upload a video', 'et_builder'), 'choose_text' => esc_attr__('Choose a Background Video WEBM File', 'et_builder'), 'update_text' => esc_attr__('Set As Background Video', 'et_builder'), 'description' => et_get_safe_localization(__('All videos should be uploaded in both .MP4 .WEBM formats to ensure maximum compatibility in all browsers. Upload the .WEBM version here. <b>Important Note: Video backgrounds are disabled from mobile devices. Instead, your background image will be used. For this reason, you should define both a background image and a background video to ensure best results.</b>', 'et_builder')), 'computed_affects' => array('__video_background')), 'background_video_width' => array('label' => esc_html__('Background Video Width', 'et_builder'), 'type' => 'text', 'option_category' => 'basic_option', 'description' => esc_html__('In order for videos to be sized correctly, you must input the exact width (in pixels) of your video here.', 'et_builder'), 'computed_affects' => array('__video_background')), 'background_video_height' => array('label' => esc_html__('Background Video Height', 'et_builder'), 'type' => 'text', 'option_category' => 'basic_option', 'description' => esc_html__('In order for videos to be sized correctly, you must input the exact height (in pixels) of your video here.', 'et_builder'), 'computed_affects' => array('__video_background')), 'allow_player_pause' => array('label' => esc_html__('Pause Video', 'et_builder'), 'type' => 'yes_no_button', 'option_category' => 'configuration', 'options' => array('off' => esc_html__('No', 'et_builder'), 'on' => esc_html__('Yes', 'et_builder')), 'description' => esc_html__('Allow video to be paused by other players when they begin playing', 'et_builder')), 'inner_shadow' => array('label' => esc_html__('Show Inner Shadow', 'et_builder'), 'type' => 'yes_no_button', 'option_category' => 'configuration', 'options' => array('off' => esc_html__('No', 'et_builder'), 'on' => esc_html__('Yes', 'et_builder')), 'description' => esc_html__('Here you can select whether or not your section has an inner shadow. This can look great when you have colored backgrounds or background images.', 'et_builder')), 'parallax' => array('label' => esc_html__('Use Parallax Effect', 'et_builder'), 'type' => 'yes_no_button', 'option_category' => 'configuration', 'options' => array('off' => esc_html__('No', 'et_builder'), 'on' => esc_html__('Yes', 'et_builder')), 'affects' => array('parallax_method'), 'description' => esc_html__('If enabled, your background image will stay fixed as your scroll, creating a fun parallax-like effect.', 'et_builder')), 'parallax_method' => array('label' => esc_html__('Parallax Method', 'et_builder'), 'type' => 'select', 'option_category' => 'configuration', 'options' => array('off' => esc_html__('CSS', 'et_builder'), 'on' => esc_html__('True Parallax', 'et_builder')), 'depends_show_if' => 'on', 'description' => esc_html__('Define the method, used for the parallax effect.', 'et_builder')), 'custom_padding' => array('label' => esc_html__('Custom Padding', 'et_builder'), 'type' => 'custom_padding', 'mobile_options' => true, 'option_category' => 'layout', 'description' => esc_html__('Adjust padding to specific values, or leave blank to use the default padding.', 'et_builder')), 'custom_padding_tablet' => array('type' => 'skip'), 'custom_padding_phone' => array('type' => 'skip'), 'padding_mobile' => array('label' => esc_html__('Keep Custom Padding on Mobile', 'et_builder'), 'type' => 'yes_no_button', 'option_category' => 'layout', 'options' => array('off' => esc_html__('No', 'et_builder'), 'on' => esc_html__('Yes', 'et_builder')), 'description' => esc_html__('Allow custom padding to be retained on mobile screens', 'et_builder')), 'make_fullwidth' => array('label' => esc_html__('Make This Section Fullwidth', 'et_builder'), 'type' => 'yes_no_button', 'option_category' => 'layout', 'options' => array('off' => esc_html__('No', 'et_builder'), 'on' => esc_html__('Yes', 'et_builder')), 'depends_show_if' => 'off', 'tab_slug' => 'advanced'), 'use_custom_width' => array('label' => esc_html__('Use Custom Width', 'et_builder'), 'type' => 'yes_no_button', 'option_category' => 'layout', 'options' => array('off' => esc_html__('No', 'et_builder'), 'on' => esc_html__('Yes', 'et_builder')), 'affects' => array('make_fullwidth', 'custom_width', 'width_unit'), 'tab_slug' => 'advanced'), 'width_unit' => array('label' => esc_html__('Unit', 'et_builder'), 'type' => 'yes_no_button', 'option_category' => 'layout', 'options' => array('on' => esc_html__('px', 'et_builder'), 'off' => '%'), 'button_options' => array('button_type' => 'equal'), 'depends_show_if' => 'on', 'affects' => array('custom_width_px', 'custom_width_percent'), 'tab_slug' => 'advanced'), 'custom_width_px' => array('label' => esc_html__('Custom Width', 'et_builder'), 'type' => 'range', 'option_category' => 'layout', 'depends_show_if' => 'on', 'range_settings' => array('min' => 500, 'max' => 2600, 'step' => 1), 'tab_slug' => 'advanced'), 'custom_width_percent' => array('label' => esc_html__('Custom Width', 'et_builder'), 'type' => 'range', 'option_category' => 'layout', 'depends_show_if' => 'off', 'range_settings' => array('min' => 0, 'max' => 100, 'step' => 1), 'tab_slug' => 'advanced', 'validate_unit' => false), 'make_equal' => array('label' => esc_html__('Equalize Column Heights', 'et_builder'), 'type' => 'yes_no_button', 'option_category' => 'layout', 'options' => array('off' => esc_html__('No', 'et_builder'), 'on' => esc_html__('Yes', 'et_builder')), 'tab_slug' => 'advanced'), 'use_custom_gutter' => array('label' => esc_html__('Use Custom Gutter Width', 'et_builder'), 'type' => 'yes_no_button', 'option_category' => 'layout', 'options' => array('off' => esc_html__('No', 'et_builder'), 'on' => esc_html__('Yes', 'et_builder')), 'affects' => array('gutter_width'), 'tab_slug' => 'advanced'), 'gutter_width' => array('label' => esc_html__('Gutter Width', 'et_builder'), 'type' => 'range', 'option_category' => 'layout', 'range_settings' => array('min' => 1, 'max' => 4, 'step' => 1), 'depends_show_if' => 'on', 'tab_slug' => 'advanced', 'validate_unit' => false), 'columns' => array('type' => 'column_settings', 'option_category' => 'configuration', 'tab_slug' => 'advanced'), 'fullwidth' => array('type' => 'skip'), 'specialty' => array('type' => 'skip'), 'parallax_1' => array('type' => 'skip'), 'parallax_2' => array('type' => 'skip'), 'parallax_3' => array('type' => 'skip'), 'parallax_method_1' => array('type' => 'skip'), 'parallax_method_2' => array('type' => 'skip'), 'parallax_method_3' => array('type' => 'skip'), 'background_color_1' => array('type' => 'skip'), 'background_color_2' => array('type' => 'skip'), 'background_color_3' => array('type' => 'skip'), 'bg_img_1' => array('type' => 'skip'), 'bg_img_2' => array('type' => 'skip'), 'bg_img_3' => array('type' => 'skip'), 'padding_top_1' => array('type' => 'skip'), 'padding_right_1' => array('type' => 'skip'), 'padding_bottom_1' => array('type' => 'skip'), 'padding_left_1' => array('type' => 'skip'), 'padding_top_2' => array('type' => 'skip'), 'padding_right_2' => array('type' => 'skip'), 'padding_bottom_2' => array('type' => 'skip'), 'padding_left_2' => array('type' => 'skip'), 'padding_top_3' => array('type' => 'skip'), 'padding_right_3' => array('type' => 'skip'), 'padding_bottom_3' => array('type' => 'skip'), 'padding_left_3' => array('type' => 'skip'), 'padding_1_tablet' => array('type' => 'skip'), 'padding_2_tablet' => array('type' => 'skip'), 'padding_3_tablet' => array('type' => 'skip'), 'padding_1_phone' => array('type' => 'skip'), 'padding_2_phone' => array('type' => 'skip'), 'padding_3_phone' => array('type' => 'skip'), 'module_id_1' => array('type' => 'skip'), 'module_id_2' => array('type' => 'skip'), 'module_id_3' => array('type' => 'skip'), 'module_class_1' => array('type' => 'skip'), 'module_class_2' => array('type' => 'skip'), 'module_class_3' => array('type' => 'skip'), 'custom_css_before_1' => array('type' => 'skip'), 'custom_css_before_2' => array('type' => 'skip'), 'custom_css_before_3' => array('type' => 'skip'), 'custom_css_main_1' => array('type' => 'skip'), 'custom_css_main_2' => array('type' => 'skip'), 'custom_css_main_3' => array('type' => 'skip'), 'custom_css_after_1' => array('type' => 'skip'), 'custom_css_after_2' => array('type' => 'skip'), 'custom_css_after_3' => array('type' => 'skip'), 'columns_css' => array('type' => 'column_settings_css', 'option_category' => 'configuration', 'tab_slug' => 'custom_css', 'priority' => '20'), 'disabled_on' => array('label' => esc_html__('Disable on', 'et_builder'), 'type' => 'multiple_checkboxes', 'options' => array('phone' => esc_html__('Phone', 'et_builder'), 'tablet' => esc_html__('Tablet', 'et_builder'), 'desktop' => esc_html__('Desktop', 'et_builder')), 'additional_att' => 'disable_on', 'option_category' => 'configuration', 'description' => esc_html__('This will disable the module on selected devices', 'et_builder')), 'admin_label' => array('label' => esc_html__('Admin Label', 'et_builder'), 'type' => 'text', 'description' => esc_html__('This will change the label of the section in the builder for easy identification when collapsed.', 'et_builder')), 'module_id' => array('label' => esc_html__('CSS ID', 'et_builder'), 'type' => 'text', 'option_category' => 'configuration', 'tab_slug' => 'custom_css', 'option_class' => 'et_pb_custom_css_regular'), 'module_class' => array('label' => esc_html__('CSS Class', 'et_builder'), 'type' => 'text', 'option_category' => 'configuration', 'tab_slug' => 'custom_css', 'option_class' => 'et_pb_custom_css_regular'), 'columns_css_fields' => array('type' => 'column_settings_css_fields', 'option_category' => 'configuration', 'tab_slug' => 'custom_css'), '__video_background' => array('type' => 'computed', 'computed_callback' => array('ET_Builder_Section', 'get_video_background'), 'computed_depends_on' => array('background_video_mp4', 'background_video_webm', 'background_video_width', 'background_video_height')));
     return $fields;
 }
コード例 #5
0
    function maybe_show_expired_account_notice()
    {
        if (empty($this->options['username']) || empty($this->options['api_key'])) {
            return;
        }
        if ('expired' !== $this->account_status) {
            return;
        }
        printf('<div class="notice notice-warning">
				<p>%1$s</p>
			</div>', et_get_safe_localization(__('Your Elegant Themes subscription has expired. You must <a href="https://www.elegantthemes.com/members-area/" target="_blank">renew your account</a> to regain access to product updates and support. To ensure compatibility and security, it is important to always keep your themes and plugins updated.', 'et-core')));
    }
コード例 #6
0
ファイル: footer.php プロジェクト: welearncodes/traktern
				</div> <!-- #et-footer-nav -->

			<?php 
    }
    ?>

				<div id="footer-bottom">
					<div class="container clearfix">
				<?php 
    if (false !== et_get_option('show_footer_social_icons', true)) {
        get_template_part('includes/social_icons', 'footer');
    }
    ?>

<p id="footer-info"><?php 
    printf(et_get_safe_localization(__('| Designed by %1$s |', 'HSN')), '<a href="https://usn.no" title="Student utvikling">IS G9</a>');
    ?>
</p>
					</div>	<!-- .container -->
				</div>
			</footer> <!-- #main-footer -->
		</div> <!-- #et-main-area -->

<?php 
}
// ! is_page_template( 'page-template-blank.php' )
?>

	</div> <!-- #page-container -->

	<?php 
コード例 #7
0
    function et_build_epanel()
    {
        global $themename, $shortname, $options, $et_disabled_jquery;
        // load theme settings array
        et_load_core_options();
        if (isset($_GET['saved'])) {
            if ($_GET['saved']) {
                echo '<div id="message" class="updated fade"><p><strong>' . esc_html($themename) . ' ' . esc_html__('settings saved.', $themename) . '</strong></p></div>';
            }
        }
        if (isset($_GET['reset'])) {
            if ($_GET['reset']) {
                echo '<div id="message" class="updated fade"><p><strong>' . esc_html($themename) . ' ' . esc_html__('settings reset.', $themename) . '</strong></p></div>';
            }
        }
        ?>

		<div id="wrapper">
		  <div id="panel-wrap">


			<div id="epanel-top">
				<button class="save-button" id="epanel-save-top"><?php 
        esc_html_e('Save Changes', $themename);
        ?>
</button>
			</div>

			<form method="post" id="main_options_form" enctype="multipart/form-data">
				<div id="epanel-wrapper">
					<div id="epanel" class="onload">
						<div id="epanel-content-wrap">
							<div id="epanel-content">
								<div id="epanel-header">
									<h1 id="epanel-title"><?php 
        printf(esc_html__('%s Theme Options', $themename), $themename);
        ?>
</h1>

									<?php 
        global $epanelMainTabs;
        $epanelMainTabs = apply_filters('epanel_page_maintabs', $epanelMainTabs);
        ?>

									<a href="#" class="defaults-button epanel-reset" title="<?php 
        esc_attr_e('Reset to Defaults', $themename);
        ?>
"><span class="label"><?php 
        esc_html_e('Reset to Defaults', $themename);
        ?>
</span></a>
									<?php 
        echo et_core_portability_link('epanel', array('class' => 'defaults-button epanel-portability'));
        ?>
								</div>
								<ul id="epanel-mainmenu">
									<?php 
        if (in_array('general', $epanelMainTabs)) {
            ?>
										<li><a href="#wrap-general"><?php 
            esc_html_e('General', $themename);
            ?>
</a></li>
									<?php 
        }
        ?>
									<?php 
        if (in_array('navigation', $epanelMainTabs)) {
            ?>
										<li><a href="#wrap-navigation"><?php 
            esc_html_e('Navigation', $themename);
            ?>
</a></li>
									<?php 
        }
        ?>
									<?php 
        if (in_array('layout', $epanelMainTabs)) {
            ?>
										<li><a href="#wrap-layout"><?php 
            esc_html_e('Layout', $themename);
            ?>
</a></li>
									<?php 
        }
        ?>
									<?php 
        if (in_array('ad', $epanelMainTabs)) {
            ?>
										<li><a href="#wrap-advertisements"><?php 
            esc_html_e('Ads', $themename);
            ?>
</a></li>
									<?php 
        }
        ?>
									<?php 
        if (in_array('colorization', $epanelMainTabs)) {
            ?>
										<li><a href="#wrap-colorization"><?php 
            esc_html_e('Colorization', $themename);
            ?>
</a></li>
									<?php 
        }
        ?>
									<?php 
        if (in_array('seo', $epanelMainTabs)) {
            ?>
										<li><a href="#wrap-seo"><?php 
            esc_html_e('SEO', $themename);
            ?>
</a></li>
									<?php 
        }
        ?>
									<?php 
        if (in_array('integration', $epanelMainTabs)) {
            ?>
										<li><a href="#wrap-integration"><?php 
            esc_html_e('Integration', $themename);
            ?>
</a></li>
									<?php 
        }
        ?>
									<?php 
        if (in_array('updates', $epanelMainTabs)) {
            ?>
										<li><a href="#wrap-updates"><?php 
            esc_html_e('Updates', $themename);
            ?>
</a></li>
									<?php 
        }
        ?>
									<?php 
        do_action('epanel_render_maintabs', $epanelMainTabs);
        ?>
								</ul><!-- end epanel mainmenu -->

								<?php 
        foreach ($options as $value) {
            if (!empty($value['depends_on'])) {
                // function defined in 'depends on' key returns false, if a setting shouldn't be displayed
                if (!call_user_func($value['depends_on'])) {
                    continue;
                }
            }
            if (!empty($value['id'])) {
                $is_new_global_setting = false;
                $global_setting_main_name = $global_setting_sub_name = '';
                if (isset($value['is_global']) && $value['is_global']) {
                    $is_new_global_setting = true;
                    $global_setting_main_name = isset($value['main_setting_name']) ? sanitize_text_field($value['main_setting_name']) : '';
                    $global_setting_sub_name = isset($value['sub_setting_name']) ? sanitize_text_field($value['sub_setting_name']) : '';
                }
            }
            if (in_array($value['type'], array('text', 'textlimit', 'textarea', 'select', 'checkboxes', 'different_checkboxes', 'colorpicker', 'textcolorpopup', 'upload', 'callback_function', 'et_color_palette', 'password'))) {
                ?>
											<div class="epanel-box">
												<div class="box-title">
													<h3><?php 
                echo esc_html($value['name']);
                ?>
</h3>
													<div class="box-descr">
														<p><?php 
                echo wp_kses($value['desc'], array('a' => array('href' => array(), 'title' => array(), 'target' => array())));
                ?>
</p>
													</div> <!-- end box-desc-content div -->
												</div> <!-- end div box-title -->

												<div class="box-content">

													<?php 
                if (in_array($value['type'], array('text', 'password'))) {
                    ?>

														<?php 
                    $et_input_value = '';
                    $et_input_value = '' != et_get_option($value['id'], '', '', false, $is_new_global_setting, $global_setting_main_name, $global_setting_sub_name) ? et_get_option($value['id'], '', '', false, $is_new_global_setting, $global_setting_main_name, $global_setting_sub_name) : $value['std'];
                    $et_input_value = stripslashes($et_input_value);
                    ?>

														<input name="<?php 
                    echo esc_attr($value['id']);
                    ?>
" id="<?php 
                    echo esc_attr($value['id']);
                    ?>
" type="<?php 
                    echo esc_attr($value['type']);
                    ?>
" value="<?php 
                    echo esc_attr($et_input_value);
                    ?>
" />

													<?php 
                } elseif ('textlimit' == $value['type']) {
                    ?>

														<?php 
                    $et_input_value = '';
                    $et_input_value = '' != et_get_option($value['id'], '', '', false, $is_new_global_setting, $global_setting_main_name, $global_setting_sub_name) ? et_get_option($value['id'], '', '', false, $is_new_global_setting, $global_setting_main_name, $global_setting_sub_name) : $value['std'];
                    $et_input_value = stripslashes($et_input_value);
                    ?>

														<input name="<?php 
                    echo esc_attr($value['id']);
                    ?>
" id="<?php 
                    echo esc_attr($value['id']);
                    ?>
" type="text" maxlength="<?php 
                    echo esc_attr($value['max']);
                    ?>
" size="<?php 
                    echo esc_attr($value['max']);
                    ?>
" value="<?php 
                    echo esc_attr($et_input_value);
                    ?>
" />

													<?php 
                } elseif ('colorpicker' == $value['type']) {
                    ?>

														<div id="colorpickerHolder"></div>

													<?php 
                } elseif ('textcolorpopup' == $value['type']) {
                    ?>

														<?php 
                    $et_input_value = '';
                    $et_input_value = '' != et_get_option($value['id'], '', '', false, $is_new_global_setting, $global_setting_main_name, $global_setting_sub_name) ? et_get_option($value['id'], '', '', false, $is_new_global_setting, $global_setting_main_name, $global_setting_sub_name) : $value['std'];
                    ?>

														<input name="<?php 
                    echo esc_attr($value['id']);
                    ?>
" id="<?php 
                    echo esc_attr($value['id']);
                    ?>
" class="colorpopup" type="text" value="<?php 
                    echo esc_attr($et_input_value);
                    ?>
" />

													<?php 
                } elseif ('textarea' == $value['type']) {
                    ?>

														<?php 
                    $et_textarea_value = '';
                    $et_textarea_value = '' != et_get_option($value['id'], '', '', false, $is_new_global_setting, $global_setting_main_name, $global_setting_sub_name) ? et_get_option($value['id'], '', '', false, $is_new_global_setting, $global_setting_main_name, $global_setting_sub_name) : $value['std'];
                    $et_textarea_value = stripslashes($et_textarea_value);
                    ?>

														<textarea name="<?php 
                    echo esc_attr($value['id']);
                    ?>
" id="<?php 
                    echo esc_attr($value['id']);
                    ?>
"><?php 
                    echo esc_textarea($et_textarea_value);
                    ?>
</textarea>

													<?php 
                } elseif ('upload' == $value['type']) {
                    ?>

													<?php 
                    $et_upload_button_data = isset($value['button_text']) ? sprintf(' data-button_text="%1$s"', esc_attr($value['button_text'])) : '';
                    ?>

														<input id="<?php 
                    echo esc_attr($value['id']);
                    ?>
" class="uploadfield" type="text" size="90" name="<?php 
                    echo esc_attr($value['id']);
                    ?>
" value="<?php 
                    echo esc_url(et_get_option($value['id'], '', '', false, $is_new_global_setting, $global_setting_main_name, $global_setting_sub_name));
                    ?>
" />
														<div class="upload_buttons">
															<span class="upload_image_reset"><?php 
                    esc_html_e('Reset', $themename);
                    ?>
</span>
															<input class="upload_image_button" type="button"<?php 
                    echo $et_upload_button_data;
                    ?>
 value="<?php 
                    esc_attr_e('Upload', $themename);
                    ?>
" />
														</div>

														<div class="clear"></div>

													<?php 
                } elseif ('select' == $value['type']) {
                    ?>

														<select name="<?php 
                    echo esc_attr($value['id']);
                    ?>
" id="<?php 
                    echo esc_attr($value['id']);
                    ?>
">
															<?php 
                    foreach ($value['options'] as $option_key => $option) {
                        ?>
																<?php 
                        $et_select_active = '';
                        $et_use_option_values = isset($value['et_array_for']) && in_array($value['et_array_for'], array('pages', 'categories')) || isset($value['et_save_values']) && $value['et_save_values'] ? true : false;
                        $et_option_db_value = et_get_option($value['id']);
                        if ($et_use_option_values && $et_option_db_value == $option_key || stripslashes($et_option_db_value) == trim(stripslashes($option)) || !$et_option_db_value && isset($value['std']) && stripslashes($option) == stripslashes($value['std'])) {
                            $et_select_active = ' selected="selected"';
                        }
                        ?>
																<option<?php 
                        if ($et_use_option_values) {
                            echo ' value="' . esc_attr($option_key) . '"';
                        }
                        ?>
 <?php 
                        echo $et_select_active;
                        ?>
><?php 
                        echo esc_html(trim($option));
                        ?>
</option>
															<?php 
                    }
                    ?>
														</select>

													<?php 
                } elseif ('checkboxes' == $value['type']) {
                    ?>

														<?php 
                    if (empty($value['options'])) {
                        esc_html_e("You don't have pages", $themename);
                    } else {
                        $i = 1;
                        $className = 'inputs';
                        if (isset($value['excludeDefault']) && $value['excludeDefault'] == 'true') {
                            $className .= ' different';
                        }
                        foreach ($value['options'] as $option) {
                            $checked = "";
                            $class_name_last = 0 == $i % 3 ? ' last' : '';
                            if (et_get_option($value['id'])) {
                                if (in_array($option, et_get_option($value['id']))) {
                                    $checked = "checked=\"checked\"";
                                }
                            }
                            $et_checkboxes_label = $value['id'] . '-' . $option;
                            if ('custom' == $value['usefor']) {
                                $et_helper = (array) $value['helper'];
                                $et_checkboxes_value = $et_helper[$option];
                            } else {
                                if ('taxonomy_terms' == $value['usefor'] && isset($value['taxonomy_name'])) {
                                    $et_checkboxes_term = get_term_by('id', $option, $value['taxonomy_name']);
                                    $et_checkboxes_value = sanitize_text_field($et_checkboxes_term->name);
                                } else {
                                    $et_checkboxes_value = 'pages' == $value['usefor'] ? get_pagename($option) : get_categname($option);
                                }
                            }
                            ?>

																<p class="<?php 
                            echo esc_attr($className . $class_name_last);
                            ?>
">
																	<input type="checkbox" class="usual-checkbox" name="<?php 
                            echo esc_attr($value['id']);
                            ?>
[]" id="<?php 
                            echo esc_attr($et_checkboxes_label);
                            ?>
" value="<?php 
                            echo esc_attr($option);
                            ?>
" <?php 
                            echo esc_html($checked);
                            ?>
 />
																	<label for="<?php 
                            echo esc_attr($et_checkboxes_label);
                            ?>
"><?php 
                            echo esc_html($et_checkboxes_value);
                            ?>
</label>
																</p>

																<?php 
                            $i++;
                        }
                    }
                    ?>
														<br class="clearfix"/>

													<?php 
                } elseif ('different_checkboxes' == $value['type']) {
                    ?>

														<?php 
                    foreach ($value['options'] as $option) {
                        $checked = '';
                        if (et_get_option($value['id']) !== false) {
                            if (in_array($option, et_get_option($value['id']))) {
                                $checked = "checked=\"checked\"";
                            }
                        } elseif (isset($value['std'])) {
                            if (in_array($option, $value['std'])) {
                                $checked = "checked=\"checked\"";
                            }
                        }
                        ?>

															<p class="postinfo <?php 
                        echo esc_attr('postinfo-' . $option);
                        ?>
">
																<input type="checkbox" class="usual-checkbox" name="<?php 
                        echo esc_attr($value['id']);
                        ?>
[]" id="<?php 
                        echo esc_attr($value['id'] . '-' . $option);
                        ?>
" value="<?php 
                        echo esc_attr($option);
                        ?>
" <?php 
                        echo esc_html($checked);
                        ?>
 />
															</p>
														<?php 
                    }
                    ?>
														<br class="clearfix"/>

													<?php 
                } elseif ('callback_function' == $value['type']) {
                    call_user_func($value['function_name']);
                    ?>

													<?php 
                } elseif ('et_color_palette' == $value['type']) {
                    $items_amount = isset($value['items_amount']) ? $value['items_amount'] : 1;
                    $et_input_value = '' !== str_replace('|', '', et_get_option($value['id'], '', '', false, $is_new_global_setting, $global_setting_main_name, $global_setting_sub_name)) ? et_get_option($value['id'], '', '', false, $is_new_global_setting, $global_setting_main_name, $global_setting_sub_name) : $value['std'];
                    ?>
															<div class="et_pb_colorpalette_overview">
														<?php 
                    for ($colorpalette_index = 1; $colorpalette_index <= $items_amount; $colorpalette_index++) {
                        ?>
																<span class="colorpalette-item colorpalette-item-<?php 
                        echo esc_attr($colorpalette_index);
                        ?>
" data-index="<?php 
                        echo esc_attr($colorpalette_index);
                        ?>
"></span>
														<?php 
                    }
                    ?>

															</div>

														<?php 
                    for ($colorpicker_index = 1; $colorpicker_index <= $items_amount; $colorpicker_index++) {
                        ?>
																<div class="colorpalette-colorpicker" data-index="<?php 
                        echo esc_attr($colorpicker_index);
                        ?>
">
																	<input data-index="<?php 
                        echo esc_attr($colorpicker_index);
                        ?>
" type="text" class="input-colorpalette-colorpicker" data-alpha="true" />
																</div>
														<?php 
                    }
                    ?>

														<input name="<?php 
                    echo esc_attr($value['id']);
                    ?>
" id="<?php 
                    echo esc_attr($value['id']);
                    ?>
" class="et_color_palette_main_input" type="hidden" value="<?php 
                    echo esc_attr($et_input_value);
                    ?>
" />

													<?php 
                }
                ?>

												</div> <!-- end box-content div -->
												<span class="box-description"></span>
											</div> <!-- end epanel-box div -->

									<?php 
            } elseif ('checkbox' == $value['type'] || 'checkbox2' == $value['type']) {
                ?>
										<?php 
                $et_box_class = 'checkbox' == $value['type'] ? 'epanel-box-small-1' : 'epanel-box-small-2';
                ?>
										<div class="<?php 
                echo esc_attr('epanel-box ' . $et_box_class);
                ?>
">
											<div class="box-title"><h3><?php 
                echo esc_html($value['name']);
                ?>
</h3>
												<div class="box-descr">
													<p><?php 
                echo wp_kses($value['desc'], array('a' => array('href' => array(), 'title' => array(), 'target' => array())));
                ?>
</p>
												</div> <!-- end box-desc-content div -->
											</div> <!-- end div box-title -->
											<div class="box-content">
												<?php 
                $checked = '';
                if ('' != et_get_option($value['id'])) {
                    if ('on' == et_get_option($value['id'])) {
                        $checked = 'checked="checked"';
                    } else {
                        $checked = '';
                    }
                } else {
                    if ('on' == $value['std']) {
                        $checked = 'checked="checked"';
                    }
                }
                ?>
												<input type="checkbox" class="checkbox yes_no_button" name="<?php 
                echo esc_attr($value['id']);
                ?>
" id="<?php 
                echo esc_attr($value['id']);
                ?>
" <?php 
                echo $checked;
                ?>
 />

											</div> <!-- end box-content div -->
											<span class="box-description"></span>
										</div> <!-- end epanel-box-small div -->

									<?php 
            } elseif ('support' == $value['type']) {
                ?>

										<div class="inner-content">
											<?php 
                include get_template_directory() . "/includes/functions/" . $value['name'] . ".php";
                ?>
										</div>

									<?php 
            } elseif ('contenttab-wrapstart' == $value['type'] || 'subcontent-start' == $value['type']) {
                ?>

										<?php 
                $et_contenttab_class = 'contenttab-wrapstart' == $value['type'] ? 'content-div' : 'tab-content';
                ?>

										<div id="<?php 
                echo esc_attr($value['name']);
                ?>
" class="<?php 
                echo esc_attr($et_contenttab_class);
                ?>
">

									<?php 
            } elseif ('contenttab-wrapend' == $value['type'] || 'subcontent-end' == $value['type']) {
                ?>

										</div> <!-- end <?php 
                echo esc_html($value['name']);
                ?>
 div -->

									<?php 
            } elseif ('subnavtab-start' == $value['type']) {
                ?>

										<ul class="idTabs">

									<?php 
            } elseif ('subnavtab-end' == $value['type']) {
                ?>

										</ul>

									<?php 
            } elseif ('subnav-tab' == $value['type']) {
                ?>

										<li><a href="#<?php 
                echo esc_attr($value['name']);
                ?>
"><span class="pngfix"><?php 
                echo esc_html($value['desc']);
                ?>
</span></a></li>

									<?php 
            } elseif ($value['type'] == "clearfix") {
                ?>

										<div class="clearfix"></div>

									<?php 
            }
            ?>

								<?php 
        }
        //end foreach ($options as $value)
        ?>

							</div> <!-- end epanel-content div -->
						</div> <!-- end epanel-content-wrap div -->
					</div> <!-- end epanel div -->
				</div> <!-- end epanel-wrapper div -->

				<div id="epanel-bottom">
					<?php 
        wp_nonce_field('epanel_nonce');
        ?>
					<button class="save-button" name="save" id="epanel-save"><?php 
        esc_html_e('Save Changes', $themename);
        ?>
</button>

					<input type="hidden" name="action" value="save_epanel" />
				</div><!-- end epanel-bottom div -->

			</form>

			<div class="reset-popup-overlay">
				<div class="defaults-hover">
					<div class="reset-popup-header"><?php 
        esc_html_e('Reset', $themename);
        ?>
</div>
					<?php 
        _e(et_get_safe_localization('This will return all of the settings throughout the options page to their default values. <strong>Are you sure you want to do this?</strong>'), $themename);
        ?>
					<div class="clearfix"></div>
					<form method="post">
						<?php 
        wp_nonce_field('et-nojs-reset_epanel', '_wpnonce_reset');
        ?>
						<input name="reset" type="submit" value="<?php 
        esc_attr_e('Yes', $themename);
        ?>
" id="epanel-reset" />
						<input type="hidden" name="action" value="reset" />
					</form>
					<span class="no"><?php 
        esc_html_e('No', $themename);
        ?>
</span>
				</div>
			</div>

			</div> <!-- end panel-wrap div -->
		</div> <!-- end wrapper div -->

		<div id="epanel-ajax-saving">
			<img src="<?php 
        echo esc_url(get_template_directory_uri() . '/includes/builder/images/ajax-loader.gif');
        ?>
" alt="loading" id="loading" />
		</div>

		<script type="text/template" id="epanel-yes-no-button-template">
		<div class="et_pb_yes_no_button_wrapper">
			<div class="et_pb_yes_no_button"><!-- .et_pb_on_state || .et_pb_off_state -->
				<span class="et_pb_value_text et_pb_on_value"><?php 
        esc_html_e('Enable', $themename);
        ?>
</span>
				<span class="et_pb_button_slider"></span>
				<span class="et_pb_value_text et_pb_off_value"><?php 
        esc_html_e('Disable', $themename);
        ?>
</span>
			</div>
		</div>
		</script>

		<style type="text/css">
			#epanel p.postinfo-author .mark:after {
				content: '<?php 
        esc_html_e("Author", $themename);
        ?>
';
			}

			#epanel p.postinfo-date .mark:after {
				content: '<?php 
        esc_html_e("Date", $themename);
        ?>
';
			}

			#epanel p.postinfo-categories .mark:after {
				content: '<?php 
        esc_html_e("Categories", $themename);
        ?>
';
			}

			#epanel p.postinfo-comments .mark:after {
				content: '<?php 
        esc_html_e("Comments", $themename);
        ?>
';
			}
		</style>

	<?php 
    }
コード例 #8
0
<?php

global $epanelMainTabs, $themename, $shortname, $options;
$epanelMainTabs = array('general', 'navigation', 'layout', 'ad', 'seo', 'integration', 'support');
$cats_array = get_categories('hide_empty=0');
$pages_array = get_pages('hide_empty=0');
$pages_number = count($pages_array);
$site_pages = array();
$site_cats = array();
$pages_ids = array();
$cats_ids = array();
foreach ($pages_array as $pagg) {
    $site_pages[$pagg->ID] = htmlspecialchars($pagg->post_title);
    $pages_ids[] = $pagg->ID;
}
foreach ($cats_array as $categs) {
    $site_cats[$categs->cat_ID] = $categs->cat_name;
    $cats_ids[] = $categs->cat_ID;
}
$shortname = esc_html($shortname);
$pages_ids = array_map('intval', $pages_ids);
$cats_ids = array_map('intval', $cats_ids);
$options = array(array("name" => "wrap-general", "type" => "contenttab-wrapstart"), array("type" => "subnavtab-start"), array("name" => "general-1", "type" => "subnav-tab", "desc" => esc_html__("General", $themename)), array("type" => "subnavtab-end"), array("name" => "general-1", "type" => "subcontent-start"), array("name" => esc_html__("Logo", $themename), "id" => $shortname . "_logo", "type" => "upload", "button_text" => esc_html__("Set As Logo", $themename), "std" => "", "desc" => esc_html__("If you would like to use your own custom logo image click the Upload Image button.", $themename)), array("name" => esc_html__("Favicon", $themename), "id" => $shortname . "_favicon", "type" => "upload", "button_text" => esc_html__("Set As Favicon", $themename), "std" => "", "desc" => esc_html__("If you would like to use your own custom favicon image click the Upload Image button.", $themename)), array("name" => esc_html__("Fixed Navigation Bar", $themename), "id" => $shortname . "_fixed_nav", "type" => "checkbox", "std" => "on", "desc" => esc_html__("By default the navigation bar stays on top of the screen at all times. We suggest to disable this option, if you need to use a logo taller than the default one.", $themename)), array("name" => esc_html__("Enable Divi Gallery", $themename), "id" => $shortname . "_gallery_layout_enable", "type" => "checkbox", "std" => "off", "desc" => esc_html__("Enable this if you want to replace the WordPress default gallery with the Divi-style gallery.", $themename)), array("type" => "clearfix"), array("name" => esc_html__("Grab the first post image", $themename), "id" => $shortname . "_grab_image", "type" => "checkbox", "std" => "false", "desc" => esc_html__("By default thumbnail images are created using custom fields. However, if you would rather use the images that are already in your post for your thumbnail (and bypass using custom fields) you can activate this option. Once activcated thumbnail images will be generated automatically using the first image in your post. The image must be hosted on your own server.", $themename)), array("name" => esc_html__("Blog Style Mode", $themename), "id" => $shortname . "_blog_style", "type" => "checkbox2", "std" => "false", "desc" => esc_html__("By default the theme truncates your posts on index/homepages automatically to create post previews. If you would rather show your posts in full on index pages like a traditional blog then you can activate this feature.", $themename)), array("name" => esc_html__("Shop Page & Category Page Layout for WooCommerce", $themename), "id" => $shortname . "_shop_page_sidebar", "type" => "select", "options" => array('et_right_sidebar' => esc_html__('Right Sidebar', $themename), 'et_left_sidebar' => esc_html__('Left Sidebar', $themename), 'et_full_width_page' => esc_html__('Full Width', $themename)), "std" => 'et_right_sidebar', "desc" => esc_html__("Here you can choose Shop Page & Category Page Layout for WooCommerce.", $themename), 'et_save_values' => true), array("name" => esc_html__("MailChimp API Key", $themename), "id" => $shortname . "_mailchimp_api_key", "std" => "", "type" => "text", "validation_type" => "nohtml", "desc" => et_get_safe_localization(sprintf(__('Enter your MailChimp API key. You can create an api key <a target="_blank" href="%1$s">here</a>', $themename), 'https://us3.admin.mailchimp.com/account/api/'))), array("name" => esc_html__("Aweber Authorization", $themename), "type" => "callback_function", "desc" => esc_html__('Authorize your Aweber account here.', $themename), "function_name" => 'et_aweber_authorization_option'), array("name" => esc_html__("Regenerate MailChimp Lists", $themename), "id" => $shortname . "_regenerate_mailchimp_lists", "type" => "checkbox", "std" => "false", "desc" => esc_html__("By default, MailChimp lists are cached for one day. If you added new list, but it doesn't appear within the Email Optin module settings, activate this option. Don't forget to disable it once the list has been regenerated.", $themename)), array("name" => esc_html__("Regenerate Aweber Lists", $themename), "id" => $shortname . "_regenerate_aweber_lists", "type" => "checkbox2", "std" => "false", "desc" => esc_html__("By default, Aweber lists are cached for one day. If you added new list, but it doesn't appear within the Email Optin module settings, activate this option. Don't forget to disable it once the list has been regenerated.", $themename)), array("name" => esc_html__("Show Facebook Icon", $themename), "id" => $shortname . "_show_facebook_icon", "type" => "checkbox", "std" => "on", "desc" => esc_html__("Here you can choose to display the Facebook Icon on your homepage. ", $themename)), array("name" => esc_html__("Show Twitter Icon", $themename), "id" => $shortname . "_show_twitter_icon", "type" => "checkbox2", "std" => "on", "desc" => esc_html__("Here you can choose to display the Twitter Icon. ", $themename)), array("name" => esc_html__("Show Google+ Icon", $themename), "id" => $shortname . "_show_google_icon", "type" => "checkbox", "std" => "on", "desc" => esc_html__("Here you can choose to display the Google+ Icon on your homepage. ", $themename)), array("name" => esc_html__("Show RSS Icon", $themename), "id" => $shortname . "_show_rss_icon", "type" => "checkbox2", "std" => "on", "desc" => esc_html__("Here you can choose to display the RSS Icon. ", $themename)), array("name" => esc_html__("Facebook Profile Url", $themename), "id" => $shortname . "_facebook_url", "std" => "#", "type" => "text", "validation_type" => "url", "desc" => esc_html__("Enter the URL of your Facebook Profile. ", $themename)), array("name" => esc_html__("Twitter Profile Url", $themename), "id" => $shortname . "_twitter_url", "std" => "#", "type" => "text", "validation_type" => "url", "desc" => esc_html__("Enter the URL of your Twitter Profile.", $themename)), array("name" => esc_html__("Google+ Profile Url", $themename), "id" => $shortname . "_google_url", "std" => "#", "type" => "text", "validation_type" => "url", "desc" => esc_html__("Enter the URL of your Google+ Profile. ", $themename)), array("name" => esc_html__("RSS Icon Url", $themename), "id" => $shortname . "_rss_url", "std" => "", "type" => "text", "validation_type" => "url", "desc" => esc_html__("Enter the URL of your RSS feed. ", $themename)), array("name" => esc_html__("Number of Products displayed on WooCommerce archive pages", $themename), "id" => $shortname . "_woocommerce_archive_num_posts", "std" => "9", "type" => "text", "desc" => esc_html__("Here you can designate how many WooCommerce products are displayed on the archive page. This option works independently from the Settings > Reading options in wp-admin.", $themename), "validation_type" => "number"), array("name" => esc_html__("Number of Posts displayed on Category page", $themename), "id" => $shortname . "_catnum_posts", "std" => "6", "type" => "text", "desc" => esc_html__("Here you can designate how many recent articles are displayed on the Category page. This option works independently from the Settings > Reading options in wp-admin.", $themename), "validation_type" => "number"), array("name" => esc_html__("Number of Posts displayed on Archive pages", $themename), "id" => $shortname . "_archivenum_posts", "std" => "5", "type" => "text", "desc" => esc_html__("Here you can designate how many recent articles are displayed on the Archive pages. This option works independently from the Settings > Reading options in wp-admin.", $themename), "validation_type" => "number"), array("name" => esc_html__("Number of Posts displayed on Search pages", $themename), "id" => $shortname . "_searchnum_posts", "std" => "5", "type" => "text", "desc" => esc_html__("Here you can designate how many recent articles are displayed on the Search results pages. This option works independently from the Settings > Reading options in wp-admin.", $themename), "validation_type" => "number"), array("name" => esc_html__("Number of Posts displayed on Tag pages", $themename), "id" => $shortname . "_tagnum_posts", "std" => "5", "type" => "text", "desc" => esc_html__("Here you can designate how many recent articles are displayed on the Tag pages. This option works independently from the Settings > Reading options in wp-admin.", $themename), "validation_type" => "number"), array("name" => esc_html__("Date format", $themename), "id" => $shortname . "_date_format", "std" => "M j, Y", "type" => "text", "desc" => et_get_safe_localization(__("This option allows you to change how your dates are displayed. For more information please refer to the WordPress codex here:<a href='http://codex.wordpress.org/Formatting_Date_and_Time' target='_blank'>Formatting Date and Time</a>", $themename)), "validation_type" => "date_format"), array("name" => esc_html__("Use excerpts when defined", $themename), "id" => $shortname . "_use_excerpt", "type" => "checkbox", "std" => "false", "desc" => esc_html__("This will enable the use of excerpts in posts or pages.", $themename)), array("name" => esc_html__("Responsive shortcodes", $themename), "id" => $shortname . "_responsive_shortcodes", "type" => "checkbox2", "std" => "on", "desc" => esc_html__("Enable this option to make shortcodes respond to various screen sizes", $themename)), array("name" => esc_html__("Google Fonts subsets", $themename), "id" => $shortname . "_gf_enable_all_character_sets", "type" => "checkbox", "std" => "false", "desc" => esc_html__("This will enable Google Fonts for Non-English languages.", $themename)), array("name" => esc_html__("Back To Top Button", $themename), "id" => $shortname . "_back_to_top", "type" => "checkbox2", "std" => "false", "desc" => esc_html__("Enable this option to display Back To Top Button while scrolling", $themename)), array("name" => esc_html__("Smooth Scrolling", $themename), "id" => $shortname . "_smooth_scroll", "type" => "checkbox", "std" => "false", "desc" => esc_html__("Enable this option to get the smooth scrolling effect with mouse wheel", $themename)), array("name" => esc_html__("Disable Translations", $themename), "id" => $shortname . "_disable_translations", "type" => "checkbox2", "std" => "false", "desc" => esc_html__("Disable translations if you don't want to display translated theme strings on your site.", $themename)), array("name" => esc_html__("Custom CSS", $themename), "id" => $shortname . "_custom_css", "type" => "textarea", "std" => "", "desc" => esc_html__("Here you can add custom css to override or extend default styles.", $themename), "validation_type" => "nohtml"), array("name" => "general-1", "type" => "subcontent-end"), array("name" => "wrap-general", "type" => "contenttab-wrapend"), array("name" => "wrap-navigation", "type" => "contenttab-wrapstart"), array("type" => "subnavtab-start"), array("name" => "navigation-1", "type" => "subnav-tab", "desc" => esc_html__("Pages", $themename)), array("name" => "navigation-2", "type" => "subnav-tab", "desc" => esc_html__("Categories", $themename)), array("name" => "navigation-3", "type" => "subnav-tab", "desc" => esc_html__("General Settings", $themename)), array("type" => "subnavtab-end"), array("name" => "navigation-1", "type" => "subcontent-start"), array("name" => esc_html__("Exclude pages from the navigation bar", $themename), "id" => $shortname . "_menupages", "type" => "checkboxes", "std" => "", "desc" => esc_html__("Here you can choose to remove certain pages from the navigation menu. All pages marked with an X will not appear in your navigation bar. ", $themename), "usefor" => "pages", "options" => $pages_ids), array("name" => esc_html__("Show dropdown menus", $themename), "id" => $shortname . "_enable_dropdowns", "type" => "checkbox", "std" => "on", "desc" => esc_html__("If you would like to remove the dropdown menus from the pages navigation bar disable this feature.", $themename)), array("name" => esc_html__("Display Home link", $themename), "id" => $shortname . "_home_link", "type" => "checkbox2", "std" => "on", "desc" => esc_html__("By default the theme creates a Home link that, when clicked, leads back to your blog's homepage. If, however, you are using a static homepage and have already created a page called Home to use, this will result in a duplicate link. In this case you should disable this feature to remove the link.", $themename)), array("name" => esc_html__("Sort Pages Links", $themename), "id" => $shortname . "_sort_pages", "type" => "select", "std" => "post_title", "desc" => esc_html__("Here you can choose to sort your pages links.", $themename), "options" => array("post_title", "menu_order", "post_date", "post_modified", "ID", "post_author", "post_name")), array("name" => esc_html__("Order Pages Links by Ascending/Descending", $themename), "id" => $shortname . "_order_page", "type" => "select", "std" => "asc", "desc" => esc_html__("Here you can choose to reverse the order that your pages links are displayed. You can choose between ascending and descending.", $themename), "options" => array("asc", "desc")), array("name" => esc_html__("Number of dropdown tiers shown", $themename), "id" => $shortname . "_tiers_shown_pages", "type" => "text", "std" => "3", "desc" => esc_html__("This options allows you to control how many teirs your pages dropdown menu has. Increasing the number allows for additional menu items to be shown.", $themename), "validation_type" => "number"), array("name" => "navigation-1", "type" => "subcontent-end"), array("name" => "navigation-2", "type" => "subcontent-start"), array("name" => esc_html__("Exclude categories from the navigation bar", $themename), "id" => $shortname . "_menucats", "type" => "checkboxes", "std" => "", "desc" => esc_html__("Here you can choose to remove certain categories from the navigation menu. All categories marked with an X will not appear in your navigation bar. ", $themename), "usefor" => "categories", "options" => $cats_ids), array("name" => esc_html__("Show dropdown menus", $themename), "id" => $shortname . "_enable_dropdowns_categories", "type" => "checkbox", "std" => "on", "desc" => esc_html__("If you would like to remove the dropdown menus from the categories navigation bar disable this feature.", $themename)), array("name" => esc_html__("Hide empty categories", $themename), "id" => $shortname . "_categories_empty", "type" => "checkbox", "std" => "on", "desc" => esc_html__("If you would like categories to be displayed in your navigationbar that don't have any posts in them then disable this option. By default empty categories are hidden", $themename)), array("name" => esc_html__("Number of dropdown tiers shown", $themename), "id" => $shortname . "_tiers_shown_categories", "type" => "text", "std" => "3", "desc" => esc_html__("This options allows you to control how many teirs your pages dropdown menu has. Increasing the number allows for additional menu items to be shown.", $themename), "validation_type" => "number"), array("name" => esc_html__("Sort Categories Links by Name/ID/Slug/Count/Term Group", $themename), "id" => $shortname . "_sort_cat", "type" => "select", "std" => "name", "desc" => esc_html__("By default pages are sorted by name. However if you would rather have them sorted by ID you can adjust this setting.", $themename), "options" => array("name", "ID", "slug", "count", "term_group")), array("name" => esc_html__("Order Category Links by Ascending/Descending", $themename), "id" => $shortname . "_order_cat", "type" => "select", "std" => "asc", "desc" => esc_html__("Here you can choose to reverse the order that your categories links are displayed. You can choose between ascending and descending.", $themename), "options" => array("asc", "desc")), array("name" => "navigation-2", "type" => "subcontent-end"), array("name" => "navigation-3", "type" => "subcontent-start"), array("name" => esc_html__("Disable top tier dropdown menu links", $themename), "id" => $shortname . "_disable_toptier", "type" => "checkbox2", "std" => "false", "desc" => esc_html__("In some cases users will want to create parent categories or links as placeholders to hold a list of child links or categories. In this case it is not desirable to have the parent links lead anywhere, but instead merely serve an organizational function. Enabling this options will remove the links from all parent pages/categories so that they don't lead anywhere when clicked.", $themename)), array("name" => "navigation-3", "type" => "subcontent-end"), array("name" => "wrap-navigation", "type" => "contenttab-wrapend"), array("name" => "wrap-layout", "type" => "contenttab-wrapstart"), array("type" => "subnavtab-start"), array("name" => "layout-1", "type" => "subnav-tab", "desc" => esc_html__("Single Post Layout", $themename)), array("name" => "layout-2", "type" => "subnav-tab", "desc" => esc_html__("Single Page Layout", $themename)), array("name" => "layout-3", "type" => "subnav-tab", "desc" => esc_html__("General Settings", $themename)), array("type" => "subnavtab-end"), array("name" => "layout-1", "type" => "subcontent-start"), array("name" => esc_html__("Choose which items to display in the postinfo section", $themename), "id" => $shortname . "_postinfo2", "type" => "different_checkboxes", "std" => array("author", "date", "categories", "comments"), "desc" => esc_html__("Here you can choose which items appear in the postinfo section on single post pages. This is the area, usually below the post title, which displays basic information about your post. The highlighted itmes shown below will appear. ", $themename), "options" => array("author", "date", "categories", "comments")), array("name" => esc_html__("Show comments on posts", $themename), "id" => $shortname . "_show_postcomments", "type" => "checkbox", "std" => "on", "desc" => esc_html__("You can disable this option if you want to remove the comments and comment form from single post pages. ", $themename)), array("name" => esc_html__("Place Thumbs on Posts", $themename), "id" => $shortname . "_thumbnails", "type" => "checkbox2", "std" => "on", "desc" => esc_html__("By default thumbnails are placed at the beginning of your post on single post pages. If you would like to remove this initial thumbnail image to avoid repetition simply disable this option. ", $themename)), array("name" => "layout-1", "type" => "subcontent-end"), array("name" => "layout-2", "type" => "subcontent-start"), array("name" => esc_html__("Place Thumbs on Pages", $themename), "id" => $shortname . "_page_thumbnails", "type" => "checkbox", "std" => "false", "desc" => esc_html__("By default thumbnails are not placed on pages (they are only used on posts). However, if you want to use thumbnails on pages you can! Just enable this option. ", $themename)), array("name" => esc_html__("Show comments on pages", $themename), "id" => $shortname . "_show_pagescomments", "type" => "checkbox2", "std" => "false", "desc" => esc_html__("By default comments are not placed on pages, however, if you would like to allow people to comment on your pages simply enable this option. ", $themename)), array("name" => "layout-2", "type" => "subcontent-end"), array("name" => "layout-3", "type" => "subcontent-start"), array("name" => esc_html__("Post info section", $themename), "id" => $shortname . "_postinfo1", "type" => "different_checkboxes", "std" => array("author", "date", "categories"), "desc" => esc_html__("Here you can choose which items appear in the postinfo section on pages. This is the area, usually below the post title, which displays basic information about your post. The highlighted itmes shown below will appear. ", $themename), "options" => array("author", "date", "categories", "comments")), array("name" => esc_html__("Show Thumbs on Index pages", $themename), "id" => $shortname . "_thumbnails_index", "type" => "checkbox", "std" => "on", "desc" => esc_html__("Enable this option to show thumbnails on Index Pages.", $themename)), array("name" => "layout-3", "type" => "subcontent-end"), array("name" => "wrap-layout", "type" => "contenttab-wrapend"), array("name" => "wrap-seo", "type" => "contenttab-wrapstart"), array("type" => "subnavtab-start"), array("name" => "seo-1", "type" => "subnav-tab", "desc" => esc_html__("Homepage SEO", $themename)), array("name" => "seo-2", "type" => "subnav-tab", "desc" => esc_html__("Single Post Page SEO", $themename)), array("name" => "seo-3", "type" => "subnav-tab", "desc" => esc_html__("Index Page SEO", $themename)), array("type" => "subnavtab-end"), array("name" => "seo-1", "type" => "subcontent-start"), array("name" => esc_html__(" Enable custom title ", $themename), "id" => $shortname . "_seo_home_title", "type" => "checkbox", "std" => "false", "desc" => esc_html__("By default the theme uses a combination of your blog name and your blog description, as defined when you created your blog, to create your homepage titles. However if you want to create a custom title then simply enable this option and fill in the custom title field below. ", $themename)), array("name" => esc_html__(" Enable meta description", $themename), "id" => $shortname . "_seo_home_description", "type" => "checkbox", "std" => "false", "desc" => esc_html__("By default the theme uses your blog description, as defined when you created your blog, to fill in the meta description field. If you would like to use a different description then enable this option and fill in the custom description field below. ", $themename)), array("name" => esc_html__(" Enable meta keywords", $themename), "id" => $shortname . "_seo_home_keywords", "type" => "checkbox", "std" => "false", "desc" => esc_html__("By default the theme does not add keywords to your header. Most search engines don't use keywords to rank your site anymore, but some people define them anyway just in case. If you want to add meta keywords to your header then enable this option and fill in the custom keywords field below. ", $themename)), array("name" => esc_html__(" Enable canonical URL's", $themename), "id" => $shortname . "_seo_home_canonical", "type" => "checkbox", "std" => "false", "desc" => esc_html__("Canonicalization helps to prevent the indexing of duplicate content by search engines, and as a result, may help avoid duplicate content penalties and pagerank degradation. Some pages may have different URLs all leading to the same place. For example domain.com, domain.com/index.html, and www.domain.com are all different URLs leading to your homepage. From a search engine's perspective these duplicate URLs, which also occur often due to custom permalinks, may be treated individually instead of as a single destination. Defining a canonical URL tells the search engine which URL you would like to use officially. The theme bases its canonical URLs off your permalinks and the domain name defined in the settings tab of wp-admin.", $themename)), array("name" => esc_html__("Homepage custom title (if enabled)", $themename), "id" => $shortname . "_seo_home_titletext", "type" => "text", "std" => "", "desc" => esc_html__("If you have enabled custom titles you can add your custom title here. Whatever you type here will be placed between the < title >< /title > tags in header.php", $themename), "validation_type" => "nohtml"), array("name" => esc_html__("Homepage meta description (if enabled)", $themename), "id" => $shortname . "_seo_home_descriptiontext", "type" => "textarea", "std" => "", "desc" => esc_html__("If you have enabled meta descriptions you can add your custom description here.", $themename), "validation_type" => "nohtml"), array("name" => esc_html__("Homepage meta keywords (if enabled)", $themename), "id" => $shortname . "_seo_home_keywordstext", "type" => "text", "std" => "", "desc" => esc_html__("If you have enabled meta keywords you can add your custom keywords here. Keywords should be separated by comas. For example: wordpress,themes,templates,elegant", $themename), "validation_type" => "nohtml"), array("name" => esc_html__("If custom titles are disabled, choose autogeneration method", $themename), "id" => $shortname . "_seo_home_type", "type" => "select", "std" => "BlogName | Blog description", "options" => array("BlogName | Blog description", "Blog description | BlogName", "BlogName only"), "desc" => esc_html__("If you are not using cutsom post titles you can still have control over how your titles are generated. Here you can choose which order you would like your post title and blog name to be displayed, or you can remove the blog name from the title completely.", $themename)), array("name" => esc_html__("Define a character to separate BlogName and Post title", $themename), "id" => $shortname . "_seo_home_separate", "type" => "text", "std" => " | ", "desc" => esc_html__("Here you can change which character separates your blog title and post name when using autogenerated post titles. Common values are | or -", $themename), "validation_type" => "nohtml"), array("name" => "seo-1", "type" => "subcontent-end"), array("name" => "seo-2", "type" => "subcontent-start"), array("name" => esc_html__("Enable custom titles", $themename), "id" => $shortname . "_seo_single_title", "type" => "checkbox", "std" => "false", "desc" => esc_html__("By default the theme creates post titles based on the title of your post and your blog name. If you would like to make your meta title different than your actual post title you can define a custom title for each post using custom fields. This option must be enabled for custom titles to work, and you must choose a custom field name for your title below.", $themename)), array("name" => esc_html__("Enable custom description", $themename), "id" => $shortname . "_seo_single_description", "type" => "checkbox2", "std" => "false", "desc" => esc_html__("If you would like to add a meta description to your post you can do so using custom fields. This option must be enabled for descriptions to be displayed on post pages. You can add your meta description using custom fields based off the custom field name you define below.", $themename)), array("name" => esc_html__("Enable custom keywords", $themename), "id" => $shortname . "_seo_single_keywords", "type" => "checkbox", "std" => "false", "desc" => esc_html__("If you would like to add meta keywords to your post you can do so using custom fields. This option must be enabled for keywords to be displayed on post pages. You can add your meta keywords using custom fields based off the custom field name you define below.", $themename)), array("name" => esc_html__("Enable canonical URL's", $themename), "id" => $shortname . "_seo_single_canonical", "type" => "checkbox2", "std" => "false", "desc" => esc_html__("Canonicalization helps to prevent the indexing of duplicate content by search engines, and as a result, may help avoid duplicate content penalties and pagerank degradation. Some pages may have different URLs all leading to the same place. For example domain.com, domain.com/index.html, and www.domain.com are all different URLs leading to your homepage. From a search engine's perspective these duplicate URLs, which also occur often due to custom permalinks, may be treated individually instead of as a single destination. Defining a canonical URL tells the search engine which URL you would like to use officially. The theme bases its canonical URLs off your permalinks and the domain name defined in the settings tab of wp-admin.", $themename)), array("name" => esc_html__("Custom field Name to be used for title", $themename), "id" => $shortname . "_seo_single_field_title", "type" => "text", "std" => "seo_title", "desc" => esc_html__("When you define your title using custom fields you should use this value for the custom field Name. The Value of your custom field should be the custom title you would like to use.", $themename), "validation_type" => "nohtml"), array("name" => esc_html__("Custom field Name to be used for description", $themename), "id" => $shortname . "_seo_single_field_description", "type" => "text", "std" => "seo_description", "desc" => esc_html__("When you define your meta description using custom fields you should use this value for the custom field Name. The Value of your custom field should be the custom description you would like to use.", $themename), "validation_type" => "nohtml"), array("name" => esc_html__("Custom field Name to be used for keywords", $themename), "id" => $shortname . "_seo_single_field_keywords", "type" => "text", "std" => "seo_keywords", "desc" => esc_html__("When you define your keywords using custom fields you should use this value for the custom field Name. The Value of your custom field should be the meta keywords you would like to use, separated by comas.", $themename), "validation_type" => "nohtml"), array("name" => esc_html__("If custom titles are disabled, choose autogeneration method", $themename), "id" => $shortname . "_seo_single_type", "type" => "select", "std" => "Post title | BlogName", "options" => array("Post title | BlogName", "BlogName | Post title", "Post title only"), "desc" => esc_html__("If you are not using cutsom post titles you can still have control over hw your titles are generated. Here you can choose which order you would like your post title and blog name to be displayed, or you can remove the blog name from the title completely.", $themename)), array("name" => esc_html__("Define a character to separate BlogName and Post title", $themename), "id" => $shortname . "_seo_single_separate", "type" => "text", "std" => " | ", "desc" => esc_html__("Here you can change which character separates your blog title and post name when using autogenerated post titles. Common values are | or -", $themename), "validation_type" => "nohtml"), array("name" => "seo-2", "type" => "subcontent-end"), array("name" => "seo-3", "type" => "subcontent-start"), array("name" => esc_html__(" Enable canonical URL's", $themename), "id" => $shortname . "_seo_index_canonical", "type" => "checkbox", "std" => "false", "desc" => esc_html__("Canonicalization helps to prevent the indexing of duplicate content by search engines, and as a result, may help avoid duplicate content penalties and pagerank degradation. Some pages may have different URLs all leading to the same place. For example domain.com, domain.com/index.html, and www.domain.com are all different URLs leading to your homepage. From a search engine's perspective these duplicate URLs, which also occur often due to custom permalinks, may be treated individually instead of as a single destination. Defining a canonical URL tells the search engine which URL you would like to use officially. The theme bases its canonical URLs off your permalinks and the domain name defined in the settings tab of wp-admin.", $themename)), array("name" => esc_html__("Enable meta descriptions", $themename), "id" => $shortname . "_seo_index_description", "type" => "checkbox2", "std" => "false", "desc" => esc_html__("Check this box if you want to display meta descriptions on category/archive pages. The description is based off the category description you choose when creating/edit your category in wp-admin.", $themename)), array("name" => esc_html__("Choose title autogeneration method", $themename), "id" => $shortname . "_seo_index_type", "type" => "select", "std" => "Category name | BlogName", "options" => array("Category name | BlogName", "BlogName | Category name", "Category name only"), "desc" => esc_html__("Here you can choose how your titles on index pages are generated. You can change which order your blog name and index title are displayed, or you can remove the blog name from the title completely.", $themename)), array("name" => esc_html__("Define a character to separate BlogName and Post title", $themename), "id" => $shortname . "_seo_index_separate", "type" => "text", "std" => " | ", "desc" => esc_html__("Here you can change which character separates your blog title and index page name when using autogenerated post titles. Common values are | or -", $themename), "validation_type" => "nohtml"), array("name" => "seo-3", "type" => "subcontent-end"), array("name" => "wrap-seo", "type" => "contenttab-wrapend"), array("name" => "wrap-integration", "type" => "contenttab-wrapstart"), array("type" => "subnavtab-start"), array("name" => "integration-1", "type" => "subnav-tab", "desc" => esc_html__("Code Integration", $themename)), array("type" => "subnavtab-end"), array("name" => "integration-1", "type" => "subcontent-start"), array("name" => esc_html__("Enable header code", $themename), "id" => $shortname . "_integrate_header_enable", "type" => "checkbox", "std" => "on", "desc" => esc_html__("Disabling this option will remove the header code below from your blog. This allows you to remove the code while saving it for later use.", $themename)), array("name" => esc_html__("Enable body code", $themename), "id" => $shortname . "_integrate_body_enable", "type" => "checkbox2", "std" => "on", "desc" => esc_html__("Disabling this option will remove the body code below from your blog. This allows you to remove the code while saving it for later use.", $themename)), array("name" => esc_html__("Enable single top code", $themename), "id" => $shortname . "_integrate_singletop_enable", "type" => "checkbox", "std" => "on", "desc" => esc_html__("Disabling this option will remove the single top code below from your blog. This allows you to remove the code while saving it for later use.", $themename)), array("name" => esc_html__("Enable single bottom code", $themename), "id" => $shortname . "_integrate_singlebottom_enable", "type" => "checkbox2", "std" => "on", "desc" => esc_html__("Disabling this option will remove the single bottom code below from your blog. This allows you to remove the code while saving it for later use.", $themename)), array("name" => esc_html__("Add code to the < head > of your blog", $themename), "id" => $shortname . "_integration_head", "type" => "textarea", "std" => "", "desc" => esc_html__("Any code you place here will appear in the head section of every page of your blog. This is useful when you need to add javascript or css to all pages.", $themename)), array("name" => esc_html__("Add code to the < body > (good for tracking codes such as google analytics)", $themename), "id" => $shortname . "_integration_body", "type" => "textarea", "std" => "", "desc" => esc_html__("Any code you place here will appear in body section of all pages of your blog. This is usefull if you need to input a tracking pixel for a state counter such as Google Analytics.", $themename)), array("name" => esc_html__("Add code to the top of your posts", $themename), "id" => $shortname . "_integration_single_top", "type" => "textarea", "std" => "", "desc" => esc_html__("Any code you place here will be placed at the top of all single posts. This is useful if you are looking to integrating things such as social bookmarking links.", $themename)), array("name" => esc_html__("Add code to the bottom of your posts, before the comments", $themename), "id" => $shortname . "_integration_single_bottom", "type" => "textarea", "std" => "", "desc" => esc_html__("Any code you place here will be placed at the top of all single posts. This is useful if you are looking to integrating things such as social bookmarking links.", $themename)), array("name" => "integration-1", "type" => "subcontent-end"), array("name" => "wrap-integration", "type" => "contenttab-wrapend"), array("name" => "wrap-advertisements", "type" => "contenttab-wrapstart"), array("type" => "subnavtab-start"), array("name" => "advertisements-1", "type" => "subnav-tab", "desc" => esc_html__("Manage Un-widgetized Advertisements", $themename)), array("type" => "subnavtab-end"), array("name" => "advertisements-1", "type" => "subcontent-start"), array("name" => esc_html__("Enable Single Post 468x60 banner", $themename), "id" => $shortname . "_468_enable", "type" => "checkbox2", "std" => "false", "desc" => esc_html__("Enabling this option will display a 468x60 banner ad on the bottom of your post pages below the single post content. If enabled you must fill in the banner image and destination url below.", $themename)), array("name" => esc_html__("Input 468x60 advertisement banner image", $themename), "id" => $shortname . "_468_image", "type" => "text", "std" => "", "desc" => esc_html__("Here you can provide 468x60 banner image url", $themename), "validation_type" => "url"), array("name" => esc_html__("Input 468x60 advertisement destination url", $themename), "id" => $shortname . "_468_url", "type" => "text", "std" => "", "desc" => esc_html__("Here you can provide 468x60 banner destination url", $themename), "validation_type" => "url"), array("name" => esc_html__("Input 468x60 adsense code", $themename), "id" => $shortname . "_468_adsense", "type" => "textarea", "std" => "", "desc" => esc_html__("Place your adsense code here.", $themename)), array("name" => "advertisements-1", "type" => "subcontent-end"), array("name" => "wrap-support", "type" => "contenttab-wrapend"));
コード例 #9
0
				</div> <!-- #et-footer-nav -->

			<?php 
    }
    ?>

				<div id="footer-bottom">
					<div class="container clearfix">
				<?php 
    if (false !== et_get_option('show_footer_social_icons', true)) {
        get_template_part('includes/social_icons', 'footer');
    }
    ?>

						<p id="footer-info"><?php 
    printf(et_get_safe_localization(__('Designed by %1$s | Powered by %2$s', 'Divi')), '<a href="http://www.elegantthemes.com" title="Premium WordPress Themes">Elegant Themes</a>', '<a href="http://www.wordpress.org">WordPress</a>');
    ?>
</p>
					</div>	<!-- .container -->
				</div>
			</footer> <!-- #main-footer -->
		</div> <!-- #et-main-area -->

<?php 
}
// ! is_page_template( 'page-template-blank.php' )
?>

	</div> <!-- #page-container -->

	<?php 
コード例 #10
0
ファイル: core.php プロジェクト: pacificano/pacificano
    function et_builder_get_exit_notification_modal()
    {
        $output = sprintf('<div class="et-core-modal-overlay et-core-modal-two-buttons et-builder-exit-modal et-core-active">
			<div class="et-core-modal">
				<div class="et-core-modal-header">
					<h3 class="et-core-modal-title">%1$s</h3>
					<a href="#" class="et-core-modal-close" data-et-core-modal="close"></a>
				</div>

				<div class="et-core-modal-content">
					<p>%2$s</p>
				</div>

				<div class="et_pb_prompt_buttons">
					<br>
					<span class="spinner"></span>
					<a href="#" class="et-core-modal-action et-core-modal-action-secondary">%3$s</a>
					<a href="#" class="et-core-modal-action">%4$s</a>
				</div>
			</div>
		</div>', esc_html__('You Have Unsaved Changes', 'et_builder'), et_get_safe_localization(__('Your page contains changes that have not been saved. If you close the builder without saving, these changes will be lost. If you would like to leave the builder and save all changes, please select <strong>Save & Exit</strong>. If you would like to discard all recent changes, choose <strong>Discard & Exit</strong>.', 'et_builder')), esc_html__('Discard & Exit', 'et_builder'), esc_html__('Save & Exit', 'et_builder'));
        return $output;
    }
コード例 #11
0
/**
 * Display the Notice about cache once the theme was udpated
 */
function et_pb_maybe_display_cache_notice()
{
    $ignore_notice_option = get_option('et_pb_cache_notice', array());
    $ignore_this_notice = empty($ignore_notice_option[ET_BUILDER_VERSION]) ? 'show' : $ignore_notice_option[ET_BUILDER_VERSION];
    $screen = get_current_screen();
    // check whether any cache plugin installed and get its page link
    $plugin_page = et_pb_detect_cache_plugins();
    if (current_user_can('manage_options') && 'post' === $screen->base && 'ignore' !== $ignore_this_notice && false !== $plugin_page) {
        $hide_button = sprintf(' <br> <a class="et_pb_hide_cache_notice" href="%3$s">%2$s</a> <a class="et_pb_hide_cache_notice" href="#">%1$s</a>', esc_html__('Hide Notice', 'et_builder'), esc_html__('Clear Cache', 'et_builder'), esc_url(admin_url($plugin_page)));
        $notice_text = et_get_safe_localization(__('The Divi Builder has been updated, but you are currently using a caching plugin. Please clear your plugin cache <strong>and</strong> clear your browser cache (in that order) to make sure you are loading the updated builder files. Loading cached files may cause the builder to malfunction.', 'et_builder'));
        printf('<div class="update-nag et-pb-update-nag"><p>%1$s%2$s</p></div>', $notice_text, $hide_button);
    }
}
コード例 #12
0
function et_admin_update_theme_message($default_translated_text, $original_text, $domain)
{
    global $themename;
    $theme_page_message = 'There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%1$s">View version %3$s details</a>. <em>Automatic update is unavailable for this theme.</em>';
    $updates_page_message = 'Update package not available.';
    if (is_admin() && $original_text === $theme_page_message) {
        return et_get_safe_localization(__('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%1$s">View version %3$s details</a>. <em>Before you can update your Elegant Themes, you must first install the <a href="https://www.elegantthemes.com/members-area/documentation.html#updater" target="_blank">Elegant Updater Plugin</a> to authenticate your subscription.</em>', $themename));
    }
    if (is_admin() && $original_text === $updates_page_message) {
        return et_get_safe_localization(__('Before you can update your Elegant Themes, you must first install the <a href="https://www.elegantthemes.com/members-area/documentation.html#updater" target="_blank">Elegant Updater Plugin</a> to authenticate your subscription.', $themename));
    }
    return $default_translated_text;
}
コード例 #13
0
				<?php 
    }
    ?>

				<?php 
    if (!$is_page_builder_used || $is_page_builder_used && 'on' === $show_navigation) {
        ?>

					<div class="nav-single clearfix">
						<span class="nav-previous"><?php 
        previous_post_link('%link', '<span class="meta-nav">' . et_get_safe_localization(_x('&larr;', 'Previous post link', 'Divi')) . '</span> %title');
        ?>
</span>
						<span class="nav-next"><?php 
        next_post_link('%link', '%title <span class="meta-nav">' . et_get_safe_localization(_x('&rarr;', 'Next post link', 'Divi')) . '</span>');
        ?>
</span>
					</div><!-- .nav-single -->

				<?php 
    }
    ?>

				</article> <!-- .et_pb_post -->

			<?php 
    if (!$is_page_builder_used && comments_open() && 'on' == et_get_option('divi_show_postcomments', 'on')) {
        comments_template('', true);
    }
    ?>
コード例 #14
0
 function et_theme_epanel_reminder()
 {
     global $shortname, $themename, $current_screen;
     if (false === et_get_option($shortname . '_logo') && 'appearance_page_core_functions' != $current_screen->id) {
         printf(et_get_safe_localization(__('<div class="updated"><p>This is a fresh installation of %1$s theme. Don\'t forget to go to <a href="%2$s">ePanel</a> to set it up. This message will disappear once you have clicked the Save button within the <a href="%2$s">theme\'s options page</a>.</p></div>', $themename)), wp_get_theme(), admin_url('themes.php?page=core_functions.php'));
     }
 }
コード例 #15
0
			</ol>
		<?php 
    }
    ?>

		<?php 
    if (get_comment_pages_count() > 1 && get_option('page_comments')) {
        // Are there comments to navigate through?
        ?>
			<div class="comment_navigation_bottom clearfix">
				<div class="nav-previous"><?php 
        previous_comments_link(et_get_safe_localization(__('<span class="meta-nav">&larr;</span> Older Comments', 'et_builder')));
        ?>
</div>
				<div class="nav-next"><?php 
        next_comments_link(et_get_safe_localization(__('Newer Comments <span class="meta-nav">&rarr;</span>', 'et_builder')));
        ?>
</div>
			</div> <!-- .navigation -->
		<?php 
    }
    // check for comment navigation
    ?>

		<?php 
    if (!empty($comments_by_type['pings'])) {
        ?>
			<div id="trackbacks">
				<h3 id="trackbacks-title"><?php 
        esc_html_e('Trackbacks/Pingbacks', 'et_builder');
        ?>
コード例 #16
0
ファイル: functions.php プロジェクト: pacificano/pacificano
 function et_get_footer_credits()
 {
     $original_footer_credits = et_get_original_footer_credits();
     $disable_custom_credits = et_get_option('disable_custom_footer_credits', false);
     if ($disable_custom_credits) {
         return '';
     }
     $credits_format = '<p id="footer-info">%1$s</p>';
     $footer_credits = et_get_option('custom_footer_credits', '');
     if ('' === trim($footer_credits)) {
         return et_get_safe_localization(sprintf($credits_format, $original_footer_credits));
     }
     return et_get_safe_localization(sprintf($credits_format, $footer_credits));
 }