File: /disk001/machen/www/support/wp-content/themes/wp-moose/inc/customizer/sections/frontpage-header.php
<?php
if ( !function_exists( 'wp_moose_register_frontpage_header_options' ) ) {
/**
* Add frontpage header section and controls.
*
* @param \WP_Customize_Manager $wp_customize
* @param string $section_id
* @param int $priority
*/
function wp_moose_register_frontpage_header_options( $wp_customize, $section_id, $priority = 100 )
{
$wp_customize->add_section( $section_id, array(
'title' => esc_html__( 'Header', 'wp-moose' ),
'panel' => 'wp_moose_frontpage_panel',
'priority' => $priority,
) );
if ( wp_moose_fs()->is_not_paying() ) {
wp_moose_register_options( $wp_customize, array(
'name' => 'wp_moose_frontpage_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' ),
esc_html__( 'Share header style with archive page', '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();
wp_moose_register_options( $wp_customize, array(
'name' => 'wp_moose_frontpage_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_frontpage_menu_style',
'label' => esc_html__( 'Header Menu Style', 'wp-moose' ),
'type' => 'select',
'section' => $section_id,
'choices' => wp_moose_get_menu_style_options(),
) );
// Transparent header logo in "title_tagline" section
wp_moose_register_options( $wp_customize, array(
'name' => 'wp_moose_transparent_header_logo',
'label' => esc_html__( 'Transparent Header Logo', 'wp-moose' ),
'priority' => 9,
'section' => 'title_tagline',
'custom_control' => \WP_Customize_Cropped_Image_Control::class,
'control_args' => array(
'flex_width' => true,
'flex_height' => true,
'height' => 100,
'active_callback' => function () {
return get_wp_moose_frontpage_header_style() === 'navbar-transparent';
},
),
) );
// Transparent reverse header logo in "title_tagline" section
wp_moose_register_options( $wp_customize, array(
'name' => 'wp_moose_transparent_reverse_header_logo',
'label' => esc_html__( 'Transparent Reverse Header Logo', 'wp-moose' ),
'priority' => 9,
'section' => 'title_tagline',
'custom_control' => \WP_Customize_Cropped_Image_Control::class,
'control_args' => array(
'flex_width' => true,
'flex_height' => true,
'height' => 100,
'active_callback' => function () {
return get_wp_moose_frontpage_header_style() === 'navbar-transparent';
},
),
) );
wp_moose_register_options( $wp_customize, array(
'name' => 'wp_moose_text_logo',
'label' => esc_html__( 'Text Logo', 'wp-moose' ),
'description' => esc_html__( "If you don't have an image logo, we will display this text as your logo", 'wp-moose' ),
'priority' => 9,
'section' => 'title_tagline',
'type' => 'text',
) );
}
}
if ( !function_exists( 'get_wp_moose_frontpage_header_style' ) ) {
/**
* Return css class for frontpage header
*
* @return string
*/
function get_wp_moose_frontpage_header_style()
{
return wp_moose_get_header_style_css( get_wp_moose_option( 'wp_moose_frontpage_header_style' ) );
}
}
if ( !function_exists( 'get_wp_moose_frontpage_header_menu_style' ) ) {
/**
* Return css class for frontpage header menu
*
* @return string
*/
function get_wp_moose_frontpage_header_menu_style()
{
return wp_moose_get_header_menu_style_css( get_wp_moose_option( 'wp_moose_frontpage_header_style' ), get_wp_moose_option( 'wp_moose_frontpage_menu_style' ) );
}
}
if ( !function_exists( 'wp_moose_frontpage_header_style' ) ) {
/**
* Output css class for frontpage header
*/
function wp_moose_frontpage_header_style()
{
echo get_wp_moose_frontpage_header_style() ;
}
}