'; echo ''; echo ''; } } /** * Mobile Navigation Fallback * * is displayed if no menu is selected and user is logged in + able to edit theme options */ function wpbf_mobile_menu_fallback() { if ( is_user_logged_in() && current_user_can( 'edit_theme_options' ) && is_customize_preview() ) { ?> '; echo ''; echo ''; } } /** * Navigation Fallback * * is displayed if no menu is selected and user is logged in + able to edit theme options */ function wpbf_menu_fallback() { if ( is_user_logged_in() && current_user_can( 'edit_theme_options' ) && is_customize_preview() ) { ?> '. __( 'Add Menu', 'page-builder-framework' ) .''; // WPCS: XSS ok. } } /** * Add description to main menu items */ function wpbf_menu_description( $item_output, $item, $depth, $args ) { if( 'main_menu' == $args->theme_location && strlen( $item->description ) > 1 ) { $item_output .= '
' . $item->description . '
'; } return $item_output; } add_filter( 'walker_nav_menu_start_el', 'wpbf_menu_description', 10, 4 ); /** * Allow HTML inside menu descriptions */ remove_filter( 'nav_menu_description', 'strip_tags' ); function wpbf_menu_description_html( $menuItem ) { if ( isset( $menuItem->post_type ) && 'nav_menu_item' == $menuItem->post_type ) { $menuItem->description = apply_filters( 'nav_menu_description', $menuItem->post_content ); } return $menuItem; } add_filter( 'wp_setup_nav_menu_item', 'wpbf_menu_description_html' ); /** * Remove kirki telemetry */ add_filter( 'kirki_telemetry', '__return_false' );