PATH:
home
/
lab2454c
/
fcxpro.com
/
wp-content
/
plugins
/
webon-core
/
inc
/
blog
<?php if ( ! function_exists( 'webon_core_include_blog_shortcodes' ) ) { /** * Function that includes shortcodes */ function webon_core_include_blog_shortcodes() { foreach ( glob( WEBON_CORE_INC_PATH . '/blog/shortcodes/*/include.php' ) as $shortcode ) { include_once $shortcode; } } add_action( 'qode_framework_action_before_shortcodes_register', 'webon_core_include_blog_shortcodes' ); } if ( ! function_exists( 'webon_core_include_blog_shortcodes_widget' ) ) { /** * Function that includes widgets */ function webon_core_include_blog_shortcodes_widget() { foreach ( glob( WEBON_CORE_INC_PATH . '/blog/shortcodes/*/widget/include.php' ) as $widget ) { include_once $widget; } } add_action( 'qode_framework_action_before_widgets_register', 'webon_core_include_blog_shortcodes_widget' ); } if ( ! function_exists( 'webon_core_set_blog_single_page_title' ) ) { /** * Function that enable/disable page title area for custom post type page * * @param bool $enable_page_title * * @return bool */ function webon_core_set_blog_single_page_title( $enable_page_title ) { if ( is_singular( 'post' ) ) { $option = webon_core_get_post_value_through_levels( 'qodef_blog_single_enable_page_title' ) !== 'no'; if ( isset ( $option ) ) { $enable_page_title = $option; } $meta_option = get_post_meta( get_the_ID(), 'qodef_enable_page_title', true ); if ( ! empty( $meta_option ) ) { $enable_page_title = $meta_option; } } return $enable_page_title; } add_filter( 'webon_filter_enable_page_title', 'webon_core_set_blog_single_page_title' ); } if ( ! function_exists( 'webon_core_set_blog_single_sidebar_layout' ) ) { /** * Function that return sidebar layout * * @param string $layout * * @return string */ function webon_core_set_blog_single_sidebar_layout( $layout ) { if ( is_singular( 'post' ) ) { $option = webon_core_get_post_value_through_levels( 'qodef_blog_single_sidebar_layout' ); if ( ! empty( $option ) ) { $layout = $option; } $meta_option = get_post_meta( get_the_ID(), 'qodef_page_sidebar_layout', true ); if ( ! empty( $meta_option ) ) { $layout = $meta_option; } } return $layout; } add_filter( 'webon_filter_sidebar_layout', 'webon_core_set_blog_single_sidebar_layout' ); } if ( ! function_exists( 'webon_core_set_blog_single_custom_sidebar_name' ) ) { /** * Function that return sidebar name * * @param string $sidebar_name * * @return string */ function webon_core_set_blog_single_custom_sidebar_name( $sidebar_name ) { if ( is_singular( 'post' ) ) { $option = webon_core_get_post_value_through_levels( 'qodef_blog_single_custom_sidebar' ); if ( ! empty( $option ) ) { $sidebar_name = $option; } $meta_option = get_post_meta( get_the_ID(), 'qodef_page_custom_sidebar', true ); if ( ! empty( $meta_option ) ) { $sidebar_name = $meta_option; } } return $sidebar_name; } add_filter( 'webon_filter_sidebar_name', 'webon_core_set_blog_single_custom_sidebar_name' ); } if ( ! function_exists( 'webon_core_set_blog_single_sidebar_grid_gutter_classes' ) ) { /** * Function that returns grid gutter classes * * @param string $classes * * @return string */ function webon_core_set_blog_single_sidebar_grid_gutter_classes( $classes ) { if ( is_singular( 'post' ) ) { $option = webon_core_get_post_value_through_levels( 'qodef_blog_single_sidebar_grid_gutter' ); if ( ! empty( $option ) ) { $classes = 'qodef-gutter--' . esc_attr( $option ); } $meta_option = get_post_meta( get_the_ID(), 'qodef_page_sidebar_grid_gutter', true ); if ( ! empty( $meta_option ) ) { $classes = 'qodef-gutter--' . esc_attr( $meta_option ); } } return $classes; } add_filter( 'webon_filter_grid_gutter_classes', 'webon_core_set_blog_single_sidebar_grid_gutter_classes' ); } if ( ! function_exists( 'webon_core_enable_posts_order' ) ) { /** * Function that enable page attributes options for blog single page */ function webon_core_enable_posts_order() { add_post_type_support( 'post', 'page-attributes' ); } add_action( 'admin_init', 'webon_core_enable_posts_order' ); } if ( ! function_exists( 'webon_core_set_blog_list_excerpt_length' ) ) { /** * Function that set number of characters for excerpt on blog list page * * @param int $excerpt_length * * @return int */ function webon_core_set_blog_list_excerpt_length( $excerpt_length ) { $option = webon_core_get_post_value_through_levels( 'qodef_blog_list_excerpt_number_of_characters' ); if ( $option !== '' ) { $excerpt_length = $option; } return $excerpt_length; } add_filter( 'webon_filter_blog_list_excerpt_length', 'webon_core_set_blog_list_excerpt_length' ); } if ( ! function_exists( 'webon_core_get_allowed_pages_for_blog_sidebar_layout' ) ) { /** * Function that return pages where blog sidebar is allowed * * @return bool */ function webon_core_get_allowed_pages_for_blog_sidebar_layout() { return ( is_archive() || ( is_home() && is_front_page() ) ) && get_post_type() === 'post'; } } if ( ! function_exists( 'webon_core_set_blog_archive_sidebar_layout' ) ) { /** * Function that return sidebar layout * * @param string $layout * * @return string */ function webon_core_set_blog_archive_sidebar_layout( $layout ) { if ( webon_core_get_allowed_pages_for_blog_sidebar_layout() ) { $option = webon_core_get_post_value_through_levels( 'qodef_blog_archive_sidebar_layout' ); if ( ! empty( $option ) ) { $layout = $option; } } return $layout; } add_filter( 'webon_filter_sidebar_layout', 'webon_core_set_blog_archive_sidebar_layout' ); } if ( ! function_exists( 'webon_core_set_blog_archive_custom_sidebar_name' ) ) { /** * Function that return sidebar name * * @param string $sidebar_name * * @return string */ function webon_core_set_blog_archive_custom_sidebar_name( $sidebar_name ) { if ( webon_core_get_allowed_pages_for_blog_sidebar_layout() ) { $option = webon_core_get_post_value_through_levels( 'qodef_blog_archive_custom_sidebar' ); if ( ! empty( $option ) ) { $sidebar_name = $option; } } return $sidebar_name; } add_filter( 'webon_filter_sidebar_name', 'webon_core_set_blog_archive_custom_sidebar_name' ); } if ( ! function_exists( 'webon_core_set_blog_archive_sidebar_grid_gutter_classes' ) ) { /** * Function that returns grid gutter classes * * @param string $classes * * @return string */ function webon_core_set_blog_archive_sidebar_grid_gutter_classes( $classes ) { if ( webon_core_get_allowed_pages_for_blog_sidebar_layout() ) { $option = webon_core_get_post_value_through_levels( 'qodef_blog_single_archive_grid_gutter' ); if ( ! empty( $option ) ) { $classes = 'qodef-gutter--' . esc_attr( $option ); } } return $classes; } add_filter( 'webon_filter_grid_gutter_classes', 'webon_core_set_blog_archive_sidebar_grid_gutter_classes' ); } if ( ! function_exists( 'webon_core_blog_single_set_post_title_instead_of_page_title_text' ) ) { /** * Function that set current post title text for single posts * * @param string $title * * @return string */ function webon_core_blog_single_set_post_title_instead_of_page_title_text( $title ) { $option = webon_core_get_option_value( 'admin', 'qodef_blog_single_set_post_title_in_title_area' ); if ( is_singular( 'post' ) && $option === 'yes' ) { $title = get_the_title( qode_framework_get_page_id() ); } return $title; } add_filter( 'webon_filter_page_title_text', 'webon_core_blog_single_set_post_title_instead_of_page_title_text' ); } if ( ! function_exists( 'webon_core_get_blog_single_post_taxonomies' ) ) { /** * Function that return single post taxonomies list * * @param int $post_id * * @return array */ function webon_core_get_blog_single_post_taxonomies( $post_id ) { $options = array(); if ( ! empty( $post_id ) ) { $options['tag'] = get_the_tags( $post_id ); $options['category'] = get_the_category( $post_id ); } return $options; } } if ( ! function_exists( 'webon_core_add_social_share_after_content' ) ) { /** * Function which add social share for blog single and page */ function webon_core_add_social_share_after_content() { echo '<div class="qodef-e-info-item qodef-e-info-social-share">'; echo WebOnCoreSocialShareShortcode::call_shortcode( array( 'layout' => 'dropdown', 'dropdown_behavior' => 'left' ) ); echo '</div>'; } add_action( 'webon_action_after_blog_bottom_right_content', 'webon_core_add_social_share_after_content' ); } if ( ! function_exists( 'webon_return_svg_share' ) ) { function webon_return_svg_share() { $html = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="15px" height="15px" viewBox="0 0 15 15" style="enable-background:new 0 0 15 15;" xml:space="preserve"> <path fill="currentColor" d="M12.44,10.31c-0.77,0-1.45,0.32-1.92,0.81l-5.55-2.9C5.06,7.99,5.11,7.75,5.11,7.5c0-0.25-0.06-0.49-0.14-0.72l5.55-2.9 c0.47,0.49,1.15,0.81,1.92,0.81c1.41,0,2.56-1.05,2.56-2.34S13.85,0,12.44,0c-1.41,0-2.56,1.05-2.56,2.34 c0,0.25,0.06,0.49,0.14,0.72l-5.55,2.9C4,5.47,3.32,5.16,2.56,5.16C1.15,5.16,0,6.21,0,7.5s1.15,2.34,2.56,2.34 c0.77,0,1.45-0.32,1.92-0.81l5.55,2.9c-0.08,0.23-0.14,0.47-0.14,0.72c0,1.29,1.15,2.34,2.56,2.34c1.41,0,2.56-1.05,2.56-2.34 S13.85,10.31,12.44,10.31z M12.44,0.94c0.85,0,1.53,0.63,1.53,1.41s-0.69,1.41-1.53,1.41s-1.53-0.63-1.53-1.41S11.6,0.94,12.44,0.94 z M2.56,8.91c-0.85,0-1.53-0.63-1.53-1.41s0.69-1.41,1.53-1.41S4.09,6.72,4.09,7.5S3.4,8.91,2.56,8.91z M12.44,14.06 c-0.85,0-1.53-0.63-1.53-1.41s0.69-1.41,1.53-1.41s1.53,0.63,1.53,1.41S13.29,14.06,12.44,14.06z"/> </svg>'; return $html; } } if ( ! function_exists( 'webon_return_svg_pen' ) ) { function webon_return_svg_pen() { $html = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="49px" height="49px" viewBox="0 0 49 49" style="enable-background:new 0 0 49 49;" xml:space="preserve"> <g> <path fill="currentColor" d="M49,4.52c0-0.81-0.33-1.59-0.9-2.16l-1.52-1.5c-1.18-1.16-3.09-1.15-4.27,0.02L39.29,3.9l-1.38-1.4 c-1.02-1.03-2.43-1.62-3.87-1.62c0,0-0.01,0-0.02,0c-1.46,0-2.83,0.57-3.86,1.6l-9.75,9.76c-0.11,0.11-0.17,0.26-0.17,0.42 c0,0.16,0.06,0.31,0.17,0.42c0.22,0.22,0.61,0.22,0.83,0L31,3.32c0.84-0.84,1.93-1.26,3.03-1.26c1.05,0,2.1,0.39,2.93,1.17 l0.47,0.44l-31.97,32C4,37.12,2.91,38.94,2.29,40.91l-2.27,7.32c-0.06,0.21-0.01,0.44,0.15,0.59c0.15,0.16,0.38,0.21,0.59,0.15 l7.31-2.27c1.97-0.61,3.79-1.71,5.25-3.17l32.36-32.39c0.11-0.11,0.17-0.26,0.17-0.42c0-0.16-0.06-0.31-0.17-0.42l-0.63-0.63 l3.04-3C48.67,6.11,49,5.33,49,4.52z M9.96,44.61c-0.71,0.4-1.46,0.72-2.23,0.96l-6.24,1.94l1.94-6.25 c0.24-0.77,0.56-1.53,0.96-2.23l0.41-0.72l5.89,5.9L9.96,44.61z M12.49,42.7c-0.14,0.13-0.27,0.27-0.41,0.39l-0.44,0.4L5.5,37.35 l0.4-0.44c0.13-0.14,0.26-0.28,0.39-0.41l12.99-13l6.2,6.2L12.49,42.7z M26.31,28.87l-6.2-6.2l3.47-3.47l6.2,6.2L26.31,28.87z M30.62,24.56l-6.19-6.2L38.24,4.53l6.19,6.2L30.62,24.56z M47.27,5.84l-3.05,3.01l-4.1-4.1l3.02-3.03C43.86,1,45.03,1,45.75,1.71 v0l1.52,1.5c0.35,0.35,0.55,0.82,0.55,1.32S47.62,5.49,47.27,5.84z"/> </g> </svg>'; return $html; } }
[+]
..
[+]
templates
[+]
shortcodes
[-] include.php
[edit]
[-] helper.php
[edit]
[+]
dashboard