File: /disk001/machen/www/support/wp-content/themes/wp-moose/inc/customizer/sections/header.php
<?php
if ( !function_exists( 'wp_moose_register_header_options' ) ) {
/**
* Add header options and controls.
*
* @param \WP_Customize_Manager $wp_customize
* @param string $section_id
* @param int $priority
*/
function wp_moose_register_header_options( $wp_customize, $section_id, $priority = 100 )
{
$wp_customize->add_section( $section_id, array(
'title' => esc_html__( 'Header Settings', 'wp-moose' ),
'panel' => '',
'priority' => $priority,
) );
if ( wp_moose_fs()->is_not_paying() ) {
wp_moose_register_options( $wp_customize, array(
'name' => 'wp_moose_navbar_upsell_tips',
'section' => $section_id,
'settings' => array(),
'custom_control' => Moose_Info_Customize_Control::class,
'control_args' => array(
'messages' => array(
esc_html__( 'In our Pro version, you can:', 'wp-moose' ),
array( esc_html__( 'Have 3 additional preset header styles', 'wp-moose' ), esc_html__( 'Have 3 additional preset menu styles', 'wp-moose' ), esc_html__( 'Fully customize your header', 'wp-moose' ) ),
sprintf( '<a href="%1$s" target="_blank">%2$s</a>', wp_moose_upsell_url(), __( 'Meet Moose Pro', 'wp-moose' ) ),
sprintf( '<a href="%1$s" target="_blank">%2$s</a>', 'https://www.wpmoose.com/docs/moose-theme-docs/theme-customization/customize-header/', __( 'Customize Header Video Tutorial', 'wp-moose' ) )
),
),
) );
}
$custom_controls = array(
'custom' => '',
);
wp_moose_register_options( $wp_customize, array(
'name' => 'wp_moose_header_style',
'label' => esc_html__( 'Header Style', 'wp-moose' ),
'section' => $section_id,
'choices' => wp_moose_get_header_style_options(),
'custom_control' => Moose_Select_Customize_Control::class,
'control_args' => array(
'subcontrols' => $custom_controls,
'should_init' => true,
),
) );
wp_moose_register_options( $wp_customize, array(
'name' => 'wp_moose_menu_style',
'label' => esc_html__( 'Header Menu Style', 'wp-moose' ),
'type' => 'select',
'section' => $section_id,
'choices' => wp_moose_get_menu_style_options(),
) );
wp_moose_register_options( $wp_customize, array(
'name' => 'wp_moose_sticky_header',
'label' => esc_html__( 'Sticky Header', 'wp-moose' ),
'custom_control' => Moose_Switch_Customize_Control::class,
'section' => $section_id,
) );
wp_moose_register_options( $wp_customize, array(
'name' => 'wp_moose_header_brand',
'label' => esc_html__( 'Show Header Logo', 'wp-moose' ),
'custom_control' => Moose_Switch_Customize_Control::class,
'section' => $section_id,
) );
wp_moose_register_options( $wp_customize, array(
'name' => 'wp_moose_show_header_title',
'label' => esc_html__( 'Show Site Title', 'wp-moose' ),
'custom_control' => Moose_Switch_Customize_Control::class,
'section' => $section_id,
) );
wp_moose_register_options( $wp_customize, array(
'name' => 'wp_moose_show_header_tagline',
'label' => esc_html__( 'Show Tagline', 'wp-moose' ),
'custom_control' => Moose_Switch_Customize_Control::class,
'section' => $section_id,
) );
wp_moose_register_options( $wp_customize, array(
'name' => 'wp_moose_show_header_search',
'label' => esc_html__( 'Show Search', 'wp-moose' ),
'custom_control' => Moose_Switch_Customize_Control::class,
'section' => $section_id,
) );
}
}
if ( !function_exists( 'get_wp_moose_header_style' ) ) {
/**
* Return css class for header style
*
* @return string
*/
function get_wp_moose_header_style()
{
return wp_moose_get_header_style_css( get_wp_moose_option( 'wp_moose_header_style' ) );
}
}
if ( !function_exists( 'get_wp_moose_header_menu_style' ) ) {
/**
* Return css class for header menu style
*
* @return string
*/
function get_wp_moose_header_menu_style()
{
return wp_moose_get_header_menu_style_css( get_wp_moose_option( 'wp_moose_header_style' ), get_wp_moose_option( 'wp_moose_menu_style' ) );
}
}
if ( !function_exists( 'wp_moose_header_style' ) ) {
/**
* Output css class for header style
*/
function wp_moose_header_style()
{
echo get_wp_moose_header_style() ;
}
}