File: /home/boxelikax/public_html/demoltec.com/inc.zip
PK ��]���: : hooks.phpnu �[��� <?php
/**
* Theme hooks.
*
* @package Kava
*/
// Adds the meta viewport to the header.
add_action( 'wp_head', 'kava_meta_viewport', 0 );
// Additional body classes.
add_filter( 'body_class', 'kava_extra_body_classes' );
// Additional image sizes for media gallery.
add_filter( 'image_size_names_choose', 'kava_image_size_names_choose' );
// Modify a comment form.
add_filter( 'comment_form_defaults', 'kava_modify_comment_form' );
// Modify fonts list.
add_filter( 'cx_customizer/fonts_list', 'kava_modify_fonts_list' );
// Disable site content container on specific page/post
add_filter( 'kava-theme/site-content/container-enabled', 'kava_disable_site_content_container', 20 );
// Set default single post template
add_filter( 'get_post_metadata', 'kava_set_default_single_post_template', 10, 4 );
/**
* Adds the meta viewport to the header.
*
* @since 1.0.0
* @return string `<meta>` tag for viewport.
*/
function kava_meta_viewport() {
echo '<meta name="viewport" content="width=device-width, initial-scale=1" />' . "\n";
}
/**
* Add extra body classes
*
* @param array $classes Existing classes.
* @return array
*/
function kava_extra_body_classes( $classes ) {
// Adds a class of group-blog to blogs with more than 1 published author.
if ( is_multi_author() ) {
$classes[] = 'group-blog';
}
// Adds a class of hfeed to non-singular pages.
if ( ! is_singular() ) {
$classes[] = 'hfeed';
}
if ( ! kava_is_top_panel_visible() ) {
$classes[] = 'top-panel-invisible';
}
// Adds a options-based classes.
$options_based_classes = array();
$layout = kava_theme()->customizer->get_value( 'container_type' );
$blog_layout = kava_theme()->customizer->get_value( 'blog_layout_type' );
$sb_position = kava_theme()->sidebar_position;
$sidebar = kava_theme()->customizer->get_value( 'sidebar_width' );
array_push( $options_based_classes, 'layout-' . $layout, 'blog-' . $blog_layout );
if( 'none' !== $sb_position ) {
array_push( $options_based_classes, 'sidebar_enabled', 'position-' . $sb_position, 'sidebar-' . str_replace( '/', '-', $sidebar ) );
}
return array_merge( $classes, $options_based_classes );
}
/**
* Add image sizes for media gallery
*
* @param array $image_sizes
* @return array
*/
function kava_image_size_names_choose( $image_sizes ) {
$image_sizes['post-thumbnail'] = __( 'Post Thumbnail', 'kava' );
return $image_sizes;
}
/**
* Add placeholder attributes for comment form fields.
*
* @param array $args Argumnts for comment form.
* @return array
*/
function kava_modify_comment_form( $args ) {
$args = wp_parse_args( $args );
if ( ! isset( $args['format'] ) ) {
$args['format'] = current_theme_supports( 'html5', 'comment-form' ) ? 'html5' : 'xhtml';
}
$req = get_option( 'require_name_email' );
$aria_req = ( $req ? " aria-required='true'" : '' );
$html_req = ( $req ? " required='required'" : '' );
$html5 = 'html5' === $args['format'];
$commenter = wp_get_current_commenter();
$args['label_submit'] = esc_html__( 'Submit Comment', 'kava' );
$args['fields']['author'] = '<p class="comment-form-author"><input id="author" class="comment-form__field" name="author" type="text" placeholder="' . esc_attr__( 'Name', 'kava' ) . ( $req ? ' *' : '' ) . '" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . $html_req . ' /></p>';
$args['fields']['email'] = '<p class="comment-form-email"><input id="email" class="comment-form__field" name="email" ' . ( $html5 ? 'type="email"' : 'type="text"' ) . ' placeholder="' . esc_attr__( 'E-mail', 'kava' ) . ( $req ? ' *' : '' ) . '" value="' . esc_attr( $commenter['comment_author_email'] ) . '" size="30" aria-describedby="email-notes"' . $aria_req . $html_req . ' /></p>';
$args['fields']['url'] = '<p class="comment-form-url"><input id="url" class="comment-form__field" name="url" ' . ( $html5 ? 'type="url"' : 'type="text"' ) . ' placeholder="' . esc_attr__( 'Website', 'kava' ) . '" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" /></p>';
$args['comment_field'] = '<p class="comment-form-comment"><textarea id="comment" class="comment-form__field" name="comment" placeholder="' . esc_attr__( 'Comments *', 'kava' ) . '" cols="45" rows="7" aria-required="true" required="required"></textarea></p>';
return $args;
}
/**
* Modify fonts list.
*
* @param array $fonts Fonts List.
* @return array
*/
function kava_modify_fonts_list( $fonts = array() ) {
$fonts = array_merge(
array(
'-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif' => esc_html__( 'Default System Font', 'kava' ),
),
$fonts
);
return $fonts;
}
/**
* Disable site content container
*
* @param boolean $enabled
* @return boolean
*/
function kava_disable_site_content_container( $enabled = true ) {
$disable_content_container_archive_cpt = kava_settings()->get( 'disable_content_container_archive_cpt' );
$disable_content_container_single_cpt = kava_settings()->get( 'disable_content_container_single_cpt' );
$post_type = get_post_type();
if ( ( is_archive() || ( is_home() && 'post' === $post_type ) ) && isset( $disable_content_container_archive_cpt[ $post_type ] )
&& filter_var( $disable_content_container_archive_cpt[ $post_type ], FILTER_VALIDATE_BOOLEAN )
) {
return false;
}
if ( is_search() && isset( $disable_content_container_archive_cpt['search_results'] )
&& filter_var( $disable_content_container_archive_cpt['search_results'], FILTER_VALIDATE_BOOLEAN )
) {
return false;
}
if ( is_singular() && isset( $disable_content_container_single_cpt[ $post_type ] )
&& filter_var( $disable_content_container_single_cpt[ $post_type ], FILTER_VALIDATE_BOOLEAN )
) {
return false;
}
if ( is_404() && isset( $disable_content_container_single_cpt['404_page'] )
&& filter_var( $disable_content_container_single_cpt['404_page'], FILTER_VALIDATE_BOOLEAN )
) {
return false;
}
return $enabled;
}
/**
* Set default single post template.
*
* @param $value
* @param $post_id
* @param $meta_key
* @param $single
*
* @return mixed
*/
function kava_set_default_single_post_template( $value, $post_id, $meta_key, $single ) {
if ( '_wp_page_template' !== $meta_key ) {
return $value;
}
if ( is_admin() ) {
return $value;
}
if ( ! is_singular( 'post' ) ) {
return $value;
}
remove_filter( 'get_post_metadata', 'kava_set_default_single_post_template', 10 );
$current_template = get_post_meta( $post_id, '_wp_page_template', true );
add_filter( 'get_post_metadata', 'kava_set_default_single_post_template', 10, 4 );
if ( '' !== $current_template && 'default' !== $current_template ) {
return $value;
}
$global_post_template = kava_settings()->get( 'single_post_template', 'default' );
if ( empty( $global_post_template ) || 'default' === $global_post_template ) {
return $value;
}
return $global_post_template;
}
PK ��]..�� � template-menu.phpnu �[��� <?php
/**
* Menu Template Functions.
*
* @package Kava
*/
/**
* Show main menu.
*
* @since 1.0.0
* @return void
*/
function kava_main_menu() {
$classes[] = 'main-navigation';
?>
<nav id="site-navigation" class="<?php echo join( ' ', $classes ); ?>" role="navigation">
<div class="main-navigation-inner">
<?php
$args = apply_filters( 'kava-theme/menu/main-menu-args', array(
'theme_location' => 'main',
'container' => '',
'menu_id' => 'main-menu',
'fallback_cb' => 'kava_set_nav_menu',
'fallback_message' => esc_html__( 'Set main menu', 'kava' ),
) );
wp_nav_menu( $args );
?>
</div>
</nav><!-- #site-navigation -->
<?php
}
/**
* Show footer menu.
*
* @since 1.0.0
* @return void
*/
function kava_footer_menu() { ?>
<nav id="footer-navigation" class="footer-menu" role="navigation">
<?php
$args = apply_filters( 'kava-theme/menu/footer-menu-args', array(
'theme_location' => 'footer',
'container' => '',
'menu_id' => 'footer-menu-items',
'menu_class' => 'footer-menu__items',
'depth' => 1,
'fallback_cb' => '__return_empty_string',
'fallback_message' => esc_html__( 'Set footer menu', 'kava' ),
) );
wp_nav_menu( $args );
?>
</nav><!-- #footer-navigation -->
<?php
}
/**
* Get social nav menu.
*
* @since 1.0.0
* @since 1.0.1 Added arguments to the filter.
* @param string $context Current post context - 'single' or 'loop'.
* @param string $type Content type - icon, text or both.
* @return string
*/
function kava_get_social_list( $context, $type = 'icon' ) {
static $instance = 0;
$instance++;
$container_class = array( 'social-list' );
if ( ! empty( $context ) ) {
$container_class[] = sprintf( 'social-list--%s', sanitize_html_class( $context ) );
}
$container_class[] = sprintf( 'social-list--%s', sanitize_html_class( $type ) );
$args = apply_filters( 'kava-theme/social/list-args', array(
'theme_location' => 'social',
'container' => 'div',
'container_class' => join( ' ', $container_class ),
'menu_id' => "social-list-{$instance}",
'menu_class' => 'social-list__items inline-list',
'depth' => 1,
'link_before' => ( 'icon' == $type ) ? '<span class="screen-reader-text">' : '',
'link_after' => ( 'icon' == $type ) ? '</span>' : '',
'echo' => false,
'fallback_cb' => 'kava_set_nav_menu',
'fallback_message' => esc_html__( 'Set social menu', 'kava' ),
), $context, $type );
return wp_nav_menu( $args );
}
/**
* Set callback function for nav menu.
*
* @param array $args Nav menu arguments.
* @return void
*/
function kava_set_nav_menu( $args ) {
if ( ! current_user_can( 'edit_theme_options' ) ) {
return null;
}
$format = '<div class="set-menu %3$s"><a href="%2$s" target="_blank" class="set-menu_link">%1$s</a></div>';
$label = $args['fallback_message'];
$url = esc_url( admin_url( 'nav-menus.php' ) );
printf( $format, $label, $url, $args['container_class'] );
}
PK ��]�:�T� � context.phpnu �[��� <?php
/**
* Contextual functions for the header, footer, content and sidebar classes.
*
* @package Kava
*/
/**
* Retrieve a CSS class attribute for container based on `Page Layout Type` option.
*
* @since 1.0.0
* @param string $classes Additional classes.
* @return string
*/
function kava_get_container_classes( $classes = null, $fullwidth = false ) {
if ( $classes ) {
$classes .= ' ';
}
if ( ! apply_filters( 'kava-theme/site/fullwidth', $fullwidth ) ) {
$layout_type = kava_theme()->customizer->get_value( 'container_type' );
if ( 'boxed' == $layout_type ) {
$classes .= 'container';
}
}
return 'class="' . $classes . '"';
}
/**
* Prints site header container CSS classes
*
* @since 1.0.0
* @param string $classes Additional classes.
* @return void
*/
function kava_header_class( $classes = null ) {
if ( $classes ) {
$classes .= ' ';
}
$classes .= 'site-header__wrap';
$site_header_container = apply_filters(
'kava-theme/site-header/container-enabled',
true
);
if ( $site_header_container ) {
$classes .= ' container';
}
$sticky = kava_theme()->customizer->get_value( 'is_sticky_mode' );
if ( $sticky ) {
$classes .= 'header-sticky';
}
echo 'class="' . apply_filters( 'kava-theme/site-header/content-classes', $classes ) . '"';
}
/**
* Prints site breadcrumbs container CSS classes
*
* @since 1.0.0
* @param string $classes Additional classes.
* @return void
*/
function kava_breadcrumbs_class( $classes = null ) {
if ( $classes ) {
$classes .= ' ';
}
$classes .= 'site-breadcrumbs__wrap';
$site_breadcrumbs_container = apply_filters(
'kava-theme/site-breadcrumbs/container-enabled',
true
);
if ( $site_breadcrumbs_container ) {
$classes .= ' container';
}
echo 'class="' . apply_filters( 'kava-theme/site-breadcrumbs/content-classes', $classes ) . '"';
}
/**
* Prints site content container CSS classes
*
* @since 1.0.0
* @return string
*/
function kava_content_class( $classes = null ) {
if ( $classes ) {
$classes .= ' ';
}
$classes .= 'site-content__wrap';
$site_content_container = apply_filters( 'kava-theme/site-content/container-enabled', true );
if ( $site_content_container ) {
$classes .= ' container';
}
echo 'class="' . apply_filters( 'kava-theme/site-content/content-classes', $classes ) . '"';
}
/**
* Prints site footer container CSS classes
*
* @since 1.0.0
* @return string
*/
function kava_footer_class( $classes = null ) {
if ( $classes ) {
$classes .= ' ';
}
$classes .= 'site-footer__wrap';
$site_content_container = apply_filters( 'kava-theme/site-footer/container-enabled', true );
if ( $site_content_container ) {
$classes .= ' container';
}
echo 'class="' . apply_filters( 'kava-theme/site-footer/content-classes', $classes ) . '"';
}
/**
* Prints primary content wrapper CSS classes.
*
* @since 1.0.0
* @param array $classes Additional classes.
* @return void
*/
function kava_primary_content_class( $classes = array() ) {
echo kava_get_layout_classes( 'content', $classes );
}
/**
* Prints secondary content wrapper CSS classes.
*
* @since 1.0.0
* @param array $classes Additional classes.
* @return void
*/
function kava_secondary_content_class( $classes = array() ) {
echo kava_get_layout_classes( 'sidebar', $classes );
}
/**
* Get CSS class attribute for passed layout context.
*
* @since 1.0.0
* @param string $layout Layout context.
* @param array $classes Additional classes.
* @return string
*/
function kava_get_layout_classes( $layout = 'content', $classes = array() ) {
$sidebar_position = kava_theme()->sidebar_position;
$sidebar_width = kava_theme()->customizer->get_value( 'sidebar_width' );
if ( 'none' === $sidebar_position || !is_active_sidebar( 'sidebar' ) ) {
$sidebar_position = is_singular( 'post' ) ? 'single-post-fullwidth' : 'fullwidth';
$sidebar_width = 0;
}
$layout_classes = ! empty( kava_theme()->layout[ $sidebar_position ][ $sidebar_width ][ $layout ] ) ? kava_theme()->layout[ $sidebar_position ][ $sidebar_width ][ $layout ] : array();
if ( ! empty( $classes ) ) {
$layout_classes = array_merge( $layout_classes, $classes );
}
if ( empty( $layout_classes ) ) {
return '';
}
$layout_classes = apply_filters( "kava-theme/wrapper/{$layout}_classes", $layout_classes );
return 'class="' . join( ' ', $layout_classes ) . '"';
}
/**
* Retrieve or print `class` attribute for Post List wrapper.
*
* @since 1.0.0
* @param string $classes Additional classes.
* @return string|void
*/
function kava_posts_list_class( $classes = null ) {
if ( $classes ) {
$classes .= ' ';
}
$classes .= 'posts-list';
echo 'class="' . apply_filters( 'kava-theme/posts/list-class', $classes ) . '"';
}
/**
* Prints site header CSS classes.
*
* @since 1.0.0
* @param array $classes Additional classes.
* @return void
*/
function kava_site_branding_class( $classes = array() ) {
$classes[] = 'site-branding';
echo 'class="' . join( ' ', $classes ) . '"';
}
PK ��]셔�� �� customizer.phpnu �[��� <?php
/**
* Theme Customizer.
*
* @package Kava
*/
/**
* Retrieve a holder for Customizer options.
*
* @since 1.0.0
* @return array
*/
function kava_get_customizer_options() {
/**
* Filter a holder for Customizer options (for theme/plugin developer customization).
*
* @since 1.0.0
*/
return apply_filters( 'kava-theme/customizer/options' , array(
'prefix' => 'kava',
'path' => get_theme_file_path( 'framework/modules/customizer/' ),
'capability' => 'edit_theme_options',
'type' => 'theme_mod',
'fonts_manager' => new CX_Fonts_Manager(),
'options' => array(
/** `Site Indentity` section */
'show_tagline' => array(
'title' => esc_html__( 'Show tagline on top panel', 'kava' ),
'section' => 'title_tagline',
'priority' => 60,
'default' => true,
'field' => 'checkbox',
'type' => 'control',
),
'page_preloader' => array(
'title' => esc_html__( 'Show page preloader', 'kava' ),
'section' => 'title_tagline',
'priority' => 62,
'default' => true,
'field' => 'checkbox',
'type' => 'control',
),
'general_settings' => array(
'title' => esc_html__( 'General Site settings', 'kava' ),
'priority' => 40,
'type' => 'panel',
),
/** `Favicon` section */
'favicon' => array(
'title' => esc_html__( 'Favicon', 'kava' ),
'priority' => 10,
'panel' => 'general_settings',
'type' => 'section',
),
/** `Social links` section */
'social_links' => array(
'title' => esc_html__( 'Social links', 'kava' ),
'priority' => 40,
'type' => 'section',
'panel' => 'general_settings',
),
'header_social_links' => array(
'title' => esc_html__( 'Show social links in header', 'kava' ),
'section' => 'social_links',
'default' => true,
'field' => 'checkbox',
'type' => 'control',
),
'footer_social_links' => array(
'title' => esc_html__( 'Show social links in footer', 'kava' ),
'section' => 'social_links',
'default' => true,
'field' => 'checkbox',
'type' => 'control',
),
/** `Page Layout` section */
'page_layout' => array(
'title' => esc_html__( 'Page Layout', 'kava' ),
'priority' => 20,
'type' => 'section',
'panel' => 'general_settings',
),
'container_type' => array(
'title' => esc_html__( 'Container type', 'kava' ),
'section' => 'page_layout',
'default' => 'fullwidth',
'field' => 'select',
'choices' => array(
'boxed' => esc_html__( 'Boxed', 'kava' ),
'fullwidth' => esc_html__( 'Fullwidth', 'kava' ),
),
'type' => 'control',
),
'sidebar_width' => array(
'title' => esc_html__( 'Sidebar width', 'kava' ),
'section' => 'page_layout',
'default' => '1/3',
'field' => 'select',
'choices' => array(
'1/3' => '1/3',
'1/4' => '1/4',
),
'sanitize_callback' => 'sanitize_text_field',
'type' => 'control',
),
'show_page_title' => array(
'title' => esc_html__( 'Show Page Title', 'kava' ),
'section' => 'page_layout',
'default' => true,
'field' => 'checkbox',
'type' => 'control',
),
'show_archive_title' => array(
'title' => esc_html__( 'Show Archive Title', 'kava' ),
'section' => 'page_layout',
'default' => true,
'field' => 'checkbox',
'type' => 'control',
),
'show_archive_desc' => array(
'title' => esc_html__( 'Show Archive Description', 'kava' ),
'section' => 'page_layout',
'default' => true,
'field' => 'checkbox',
'type' => 'control',
),
/** `ToTop button` section */
'totop_button' => array(
'title' => esc_html__( 'ToTop button', 'kava' ),
'priority' => 60,
'type' => 'section',
'panel' => 'general_settings',
),
'totop_visibility' => array(
'title' => esc_html__( 'Show ToTop button', 'kava' ),
'section' => 'totop_button',
'default' => true,
'field' => 'checkbox',
'type' => 'control',
),
'totop_vertical_padding' => array(
'title' => esc_html__( 'Vertical Padding, px', 'kava' ),
'section' => 'totop_button',
'default' => '0',
'field' => 'number',
'input_attrs' => array(
'min' => 0,
'max' => 100,
'step' => 1,
),
'type' => 'control',
'active_callback' => 'kava_is_totop_enable',
),
'totop_horizontal_padding' => array(
'title' => esc_html__( 'Horizontal Padding, px', 'kava' ),
'section' => 'totop_button',
'default' => '0',
'field' => 'number',
'input_attrs' => array(
'min' => 0,
'max' => 100,
'step' => 1,
),
'type' => 'control',
'active_callback' => 'kava_is_totop_enable',
),
'totop_border_radius' => array(
'title' => esc_html__( 'Border Radius, px', 'kava' ),
'section' => 'totop_button',
'default' => '0',
'field' => 'number',
'input_attrs' => array(
'min' => 0,
'max' => 200,
'step' => 1,
),
'type' => 'control',
'active_callback' => 'kava_is_totop_enable',
),
'totop_bg_color' => array(
'title' => esc_html__( 'Background Color', 'kava' ),
'section' => 'totop_button',
'default' => false,
'field' => 'hex_color',
'type' => 'control',
'active_callback' => 'kava_is_totop_enable',
),
'totop_icon_color' => array(
'title' => esc_html__( 'Icon Color', 'kava' ),
'section' => 'totop_button',
'default' => false,
'field' => 'hex_color',
'type' => 'control',
'active_callback' => 'kava_is_totop_enable',
),
'totop_bg_color_hover' => array(
'title' => esc_html__( 'Background Color Hover', 'kava' ),
'section' => 'totop_button',
'default' => false,
'field' => 'hex_color',
'type' => 'control',
'active_callback' => 'kava_is_totop_enable',
),
'totop_icon_color_hover' => array(
'title' => esc_html__( 'Icon Color Hover', 'kava' ),
'section' => 'totop_button',
'default' => false,
'field' => 'hex_color',
'type' => 'control',
'active_callback' => 'kava_is_totop_enable',
),
/** `Color Scheme` panel */
'color_scheme' => array(
'title' => esc_html__( 'Color Scheme', 'kava' ),
'description' => esc_html__( 'Configure Color Scheme', 'kava' ),
'priority' => 40,
'type' => 'section',
),
'accent_color' => array(
'title' => esc_html__( 'Accent color', 'kava' ),
'section' => 'color_scheme',
'default' => '#398ffc',
'field' => 'hex_color',
'type' => 'control',
),
'primary_text_color' => array(
'title' => esc_html__( 'Primary Text color', 'kava' ),
'section' => 'color_scheme',
'default' => '#3b3d42',
'field' => 'hex_color',
'type' => 'control',
),
'secondary_text_color' => array(
'title' => esc_html__( 'Secondary Text color', 'kava' ),
'section' => 'color_scheme',
'default' => '#a1a2a4',
'field' => 'hex_color',
'type' => 'control',
),
'invert_text_color' => array(
'title' => esc_html__( 'Invert Text color', 'kava' ),
'section' => 'color_scheme',
'default' => '#ffffff',
'field' => 'hex_color',
'type' => 'control',
),
'link_color' => array(
'title' => esc_html__( 'Link color', 'kava' ),
'section' => 'color_scheme',
'default' => '#398ffc',
'field' => 'hex_color',
'type' => 'control',
),
'link_hover_color' => array(
'title' => esc_html__( 'Link hover color', 'kava' ),
'section' => 'color_scheme',
'default' => '#3b3d42',
'field' => 'hex_color',
'type' => 'control',
),
'h1_color' => array(
'title' => esc_html__( 'H1 color', 'kava' ),
'section' => 'color_scheme',
'default' => '#3b3d42',
'field' => 'hex_color',
'type' => 'control',
),
'h2_color' => array(
'title' => esc_html__( 'H2 color', 'kava' ),
'section' => 'color_scheme',
'default' => '#3b3d42',
'field' => 'hex_color',
'type' => 'control',
),
'h3_color' => array(
'title' => esc_html__( 'H3 color', 'kava' ),
'section' => 'color_scheme',
'default' => '#3b3d42',
'field' => 'hex_color',
'type' => 'control',
),
'h4_color' => array(
'title' => esc_html__( 'H4 color', 'kava' ),
'section' => 'color_scheme',
'default' => '#3b3d42',
'field' => 'hex_color',
'type' => 'control',
),
'h5_color' => array(
'title' => esc_html__( 'H5 color', 'kava' ),
'section' => 'color_scheme',
'default' => '#3b3d42',
'field' => 'hex_color',
'type' => 'control',
),
'h6_color' => array(
'title' => esc_html__( 'H6 color', 'kava' ),
'section' => 'color_scheme',
'default' => '#3b3d42',
'field' => 'hex_color',
'type' => 'control',
),
/** `Typography Settings` panel */
'typography' => array(
'title' => esc_html__( 'Typography', 'kava' ),
'description' => esc_html__( 'Configure typography settings', 'kava' ),
'priority' => 45,
'type' => 'panel',
),
/** `Body text` section */
'body_typography' => array(
'title' => esc_html__( 'Body text', 'kava' ),
'priority' => 5,
'panel' => 'typography',
'type' => 'section',
),
'body_font_family' => array(
'title' => esc_html__( 'Font Family', 'kava' ),
'section' => 'body_typography',
'default' => 'Roboto, sans-serif',
'field' => 'fonts',
'type' => 'control',
),
'body_font_style' => array(
'title' => esc_html__( 'Font Style', 'kava' ),
'section' => 'body_typography',
'default' => 'normal',
'field' => 'select',
'choices' => kava_get_font_styles(),
'type' => 'control',
),
'body_font_weight' => array(
'title' => esc_html__( 'Font Weight', 'kava' ),
'section' => 'body_typography',
'default' => '300',
'field' => 'select',
'choices' => kava_get_font_weight(),
'type' => 'control',
),
'body_font_size' => array(
'title' => esc_html__( 'Font Size, px', 'kava' ),
'section' => 'body_typography',
'default' => '14',
'field' => 'number',
'input_attrs' => array(
'min' => 6,
'max' => 50,
'step' => 1,
),
'type' => 'control',
),
'body_line_height' => array(
'title' => esc_html__( 'Line Height', 'kava' ),
'description' => esc_html__( 'Relative to the font-size of the element', 'kava' ),
'section' => 'body_typography',
'default' => '1.6',
'field' => 'number',
'input_attrs' => array(
'min' => 1.0,
'max' => 3.0,
'step' => 0.1,
),
'type' => 'control',
),
'body_letter_spacing' => array(
'title' => esc_html__( 'Letter Spacing, px', 'kava' ),
'section' => 'body_typography',
'default' => '0',
'field' => 'number',
'input_attrs' => array(
'min' => -10,
'max' => 10,
'step' => 1,
),
'type' => 'control',
),
'body_character_set' => array(
'title' => esc_html__( 'Character Set', 'kava' ),
'section' => 'body_typography',
'default' => 'latin',
'field' => 'select',
'choices' => kava_get_character_sets(),
'type' => 'control',
),
'body_text_align' => array(
'title' => esc_html__( 'Text Align', 'kava' ),
'section' => 'body_typography',
'default' => 'left',
'field' => 'select',
'choices' => kava_get_text_aligns(),
'type' => 'control',
),
/** `H1 Heading` section */
'h1_typography' => array(
'title' => esc_html__( 'H1 Heading', 'kava' ),
'priority' => 10,
'panel' => 'typography',
'type' => 'section',
),
'h1_font_family' => array(
'title' => esc_html__( 'Font Family', 'kava' ),
'section' => 'h1_typography',
'default' => 'Roboto, sans-serif',
'field' => 'fonts',
'type' => 'control',
),
'h1_font_style' => array(
'title' => esc_html__( 'Font Style', 'kava' ),
'section' => 'h1_typography',
'default' => 'normal',
'field' => 'select',
'choices' => kava_get_font_styles(),
'type' => 'control',
),
'h1_font_weight' => array(
'title' => esc_html__( 'Font Weight', 'kava' ),
'section' => 'h1_typography',
'default' => '400',
'field' => 'select',
'choices' => kava_get_font_weight(),
'type' => 'control',
),
'h1_font_size' => array(
'title' => esc_html__( 'Font Size, px', 'kava' ),
'section' => 'h1_typography',
'default' => '56',
'field' => 'number',
'input_attrs' => array(
'min' => 10,
'max' => 200,
'step' => 1,
),
'type' => 'control',
),
'h1_line_height' => array(
'title' => esc_html__( 'Line Height', 'kava' ),
'description' => esc_html__( 'Relative to the font-size of the element', 'kava' ),
'section' => 'h1_typography',
'default' => '1.4',
'field' => 'number',
'input_attrs' => array(
'min' => 1.0,
'max' => 3.0,
'step' => 0.1,
),
'type' => 'control',
),
'h1_letter_spacing' => array(
'title' => esc_html__( 'Letter Spacing, px', 'kava' ),
'section' => 'h1_typography',
'default' => '0',
'field' => 'number',
'input_attrs' => array(
'min' => -10,
'max' => 10,
'step' => 1,
),
'type' => 'control',
),
'h1_character_set' => array(
'title' => esc_html__( 'Character Set', 'kava' ),
'section' => 'h1_typography',
'default' => 'latin',
'field' => 'select',
'choices' => kava_get_character_sets(),
'type' => 'control',
),
'h1_text_align' => array(
'title' => esc_html__( 'Text Align', 'kava' ),
'section' => 'h1_typography',
'default' => 'inherit',
'field' => 'select',
'choices' => kava_get_text_aligns(),
'type' => 'control',
),
/** `H2 Heading` section */
'h2_typography' => array(
'title' => esc_html__( 'H2 Heading', 'kava' ),
'priority' => 15,
'panel' => 'typography',
'type' => 'section',
),
'h2_font_family' => array(
'title' => esc_html__( 'Font Family', 'kava' ),
'section' => 'h2_typography',
'default' => 'Roboto, sans-serif',
'field' => 'fonts',
'type' => 'control',
),
'h2_font_style' => array(
'title' => esc_html__( 'Font Style', 'kava' ),
'section' => 'h2_typography',
'default' => 'normal',
'field' => 'select',
'choices' => kava_get_font_styles(),
'type' => 'control',
),
'h2_font_weight' => array(
'title' => esc_html__( 'Font Weight', 'kava' ),
'section' => 'h2_typography',
'default' => '400',
'field' => 'select',
'choices' => kava_get_font_weight(),
'type' => 'control',
),
'h2_font_size' => array(
'title' => esc_html__( 'Font Size, px', 'kava' ),
'section' => 'h2_typography',
'default' => '40',
'field' => 'number',
'input_attrs' => array(
'min' => 10,
'max' => 200,
'step' => 1,
),
'type' => 'control',
),
'h2_line_height' => array(
'title' => esc_html__( 'Line Height', 'kava' ),
'description' => esc_html__( 'Relative to the font-size of the element', 'kava' ),
'section' => 'h2_typography',
'default' => '1.4',
'field' => 'number',
'input_attrs' => array(
'min' => 1.0,
'max' => 3.0,
'step' => 0.1,
),
'type' => 'control',
),
'h2_letter_spacing' => array(
'title' => esc_html__( 'Letter Spacing, px', 'kava' ),
'section' => 'h2_typography',
'default' => '0',
'field' => 'number',
'input_attrs' => array(
'min' => -10,
'max' => 10,
'step' => 1,
),
'type' => 'control',
),
'h2_character_set' => array(
'title' => esc_html__( 'Character Set', 'kava' ),
'section' => 'h2_typography',
'default' => 'latin',
'field' => 'select',
'choices' => kava_get_character_sets(),
'type' => 'control',
),
'h2_text_align' => array(
'title' => esc_html__( 'Text Align', 'kava' ),
'section' => 'h2_typography',
'default' => 'inherit',
'field' => 'select',
'choices' => kava_get_text_aligns(),
'type' => 'control',
),
/** `H3 Heading` section */
'h3_typography' => array(
'title' => esc_html__( 'H3 Heading', 'kava' ),
'priority' => 20,
'panel' => 'typography',
'type' => 'section',
),
'h3_font_family' => array(
'title' => esc_html__( 'Font Family', 'kava' ),
'section' => 'h3_typography',
'default' => 'Roboto, sans-serif',
'field' => 'fonts',
'type' => 'control',
),
'h3_font_style' => array(
'title' => esc_html__( 'Font Style', 'kava' ),
'section' => 'h3_typography',
'default' => 'normal',
'field' => 'select',
'choices' => kava_get_font_styles(),
'type' => 'control',
),
'h3_font_weight' => array(
'title' => esc_html__( 'Font Weight', 'kava' ),
'section' => 'h3_typography',
'default' => '400',
'field' => 'select',
'choices' => kava_get_font_weight(),
'type' => 'control',
),
'h3_font_size' => array(
'title' => esc_html__( 'Font Size, px', 'kava' ),
'section' => 'h3_typography',
'default' => '28',
'field' => 'number',
'input_attrs' => array(
'min' => 10,
'max' => 200,
'step' => 1,
),
'type' => 'control',
),
'h3_line_height' => array(
'title' => esc_html__( 'Line Height', 'kava' ),
'description' => esc_html__( 'Relative to the font-size of the element', 'kava' ),
'section' => 'h3_typography',
'default' => '1.4',
'field' => 'number',
'input_attrs' => array(
'min' => 1.0,
'max' => 3.0,
'step' => 0.1,
),
'type' => 'control',
),
'h3_letter_spacing' => array(
'title' => esc_html__( 'Letter Spacing, px', 'kava' ),
'section' => 'h3_typography',
'default' => '0',
'field' => 'number',
'input_attrs' => array(
'min' => -10,
'max' => 10,
'step' => 1,
),
'type' => 'control',
),
'h3_character_set' => array(
'title' => esc_html__( 'Character Set', 'kava' ),
'section' => 'h3_typography',
'default' => 'latin',
'field' => 'select',
'choices' => kava_get_character_sets(),
'type' => 'control',
),
'h3_text_align' => array(
'title' => esc_html__( 'Text Align', 'kava' ),
'section' => 'h3_typography',
'default' => 'inherit',
'field' => 'select',
'choices' => kava_get_text_aligns(),
'type' => 'control',
),
/** `H4 Heading` section */
'h4_typography' => array(
'title' => esc_html__( 'H4 Heading', 'kava' ),
'priority' => 25,
'panel' => 'typography',
'type' => 'section',
),
'h4_font_family' => array(
'title' => esc_html__( 'Font Family', 'kava' ),
'section' => 'h4_typography',
'default' => 'Roboto, sans-serif',
'field' => 'fonts',
'type' => 'control',
),
'h4_font_style' => array(
'title' => esc_html__( 'Font Style', 'kava' ),
'section' => 'h4_typography',
'default' => 'normal',
'field' => 'select',
'choices' => kava_get_font_styles(),
'type' => 'control',
),
'h4_font_weight' => array(
'title' => esc_html__( 'Font Weight', 'kava' ),
'section' => 'h4_typography',
'default' => '400',
'field' => 'select',
'choices' => kava_get_font_weight(),
'type' => 'control',
),
'h4_font_size' => array(
'title' => esc_html__( 'Font Size, px', 'kava' ),
'section' => 'h4_typography',
'default' => '20',
'field' => 'number',
'input_attrs' => array(
'min' => 10,
'max' => 200,
'step' => 1,
),
'type' => 'control',
),
'h4_line_height' => array(
'title' => esc_html__( 'Line Height', 'kava' ),
'description' => esc_html__( 'Relative to the font-size of the element', 'kava' ),
'section' => 'h4_typography',
'default' => '1.5',
'field' => 'number',
'input_attrs' => array(
'min' => 1.0,
'max' => 3.0,
'step' => 0.1,
),
'type' => 'control',
),
'h4_letter_spacing' => array(
'title' => esc_html__( 'Letter Spacing, px', 'kava' ),
'section' => 'h4_typography',
'default' => '0',
'field' => 'number',
'input_attrs' => array(
'min' => -10,
'max' => 10,
'step' => 1,
),
'type' => 'control',
),
'h4_character_set' => array(
'title' => esc_html__( 'Character Set', 'kava' ),
'section' => 'h4_typography',
'default' => 'latin',
'field' => 'select',
'choices' => kava_get_character_sets(),
'type' => 'control',
),
'h4_text_align' => array(
'title' => esc_html__( 'Text Align', 'kava' ),
'section' => 'h4_typography',
'default' => 'inherit',
'field' => 'select',
'choices' => kava_get_text_aligns(),
'type' => 'control',
),
/** `H5 Heading` section */
'h5_typography' => array(
'title' => esc_html__( 'H5 Heading', 'kava' ),
'priority' => 30,
'panel' => 'typography',
'type' => 'section',
),
'h5_font_family' => array(
'title' => esc_html__( 'Font Family', 'kava' ),
'section' => 'h5_typography',
'default' => 'Roboto, sans-serif',
'field' => 'fonts',
'type' => 'control',
),
'h5_font_style' => array(
'title' => esc_html__( 'Font Style', 'kava' ),
'section' => 'h5_typography',
'default' => 'normal',
'field' => 'select',
'choices' => kava_get_font_styles(),
'type' => 'control',
),
'h5_font_weight' => array(
'title' => esc_html__( 'Font Weight', 'kava' ),
'section' => 'h5_typography',
'default' => '300',
'field' => 'select',
'choices' => kava_get_font_weight(),
'type' => 'control',
),
'h5_font_size' => array(
'title' => esc_html__( 'Font Size, px', 'kava' ),
'section' => 'h5_typography',
'default' => '18',
'field' => 'number',
'input_attrs' => array(
'min' => 10,
'max' => 200,
'step' => 1,
),
'type' => 'control',
),
'h5_line_height' => array(
'title' => esc_html__( 'Line Height', 'kava' ),
'description' => esc_html__( 'Relative to the font-size of the element', 'kava' ),
'section' => 'h5_typography',
'default' => '1.5',
'field' => 'number',
'input_attrs' => array(
'min' => 1.0,
'max' => 3.0,
'step' => 0.1,
),
'type' => 'control',
),
'h5_letter_spacing' => array(
'title' => esc_html__( 'Letter Spacing, px', 'kava' ),
'section' => 'h5_typography',
'default' => '0',
'field' => 'number',
'input_attrs' => array(
'min' => -10,
'max' => 10,
'step' => 1,
),
'type' => 'control',
),
'h5_character_set' => array(
'title' => esc_html__( 'Character Set', 'kava' ),
'section' => 'h5_typography',
'default' => 'latin',
'field' => 'select',
'choices' => kava_get_character_sets(),
'type' => 'control',
),
'h5_text_align' => array(
'title' => esc_html__( 'Text Align', 'kava' ),
'section' => 'h5_typography',
'default' => 'inherit',
'field' => 'select',
'choices' => kava_get_text_aligns(),
'type' => 'control',
),
/** `H6 Heading` section */
'h6_typography' => array(
'title' => esc_html__( 'H6 Heading', 'kava' ),
'priority' => 35,
'panel' => 'typography',
'type' => 'section',
),
'h6_font_family' => array(
'title' => esc_html__( 'Font Family', 'kava' ),
'section' => 'h6_typography',
'default' => 'Roboto, sans-serif',
'field' => 'fonts',
'type' => 'control',
),
'h6_font_style' => array(
'title' => esc_html__( 'Font Style', 'kava' ),
'section' => 'h6_typography',
'default' => 'normal',
'field' => 'select',
'choices' => kava_get_font_styles(),
'type' => 'control',
),
'h6_font_weight' => array(
'title' => esc_html__( 'Font Weight', 'kava' ),
'section' => 'h6_typography',
'default' => '500',
'field' => 'select',
'choices' => kava_get_font_weight(),
'type' => 'control',
),
'h6_font_size' => array(
'title' => esc_html__( 'Font Size, px', 'kava' ),
'section' => 'h6_typography',
'default' => '14',
'field' => 'number',
'input_attrs' => array(
'min' => 10,
'max' => 200,
'step' => 1,
),
'type' => 'control',
),
'h6_line_height' => array(
'title' => esc_html__( 'Line Height', 'kava' ),
'description' => esc_html__( 'Relative to the font-size of the element', 'kava' ),
'section' => 'h6_typography',
'default' => '1.5',
'field' => 'number',
'input_attrs' => array(
'min' => 1.0,
'max' => 3.0,
'step' => 0.1,
),
'type' => 'control',
),
'h6_letter_spacing' => array(
'title' => esc_html__( 'Letter Spacing, px', 'kava' ),
'section' => 'h6_typography',
'default' => '0',
'field' => 'number',
'input_attrs' => array(
'min' => -10,
'max' => 10,
'step' => 1,
),
'type' => 'control',
),
'h6_character_set' => array(
'title' => esc_html__( 'Character Set', 'kava' ),
'section' => 'h6_typography',
'default' => 'latin',
'field' => 'select',
'choices' => kava_get_character_sets(),
'type' => 'control',
),
'h6_text_align' => array(
'title' => esc_html__( 'Text Align', 'kava' ),
'section' => 'h6_typography',
'default' => 'inherit',
'field' => 'select',
'choices' => kava_get_text_aligns(),
'type' => 'control',
),
/** `Logo text` section */
'logo_typography' => array(
'title' => esc_html__( 'Logo text', 'kava' ),
'priority' => 40,
'panel' => 'typography',
'type' => 'section',
),
'header_logo_font_family' => array(
'title' => esc_html__( 'Font Family', 'kava' ),
'section' => 'logo_typography',
'default' => 'Montserrat, sans-serif',
'field' => 'fonts',
'type' => 'control',
),
'header_logo_font_style' => array(
'title' => esc_html__( 'Font Style', 'kava' ),
'section' => 'logo_typography',
'default' => 'normal',
'field' => 'select',
'choices' => kava_get_font_styles(),
'type' => 'control',
),
'header_logo_font_weight' => array(
'title' => esc_html__( 'Font Weight', 'kava' ),
'section' => 'logo_typography',
'default' => '700',
'field' => 'select',
'choices' => kava_get_font_weight(),
'type' => 'control',
),
'header_logo_font_size' => array(
'title' => esc_html__( 'Font Size, px', 'kava' ),
'section' => 'logo_typography',
'default' => '26',
'field' => 'number',
'input_attrs' => array(
'min' => 6,
'max' => 50,
'step' => 1,
),
'type' => 'control',
),
'header_logo_character_set' => array(
'title' => esc_html__( 'Character Set', 'kava' ),
'section' => 'logo_typography',
'default' => 'latin',
'field' => 'select',
'choices' => kava_get_character_sets(),
'type' => 'control',
),
/** `Menu` section */
'menu_typography' => array(
'title' => esc_html__( 'Menu', 'kava' ),
'priority' => 45,
'panel' => 'typography',
'type' => 'section',
),
'menu_font_family' => array(
'title' => esc_html__( 'Font Family', 'kava' ),
'section' => 'menu_typography',
'default' => 'Roboto, sans-serif',
'field' => 'fonts',
'type' => 'control',
),
'menu_font_style' => array(
'title' => esc_html__( 'Font Style', 'kava' ),
'section' => 'menu_typography',
'default' => 'normal',
'field' => 'select',
'choices' => kava_get_font_styles(),
'type' => 'control',
),
'menu_font_weight' => array(
'title' => esc_html__( 'Font Weight', 'kava' ),
'section' => 'menu_typography',
'default' => '400',
'field' => 'select',
'choices' => kava_get_font_weight(),
'type' => 'control',
),
'menu_font_size' => array(
'title' => esc_html__( 'Font Size, px', 'kava' ),
'section' => 'menu_typography',
'default' => '14',
'field' => 'number',
'input_attrs' => array(
'min' => 6,
'max' => 50,
'step' => 1,
),
'type' => 'control',
),
'menu_line_height' => array(
'title' => esc_html__( 'Line Height', 'kava' ),
'description' => esc_html__( 'Relative to the font-size of the element', 'kava' ),
'section' => 'menu_typography',
'default' => '1.4',
'field' => 'number',
'input_attrs' => array(
'min' => 1.0,
'max' => 3.0,
'step' => 0.1,
),
'type' => 'control',
),
'menu_letter_spacing' => array(
'title' => esc_html__( 'Letter Spacing, px', 'kava' ),
'section' => 'menu_typography',
'default' => '0',
'field' => 'number',
'input_attrs' => array(
'min' => -10,
'max' => 10,
'step' => 1,
),
'type' => 'control',
),
'menu_character_set' => array(
'title' => esc_html__( 'Character Set', 'kava' ),
'section' => 'menu_typography',
'default' => 'latin',
'field' => 'select',
'choices' => kava_get_character_sets(),
'type' => 'control',
),
/** `Breadcrumbs` section */
'breadcrumbs_typography' => array(
'title' => esc_html__( 'Breadcrumbs', 'kava' ),
'priority' => 50,
'panel' => 'typography',
'type' => 'section',
'active_callback' => '__return_false',
),
'breadcrumbs_font_family' => array(
'title' => esc_html__( 'Font Family', 'kava' ),
'section' => 'breadcrumbs_typography',
'default' => 'Roboto, sans-serif',
'field' => 'fonts',
'type' => 'control',
),
'breadcrumbs_font_style' => array(
'title' => esc_html__( 'Font Style', 'kava' ),
'section' => 'breadcrumbs_typography',
'default' => 'normal',
'field' => 'select',
'choices' => kava_get_font_styles(),
'type' => 'control',
),
'breadcrumbs_font_weight' => array(
'title' => esc_html__( 'Font Weight', 'kava' ),
'section' => 'breadcrumbs_typography',
'default' => '400',
'field' => 'select',
'choices' => kava_get_font_weight(),
'type' => 'control',
),
'breadcrumbs_font_size' => array(
'title' => esc_html__( 'Font Size, px', 'kava' ),
'section' => 'breadcrumbs_typography',
'default' => '11',
'field' => 'number',
'input_attrs' => array(
'min' => 6,
'max' => 50,
'step' => 1,
),
'type' => 'control',
),
'breadcrumbs_line_height' => array(
'title' => esc_html__( 'Line Height', 'kava' ),
'description' => esc_html__( 'Relative to the font-size of the element', 'kava' ),
'section' => 'breadcrumbs_typography',
'default' => '1.5',
'field' => 'number',
'input_attrs' => array(
'min' => 1.0,
'max' => 3.0,
'step' => 0.1,
),
'type' => 'control',
),
'breadcrumbs_letter_spacing' => array(
'title' => esc_html__( 'Letter Spacing, px', 'kava' ),
'section' => 'breadcrumbs_typography',
'default' => '0',
'field' => 'number',
'input_attrs' => array(
'min' => -10,
'max' => 10,
'step' => 1,
),
'type' => 'control',
),
'breadcrumbs_character_set' => array(
'title' => esc_html__( 'Character Set', 'kava' ),
'section' => 'breadcrumbs_typography',
'default' => 'latin',
'field' => 'select',
'choices' => kava_get_character_sets(),
'type' => 'control',
),
/** `Button` section */
'button_typography' => array(
'title' => esc_html__( 'Button', 'kava' ),
'priority' => 55,
'panel' => 'typography',
'type' => 'section',
),
'button_font_family' => array(
'title' => esc_html__( 'Font Family', 'kava' ),
'section' => 'button_typography',
'default' => 'Roboto, sans-serif',
'field' => 'fonts',
'type' => 'control',
),
'button_font_style' => array(
'title' => esc_html__( 'Font Style', 'kava' ),
'section' => 'button_typography',
'default' => 'normal',
'field' => 'select',
'choices' => kava_get_font_styles(),
'type' => 'control',
),
'button_font_weight' => array(
'title' => esc_html__( 'Font Weight', 'kava' ),
'section' => 'button_typography',
'default' => '900',
'field' => 'select',
'choices' => kava_get_font_weight(),
'type' => 'control',
),
'button_font_size' => array(
'title' => esc_html__( 'Font Size, px', 'kava' ),
'section' => 'button_typography',
'default' => '11',
'field' => 'number',
'input_attrs' => array(
'min' => 6,
'max' => 50,
'step' => 1,
),
'type' => 'control',
),
'button_line_height' => array(
'title' => esc_html__( 'Line Height', 'kava' ),
'description' => esc_html__( 'Relative to the font-size of the element', 'kava' ),
'section' => 'button_typography',
'default' => '1',
'field' => 'number',
'input_attrs' => array(
'min' => 1.0,
'max' => 3.0,
'step' => 0.1,
),
'type' => 'control',
),
'button_letter_spacing' => array(
'title' => esc_html__( 'Letter Spacing, px', 'kava' ),
'section' => 'button_typography',
'default' => '1',
'field' => 'number',
'input_attrs' => array(
'min' => -10,
'max' => 10,
'step' => 1,
),
'type' => 'control',
),
'button_character_set' => array(
'title' => esc_html__( 'Character Set', 'kava' ),
'section' => 'button_typography',
'default' => 'latin',
'field' => 'select',
'choices' => kava_get_character_sets(),
'type' => 'control',
),
/** `Header` panel */
'header_options' => array(
'title' => esc_html__( 'Header', 'kava' ),
'priority' => 60,
'type' => 'panel',
),
/** `Header styles` section */
'header_styles' => array(
'title' => esc_html__( 'Styles', 'kava' ),
'priority' => 5,
'panel' => 'header_options',
'type' => 'section',
),
'header_bg_color' => array(
'title' => esc_html__( 'Background Color', 'kava' ),
'section' => 'header_styles',
'field' => 'hex_color',
'default' => '#ffffff',
'type' => 'control',
),
'header_bg_image' => array(
'title' => esc_html__( 'Background Image', 'kava' ),
'section' => 'header_styles',
'field' => 'image',
'type' => 'control',
),
'header_bg_repeat' => array(
'title' => esc_html__( 'Background Repeat', 'kava' ),
'section' => 'header_styles',
'default' => 'repeat',
'field' => 'select',
'choices' => array(
'no-repeat' => esc_html__( 'No Repeat', 'kava' ),
'repeat' => esc_html__( 'Tile', 'kava' ),
'repeat-x' => esc_html__( 'Tile Horizontally', 'kava' ),
'repeat-y' => esc_html__( 'Tile Vertically', 'kava' ),
),
'type' => 'control',
),
'header_bg_position_x' => array(
'title' => esc_html__( 'Background Position', 'kava' ),
'section' => 'header_styles',
'default' => 'center',
'field' => 'select',
'choices' => array(
'left' => esc_html__( 'Left', 'kava' ),
'center' => esc_html__( 'Center', 'kava' ),
'right' => esc_html__( 'Right', 'kava' ),
),
'type' => 'control',
),
'header_bg_attachment' => array(
'title' => esc_html__( 'Background Attachment', 'kava' ),
'section' => 'header_styles',
'default' => 'scroll',
'field' => 'select',
'choices' => array(
'scroll' => esc_html__( 'Scroll', 'kava' ),
'fixed' => esc_html__( 'Fixed', 'kava' ),
),
'type' => 'control',
),
/** `Top Panel` section */
'header_top_panel' => array(
'title' => esc_html__( 'Top Panel', 'kava' ),
'priority' => 10,
'panel' => 'header_options',
'type' => 'section',
),
'top_panel_enable' => array(
'title' => esc_html__( 'Enable Top Panel', 'kava' ),
'section' => 'header_top_panel',
'default' => true,
'field' => 'checkbox',
'type' => 'control',
),
'top_panel_bg' => array(
'title' => esc_html__( 'Background color', 'kava' ),
'section' => 'header_top_panel',
'default' => '#ffffff',
'field' => 'hex_color',
'type' => 'control',
),
/** `Footer` panel */
'footer_options' => array(
'title' => esc_html__( 'Footer', 'kava' ),
'priority' => 110,
'type' => 'section',
),
'footer_copyright' => array(
'title' => esc_html__( 'Copyright text', 'kava' ),
'section' => 'footer_options',
'default' => kava_get_default_footer_copyright(),
'field' => 'textarea',
'type' => 'control',
),
/** `Blog Settings` panel */
'blog_settings' => array(
'title' => esc_html__( 'Blog Settings', 'kava' ),
'priority' => 115,
'type' => 'panel',
),
/** `Blog` section */
'blog' => array(
'title' => esc_html__( 'Blog', 'kava' ),
'panel' => 'blog_settings',
'priority' => 10,
'type' => 'section',
//'active_callback' => 'is_home',
),
'blog_sidebar_position' => array(
'title' => esc_html__( 'Sidebar', 'kava' ),
'section' => 'blog',
'default' => 'one-right-sidebar',
'field' => 'select',
'priority' => 10,
'choices' => array(
'one-left-sidebar' => esc_html__( 'Sidebar on left side', 'kava' ),
'one-right-sidebar' => esc_html__( 'Sidebar on right side', 'kava' ),
'none' => esc_html__( 'No sidebar', 'kava' ),
),
'type' => 'control',
'active_callback' => 'kava_is_blog_sidebar_enabled',
),
'blog_navigation_type' => array(
'title' => esc_html__( 'Navigation type', 'kava' ),
'section' => 'blog',
'default' => 'navigation',
'field' => 'select',
'choices' => array(
'navigation' => esc_html__( 'Navigation', 'kava' ),
'pagination' => esc_html__( 'Pagination', 'kava' ),
),
'type' => 'control',
),
'blog_sticky_type' => array(
'title' => esc_html__( 'Sticky label type', 'kava' ),
'section' => 'blog',
'default' => 'icon',
'field' => 'select',
'priority' => 15,
'choices' => array(
'label' => esc_html__( 'Text Label', 'kava' ),
'icon' => esc_html__( 'Font Icon', 'kava' ),
'both' => esc_html__( 'Text with Icon', 'kava' ),
),
'type' => 'control',
),
'blog_sticky_label' => array(
'title' => esc_html__( 'Featured Post Label', 'kava' ),
'description' => esc_html__( 'Label for sticky post', 'kava' ),
'section' => 'blog',
'default' => esc_html__( 'Featured', 'kava' ),
'field' => 'text',
'priority' => 20,
'active_callback' => 'kava_is_sticky_text',
'type' => 'control',
),
'blog_post_author' => array(
'title' => esc_html__( 'Show post author', 'kava' ),
'section' => 'blog',
'default' => true,
'field' => 'checkbox',
'priority' => 25,
'type' => 'control',
),
'blog_post_publish_date' => array(
'title' => esc_html__( 'Show publish date', 'kava' ),
'section' => 'blog',
'default' => true,
'field' => 'checkbox',
'priority' => 30,
'type' => 'control',
),
'blog_post_categories' => array(
'title' => esc_html__( 'Show categories', 'kava' ),
'section' => 'blog',
'default' => true,
'field' => 'checkbox',
'priority' => 35,
'type' => 'control',
),
'blog_post_tags' => array(
'title' => esc_html__( 'Show tags', 'kava' ),
'section' => 'blog',
'default' => true,
'field' => 'checkbox',
'priority' => 40,
'type' => 'control',
),
'blog_post_comments' => array(
'title' => esc_html__( 'Show comments', 'kava' ),
'section' => 'blog',
'default' => true,
'field' => 'checkbox',
'priority' => 45,
'type' => 'control',
),
'blog_post_excerpt' => array(
'title' => esc_html__( 'Show Excerpt', 'kava' ),
'section' => 'blog',
'default' => true,
'field' => 'checkbox',
'priority' => 50,
'type' => 'control'
),
'blog_post_excerpt_words_count' => array(
'title' => esc_html__( 'Excerpt Words Count', 'kava' ),
'section' => 'blog',
'default' => '50',
'priority' => 55,
'field' => 'number',
'input_attrs' => array(
'min' => 1,
'max' => 100,
'step' => 1,
),
'type' => 'control',
),
'blog_read_more_type' => array(
'title' => esc_html__( 'Read more button type', 'kava' ),
'section' => 'blog',
'default' => 'text',
'field' => 'select',
'priority' => 60,
'choices' => array(
'text' => esc_html__( 'Text', 'kava' ),
'icon' => esc_html__( 'Icon', 'kava' ),
'text_icon' => esc_html__( 'Text & Icon', 'kava' ),
'none' => esc_html__( 'None', 'kava' ),
),
'type' => 'control',
),
'blog_read_more_text' => array(
'title' => esc_html__( 'Read more button text', 'kava' ),
'section' => 'blog',
'default' => esc_html__( 'More', 'kava' ),
'field' => 'text',
'priority' => 65,
'type' => 'control',
'active_callback' => 'kava_is_blog_read_more_btn_text',
),
/** `Post` section */
'blog_post' => array(
'title' => esc_html__( 'Post', 'kava' ),
'panel' => 'blog_settings',
'priority' => 20,
'type' => 'section',
'active_callback' => 'callback_single',
),
'single_sidebar_position' => array(
'title' => esc_html__( 'Sidebar', 'kava' ),
'section' => 'blog_post',
'default' => 'one-right-sidebar',
'field' => 'select',
'choices' => array(
'one-left-sidebar' => esc_html__( 'Sidebar on left side', 'kava' ),
'one-right-sidebar' => esc_html__( 'Sidebar on right side', 'kava' ),
'none' => esc_html__( 'No sidebar', 'kava' ),
),
'type' => 'control',
),
'single_post_author' => array(
'title' => esc_html__( 'Show post author', 'kava' ),
'section' => 'blog_post',
'default' => true,
'field' => 'checkbox',
'type' => 'control',
),
'single_post_publish_date' => array(
'title' => esc_html__( 'Show publish date', 'kava' ),
'section' => 'blog_post',
'default' => true,
'field' => 'checkbox',
'type' => 'control',
),
'single_post_categories' => array(
'title' => esc_html__( 'Show categories', 'kava' ),
'section' => 'blog_post',
'default' => true,
'field' => 'checkbox',
'type' => 'control',
),
'single_post_tags' => array(
'title' => esc_html__( 'Show tags', 'kava' ),
'section' => 'blog_post',
'default' => true,
'field' => 'checkbox',
'type' => 'control',
),
'single_post_comments' => array(
'title' => esc_html__( 'Show comments', 'kava' ),
'section' => 'blog_post',
'default' => true,
'field' => 'checkbox',
'type' => 'control',
),
'single_author_block' => array(
'title' => esc_html__( 'Enable the author block after each post', 'kava' ),
'section' => 'blog_post',
'default' => true,
'field' => 'checkbox',
'type' => 'control',
),
/** `Related Posts` section */
'related_posts' => array(
'title' => esc_html__( 'Related posts block', 'kava' ),
'panel' => 'blog_settings',
'priority' => 30,
'type' => 'section',
'active_callback' => 'callback_single',
),
'related_posts_visible' => array(
'title' => esc_html__( 'Show related posts block', 'kava' ),
'section' => 'related_posts',
'default' => true,
'field' => 'checkbox',
'type' => 'control',
),
'related_posts_block_title' => array(
'title' => esc_html__( 'Related posts block title', 'kava' ),
'section' => 'related_posts',
'default' => esc_html__( 'Related Posts', 'kava' ),
'field' => 'text',
'type' => 'control',
),
'related_posts_count' => array(
'title' => esc_html__( 'Number of post', 'kava' ),
'section' => 'related_posts',
'default' => '4',
'field' => 'text',
'type' => 'control',
),
'related_posts_grid' => array(
'title' => esc_html__( 'Layout', 'kava' ),
'section' => 'related_posts',
'default' => '2',
'field' => 'select',
'choices' => array(
'2' => esc_html__( '2 columns', 'kava' ),
'3' => esc_html__( '3 columns', 'kava' ),
'4' => esc_html__( '4 columns', 'kava' ),
),
'type' => 'control',
),
'related_posts_image' => array(
'title' => esc_html__( 'Show post image', 'kava' ),
'section' => 'related_posts',
'default' => true,
'field' => 'checkbox',
'type' => 'control',
),
'related_posts_publish_date' => array(
'title' => esc_html__( 'Show post publish date', 'kava' ),
'section' => 'related_posts',
'default' => true,
'field' => 'checkbox',
'type' => 'control',
),
'related_posts_author' => array(
'title' => esc_html__( 'Show post author', 'kava' ),
'section' => 'related_posts',
'default' => false,
'field' => 'checkbox',
'type' => 'control',
),
'related_posts_title' => array(
'title' => esc_html__( 'Show post title', 'kava' ),
'section' => 'related_posts',
'default' => true,
'field' => 'checkbox',
'type' => 'control',
),
'related_posts_excerpt' => array(
'title' => esc_html__( 'Display excerpt', 'kava' ),
'section' => 'related_posts',
'default' => false,
'field' => 'checkbox',
'type' => 'control',
),
/* 'related_posts_categories' => array(
'title' => esc_html__( 'Show post categories', 'kava' ),
'section' => 'related_posts',
'default' => true,
'field' => 'checkbox',
'type' => 'control',
), */
/* 'related_posts_tags' => array(
'title' => esc_html__( 'Show post tags', 'kava' ),
'section' => 'related_posts',
'default' => true,
'field' => 'checkbox',
'type' => 'control',
), */
/* 'related_posts_comment_count' => array(
'title' => esc_html__( 'Show post comment count', 'kava' ),
'section' => 'related_posts',
'default' => true,
'field' => 'checkbox',
'type' => 'control',
), */
) ) );
}
/**
* Return true if value of passed setting is not equal with passed value.
*
* @param object $control Parent control.
* @param string $setting Setting name to check.
* @param string $value Setting value to compare.
* @return bool
*/
function kava_is_not_setting( $control, $setting, $value ) {
if ( $value !== $control->manager->get_setting( $setting )->value() ) {
return true;
}
return false;
}
/**
* Return true if sticky label type set to text or text with icon.
*
* @param object $control
* @return bool
*/
function kava_is_sticky_text( $control ) {
return kava_is_not_setting( $control, 'blog_sticky_type', 'icon' );
}
/**
* Return true if sticky label type set to icon or text with icon.
*
* @param object $control
* @return bool
*/
function kava_is_sticky_icon( $control ) {
return kava_is_not_setting( $control, 'blog_sticky_type', 'label' );
}
/**
* Move native `site_icon` control (based on WordPress core) into custom section.
*
* @since 1.0.0
* @param object $wp_customize
* @return void
*/
function kava_customizer_change_core_controls( $wp_customize ) {
$wp_customize->get_control( 'site_icon' )->section = 'kava_favicon';
$wp_customize->get_control( 'background_color' )->label = esc_html__( 'Body Background Color', 'kava' );
}
// Move native `site_icon` control (based on WordPress core) in custom section.
add_action( 'customize_register', 'kava_customizer_change_core_controls', 20 );
/**
* Get font styles
*
* @since 1.0.0
* @return array
*/
function kava_get_font_styles() {
return apply_filters( 'kava-theme/font/styles', array(
'normal' => esc_html__( 'Normal', 'kava' ),
'italic' => esc_html__( 'Italic', 'kava' ),
'oblique' => esc_html__( 'Oblique', 'kava' ),
'inherit' => esc_html__( 'Inherit', 'kava' ),
) );
}
/**
* Get character sets
*
* @since 1.0.0
* @return array
*/
function kava_get_character_sets() {
return apply_filters( 'kava-theme/font/character_sets', array(
'latin' => esc_html__( 'Latin', 'kava' ),
'greek' => esc_html__( 'Greek', 'kava' ),
'greek-ext' => esc_html__( 'Greek Extended', 'kava' ),
'vietnamese' => esc_html__( 'Vietnamese', 'kava' ),
'cyrillic-ext' => esc_html__( 'Cyrillic Extended', 'kava' ),
'latin-ext' => esc_html__( 'Latin Extended', 'kava' ),
'cyrillic' => esc_html__( 'Cyrillic', 'kava' ),
) );
}
/**
* Get text aligns
*
* @since 1.0.0
* @return array
*/
function kava_get_text_aligns() {
return apply_filters( 'kava-theme/font/text-aligns', array(
'inherit' => esc_html__( 'Inherit', 'kava' ),
'center' => esc_html__( 'Center', 'kava' ),
'justify' => esc_html__( 'Justify', 'kava' ),
'left' => esc_html__( 'Left', 'kava' ),
'right' => esc_html__( 'Right', 'kava' ),
) );
}
/**
* Get font weights
*
* @since 1.0.0
* @return array
*/
function kava_get_font_weight() {
return apply_filters( 'kava-theme/font/weight', array(
'100' => '100',
'200' => '200',
'300' => '300',
'400' => '400',
'500' => '500',
'600' => '600',
'700' => '700',
'800' => '800',
'900' => '900',
) );
}
/**
* Return array of arguments for dynamic CSS module
*
* @return array
*/
function kava_get_dynamic_css_options() {
return apply_filters( 'kava-theme/dynamic_css/options', array(
'prefix' => 'kava',
'type' => 'theme_mod',
'parent_handles' => array(
'css' => 'kava-theme-style',
'js' => 'kava-theme-script',
),
'css_files' => array(
get_theme_file_path( 'assets/css/dynamic.css' ),
get_theme_file_path( 'assets/css/dynamic/header.css' ),
get_theme_file_path( 'assets/css/dynamic/menus.css' ),
get_theme_file_path( 'assets/css/dynamic/social.css' ),
get_theme_file_path( 'assets/css/dynamic/navigation.css' ),
get_theme_file_path( 'assets/css/dynamic/buttons.css' ),
get_theme_file_path( 'assets/css/dynamic/forms.css' ),
get_theme_file_path( 'assets/css/dynamic/post.css' ),
get_theme_file_path( 'assets/css/dynamic/page.css' ),
get_theme_file_path( 'assets/css/dynamic/post-grid.css' ),
get_theme_file_path( 'assets/css/dynamic/post-justify.css' ),
get_theme_file_path( 'assets/css/dynamic/post-masonry.css' ),
get_theme_file_path( 'assets/css/dynamic/widgets.css' ),
get_theme_file_path( 'assets/css/dynamic/plugins.css' ),
),
'options_cb' => 'get_theme_mods',
) );
}
/**
* Get default footer copyright.
*
* @since 1.0.0
* @return string
*/
function kava_get_default_footer_copyright() {
return esc_html__( '© %%year%% Kava | Multipurpose WP Theme with Elementor Page Builder', 'kava' );
}
/**
* Return true if blog sidebar enabled.
*
* @return bool
*/
function kava_is_blog_sidebar_enabled() {
return apply_filters( 'kava-theme/customizer/blog-sidebar-enabled', true );
}
/**
* Return true if option Read More button type is text type. Otherwise - return false.
*
* @return bool
*/
function kava_is_blog_read_more_btn_text() {
$btn_type = kava_theme()->customizer->get_value( 'blog_read_more_type' );
return 'text' === $btn_type || 'text_icon' === $btn_type ? true : false;
}
/**
* Return false if option Enable Totop button is enable.
*
* @param object $control Parent control.
* @return bool
*/
function kava_is_totop_enable( $control ) {
return kava_is_not_setting( $control, 'totop_visibility', false );
}PK ��]�z1� � classes/class-post-meta.phpnu �[��� <?php
/**
* Post meta class.
*
* @package Kava
*/
// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
die;
}
if ( ! class_exists( 'Kava_Post_Meta' ) ) {
/**
* Define Kava_Post_Meta class
*/
class Kava_Post_Meta {
/**
* A reference to an instance of this class.
*
* @since 1.0.0
* @var Kava_Post_Meta
*/
private static $instance = null;
/**
* Mata options
*
* @var array
*/
private $options = array();
/**
* Constructor for the class
*/
public function __construct() {
add_action( 'init', array( $this, 'init_post_meta' ) );
}
/**
* Add meta options
*
* @param $options
*/
public function add_options( array $options = array() ) {
$this->options[] = $options;
}
/**
* Init meta
*/
public function init_post_meta() {
foreach ( $this->options as $options ) {
if ( ! isset( $options['builder_cb'] ) ) {
$options['builder_cb'] = array( $this, 'get_interface_builder' );
}
new Cherry_X_Post_Meta( $options );
}
}
public function get_interface_builder() {
$builder_data = kava_theme()->framework->get_included_module_data( 'cherry-x-interface-builder.php' );
return new CX_Interface_Builder(
array(
'path' => $builder_data['path'],
'url' => $builder_data['url'],
)
);
}
/**
* Returns the instance.
*
* @since 1.0.0
* @return Kava_Post_Meta
*/
public static function get_instance() {
// If the single instance hasn't been set, set it now.
if ( null == self::$instance ) {
self::$instance = new self;
}
return self::$instance;
}
}
}
function kava_post_meta() {
return Kava_Post_Meta::get_instance();
}
kava_post_meta();
PK ��]>�H��( �( classes/class-settings.phpnu �[��� <?php
/**
* Theme Settings class.
*
* @package Kava
*/
// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
die;
}
if ( ! class_exists( 'Kava_Settings' ) ) {
/**
* Define Kava_Settings class
*/
class Kava_Settings {
/**
* A reference to an instance of this class.
*
* @since 1.0.0
* @access private
* @var object
*/
private static $instance = null;
/**
* Setting key
*
* @var string
*/
public $key = 'kava-extra-settings';
/**
* Settings
*
* @var null
*/
public $settings = null;
/**
* Available Modules array
*
* @access public
* @var null
*/
public $available_modules = null;
/**
* Available Modules Conditions array
*
* @access public
* @var null
*/
public $available_modules_conditions = array();
/**
* Page config
*
* @var array
*/
public $settings_page_config = array();
/**
* Ajax action
*
* @var string
*/
private $ajax_action = 'kava_save_theme_settings';
/**
* Init page
*/
public function __construct() {
if ( ! $this->is_enabled() ) {
return;
}
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ), 0 );
add_action( 'admin_menu', array( $this, 'register_page' ), 99 );
add_action( "wp_ajax_{$this->ajax_action}", array( $this, 'save_settings' ) );
}
/**
* Is default settings page enabled or not.
*
* @return boolean
*/
public function is_enabled() {
return apply_filters( 'kava-theme/settings-page/is-enabled', true );
}
/**
* Initialize page builder module if required
*
* @return void
*/
public function admin_enqueue_scripts() {
if ( isset( $_REQUEST['page'] ) && $this->key === $_REQUEST['page'] ) {
$module_data = kava_theme()->framework->get_included_module_data( 'cherry-x-vue-ui.php' );
$ui = new CX_Vue_UI( $module_data );
$ui->enqueue_assets();
$this->generate_config_data();
wp_enqueue_script(
'kava-admin-script',
get_parent_theme_file_uri( 'assets/js/admin.js' ),
array( 'cx-vue-ui' ),
kava_theme()->version(),
true
);
wp_localize_script(
'kava-admin-script',
'KavaSettingsPageConfig',
apply_filters( 'kava-theme/admin/settings-page-config', $this->settings_page_config )
);
}
}
/**
* Return settings page URL
*
* @return string
*/
public function get_settings_page_link() {
return add_query_arg(
array(
'page' => $this->key,
),
esc_url( admin_url( 'admin.php' ) )
);
}
/**
* Get setting value.
*
* @param string $setting
* @param boolean $default
* @return mixed
*/
public function get( $setting, $default = false ) {
if ( null === $this->settings ) {
$this->settings = get_option( $this->key, array() );
}
return isset( $this->settings[ $setting ] ) ? $this->settings[ $setting ] : $default;
}
/**
* Register add/edit page
*
* @return void
*/
public function register_page() {
add_menu_page(
esc_html__( 'Theme', 'kava' ),
esc_html__( 'Theme', 'kava' ),
'manage_options',
$this->key,
array( $this, 'render_page' ),
get_theme_file_uri( 'assets/images/kava-theme-icon.svg' ),
100
);
}
/**
* Render settings page
*
* @return void
*/
public function render_page() {
include get_parent_theme_file_path( 'admin-templates/settings-page.php' );
}
/**
* Generate config data.
*/
public function generate_config_data() {
$default_disable_container_archive_cpt = $this->prepare_default_values_list( $this->get_post_types( true ), 'false' );
$default_disable_container_single_cpt = $this->prepare_default_values_list( $this->get_post_types(), 'false' );
$default_available_modules = $this->prepare_default_values_list( $this->get_available_modules(), 'true' );
$available_modules_value = array_merge(
$default_available_modules,
$this->get( 'available_modules', array() )
);
$this->settings_page_config = array(
'action' => $this->ajax_action,
'messages' => array(
'saveSuccess' => esc_html__( 'Saved', 'kava' ),
'saveError' => esc_html__( 'Error', 'kava' ),
),
'settingsData' => array(
'disable_content_container_archive_cpt' => array(
'value' => $this->get( 'disable_content_container_archive_cpt', $default_disable_container_archive_cpt ),
'options' => $this->prepare_options_list( $this->get_post_types( true ) ),
),
'disable_content_container_single_cpt' => array(
'value' => $this->get( 'disable_content_container_single_cpt', $default_disable_container_single_cpt ),
'options' => $this->prepare_options_list( $this->get_post_types() ),
),
'single_post_template' => array(
'value' => $this->get( 'single_post_template', 'default' ),
'options' => $this->prepare_options_list( $this->get_single_post_templates() ),
),
'available_modules' => array(
'value' => $available_modules_value,
'options' => $this->prepare_options_list( $this->get_available_modules() ),
),
'available_modules_conditions' => $this->available_modules_conditions,
'enable_theme_customize_options' => array(
'value' => $this->get( 'enable_theme_customize_options', 'true' ),
),
'enqueue_theme_styles' => array(
'value' => $this->get( 'enqueue_theme_styles', 'true' ),
),
'enqueue_theme_js_scripts' => array(
'value' => $this->get( 'enqueue_theme_js_scripts', 'true' ),
),
'enqueue_dynamic_css' => array(
'value' => $this->get( 'enqueue_dynamic_css', 'true' ),
),
'cache_dynamic_css' => array(
'value' => $this->get( 'cache_dynamic_css', 'false' ),
),
),
);
}
public function save_settings() {
if ( ! isset( $_REQUEST['action'] ) || $this->ajax_action !== $_REQUEST['action'] || empty( $_REQUEST['options'] ) ) {
wp_send_json_error( array(
'message' => esc_html__( 'Server Error', 'kava' )
) );
return;
}
if ( ! current_user_can( 'manage_options' ) ) {
wp_send_json_error( array(
'message' => esc_html__( 'Sorry! You cannot change options.', 'kava' )
) );
return;
}
$current = get_option( $this->key, array() );
if ( is_wp_error( $current ) ) {
wp_send_json_error( array(
'message' => esc_html__( 'Server Error', 'kava' )
) );
return;
}
$options = $_REQUEST['options'];
foreach ( $options as $key => $value ) {
$current[ $key ] = is_array( $value ) ? $value : esc_attr( $value );
}
update_option( $this->key, $current );
wp_send_json_success( array(
'message' => esc_html__( 'Settings have been saved', 'kava' )
) );
}
/**
* Prepare options list
*
* @param array $options
* @return array
*/
public function prepare_options_list( $options = array() ) {
$result = array();
foreach ( $options as $slug => $label ) {
$result[] = array(
'value' => $slug,
'label' => $label,
);
}
return $result;
}
/**
* Prepare default values list
*
* @param array $options
* @param mixed $default
* @return array
*/
public function prepare_default_values_list( $options = array(), $default = 'false' ) {
$result = array();
foreach ( $options as $slug => $label ) {
$result[ $slug ] = $default;
}
return $result;
}
/**
* Get public post types options list
*
* @param boolean $is_archive_list
* @return array
*/
public function get_post_types( $is_archive_list = false ) {
$args = array(
'show_in_nav_menus' => true,
);
$post_types = get_post_types( $args, 'objects' );
$result = array();
if ( empty( $post_types ) ) {
return $result;
}
foreach ( $post_types as $slug => $post_type ) {
$result[ $slug ] = $post_type->label;
}
if ( $is_archive_list ) {
$result['search_results'] = esc_html__( 'Search Results', 'kava' );
unset( $result['page'] );
} else {
$result['404_page'] = esc_html__( '404 Page', 'kava' );
}
return $result;
}
/**
* Get single post templates.
*
* @return array
*/
public function get_single_post_templates() {
$default_template = array( 'default' => apply_filters( 'default_page_template_title', esc_html__( 'Default Template', 'kava' ) ) );
if ( ! function_exists( 'get_page_templates' ) ) {
return $default_template;
}
$post_templates = get_page_templates( null, 'post' );
ksort( $post_templates );
$templates = array_combine(
array_values( $post_templates ),
array_keys( $post_templates )
);
$templates = array_merge( $default_template, $templates );
return $templates;
}
/**
* Get available modules.
*
* @return array
*/
public function get_available_modules() {
if ( null === $this->available_modules ) {
$this->available_modules = array();
$this->parse_available_modules( kava_get_allowed_modules() );
}
return $this->available_modules;
}
public function parse_available_modules( $modules = array(), $parent = null ) {
$disabled_modules = apply_filters( 'kava-theme/disabled-modules', array() );
$modules_labels_map = array(
'woo' => 'WooCommerce',
);
foreach ( $modules as $module => $childs ) {
if ( ! in_array( $module, $disabled_modules ) ) {
$this->available_modules[ $module ] = isset( $modules_labels_map[ $module ] ) ?
$modules_labels_map[ $module ] :
ucwords( str_replace( '-', ' ', $module ) );
if ( ! empty( $parent ) ) {
$this->available_modules_conditions[ $module ] = array(
'compare' => 'equal',
'input' => $parent,
'value' => 'true',
);
}
if ( ! empty( $childs ) ) {
$this->parse_available_modules( $childs, $module );
}
}
}
}
/**
* Returns the instance.
*
* @since 1.0.0
* @access public
* @return object
*/
public static function get_instance() {
// If the single instance hasn't been set, set it now.
if ( null == self::$instance ) {
self::$instance = new self;
}
return self::$instance;
}
}
}
/**
* Returns instance of Kava_Settings
*
* @return object
*/
function kava_settings() {
return Kava_Settings::get_instance();
}
kava_settings();
PK ��].�� � "