/** * General Functions * */ defined( 'ABSPATH' ) || exit; // Exit if accessed directly /** * Get the components of theme mobile header */ if( ! function_exists( 'tie_mobile_header_components' ) ) { function tie_mobile_header_components( $area ){ $mobile_header_components = array( 'menu' => tie_mobile_menu_icon(), 'search' => ' '. esc_html__( 'Search for', TIELABS_TEXTDOMAIN ) .' ', 'skin' => ' '. esc_html__( 'Switch skin', TIELABS_TEXTDOMAIN ) .' ', ); // If Google Search is active, disable the popup search // if( tie_get_option( 'google_search_engine_id' ) ){ // unset( $mobile_header_components['search'] ); //} // Login and user account if( is_user_logged_in() ){ ob_start(); tie_login_form(); $login_form = ob_get_clean(); if( get_option( 'show_avatars' ) ){ $current_user = wp_get_current_user(); $login_icon = get_avatar( $current_user->ID, apply_filters( 'TieLabs/Login/avatar_size', 30 ) ); } else{ $login_icon = ''; } $login_icon .= ''. esc_html__( 'Your Profile', TIELABS_TEXTDOMAIN ) .''; $mobile_header_components['login'] = ' '. $login_icon .'
'; } else { $mobile_header_components['login'] = ' '. esc_html__( 'Log In', TIELABS_TEXTDOMAIN ) .' '; } // WooCommerce Cart if ( TIELABS_WOOCOMMERCE_IS_ACTIVE ){ $mobile_header_components['cart'] = tie_component_button_cart(); } // BuddyPress if ( TIELABS_BUDDYPRESS_IS_ACTIVE ){ $mobile_header_components['bp_notifications'] = tie_component_button_bp_notifications(); } // Check the active components $components = array(); foreach ( $mobile_header_components as $key => $html ) { if( tie_get_option( 'mobile_header_components_'.$key ) == $area ){ $components[ $key ] = '