__('Home', 'benjamin'), wp_login_url() => __('Login', 'benjamin') ); if( is_user_logged_in() ) { $link_arr = array( home_url() => __('Home', 'benjamin'), admin_url() => __('Admin', 'benjamin'), admin_url( 'nav-menus.php' ) => __('Add a Menu', 'benjamin'), admin_url( 'customize.php' ) => __('Customize your Site', 'benjamin'), wp_logout_url( home_url() ) => __('Logout', 'benjamin') ); } $links = array(); $link_before = isset($link_before) ? $link_before : ''; $link_after = isset($link_after) ? $link_after : ''; $before = isset($before) ? $before : ''; $after = isset($after) ? $after : ''; $items_wrap = isset($items_wrap) ? $items_wrap : ''; $menu_id = isset($menu_id) ? $menu_id : ''; $menu_class = isset($menu_class) ? $menu_class : ''; $echo = isset($echo) ? $echo : false; $li_class = $theme_location == 'footer' ? 'usa-width-one-sixth usa-footer-primary-content' : ''; $link_class = $theme_location == 'footer' ? 'usa-footer-primary-link' : ''; // loop through the list of links, add some escaped markup, the before and afters, as well as the lable foreach($link_arr as $url => $label) $links[] = $link_before . '' . $before . $label . $after . '' . $link_after; // We have a list if ( FALSE !== stripos( $items_wrap, ''.$link.''; } $output = sprintf( $items_wrap, $menu_id, $menu_class, implode('', $links) ); if ( ! empty ( $container ) ) { $output = '<'.$container.' class="'.esc_attr($container_class).'" id="'.esc_attr($container_id).'">'.$output.''; } if ( $echo ) { echo $output; // WPCS: xss ok; } return $output; } function benjamin_default_header_order() { $arr = array( (object) array ( 'name' => 'navbar', 'label' => 'Navbar' ), (object) array ( 'name' => 'hero', 'label' => 'Hero' ), ); $banner = (object) array( 'name' => 'banner', 'label' => 'Banner' ); if(benjamin_is_dot_gov()) array_unshift($arr, $banner); return $arr; }