• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Genesis Theme Framework a2z

Genesis Theme Framework a2z

WordPress Dynamic API Reference

  • Home
  • Plugins
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / genesis_nav_right() – Filter the Primary Navigation menu items, appending either RSS links, search form, twitter link, or today’s date.

You appear to be a bot. Output may be restricted

Description

Filter the Primary Navigation menu items, appending either RSS links, search form, twitter link, or today's date.

Usage

$string = genesis_nav_right( $menu, $args );

Parameters

$menu
( string ) required – HTML string of list items.
$args
( stdClass ) required – Menu arguments.

Returns

string HTML string of list items with optional nav extras. Return early unmodified if first Genesis version is higher than 2.0.2.

Source

File name: genesis/lib/functions/deprecated.php


Lines:

1 to 35 of 35
function genesis_nav_right( $menu, stdClass $args ) {

  _deprecated_function( __FUNCTION__, '3.0.0' );

  // Only allow if using 2.0.2 or lower.
  if ( genesis_first_version_compare( '2.0.2', '>' ) ) {
    return $menu;
  }

  if ( 'primary' !== $args->theme_location || ! genesis_get_option( 'nav_extras' ) ) {
    return $menu;
  }

  switch ( genesis_get_option( 'nav_extras' ) ) {
    case 'rss':
      $rss   = '<a rel="nofollow" href="' . get_bloginfo( 'rss2_url' ) . '">' . __( 'Posts', 'genesis' ) . '</a>';
      $rss  .= '<a rel="nofollow" href="' . get_bloginfo( 'comments_rss2_url' ) . '">' . __( 'Comments', 'genesis' ) . '</a>';
      $menu .= '<li class="right rss">' . $rss . '</li>';
      break;
    case 'search':
      $menu .= '<li class="right search">' . get_search_form( false ) . '</li>';
      break;
    case 'twitter':
      $menu .= sprintf( '<li class="right twitter"><a href="%s">%s</a></li>', esc_url( 'https://twitter.com/' . genesis_get_option( 'nav_extras_twitter_id' ) ), esc_html( genesis_get_option( 'nav_extras_twitter_text' ) ) );
      break;
    case 'date':
      $menu .= '<li class="right date">' . date_i18n( get_option( 'date_format' ) ) . '</li>';
      break;
  }

  return $menu;

}
 

Published: 25th November 2019 | Last updated: 25th November 2019

Primary Sidebar

Information

Function name: genesis_nav_right
Plugin ref: Genesis Framework
Version: 3.3.3
Sourcefile: lib/functions/deprecated.php
File ref: lib/functions/deprecated.php
Deprecated?: No
API Letters: G,N,R

Footer

Genesis a2z
Genesis Theme Framework a2z
WordPress Dynamic API Reference
WordPress 5.6
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  genesis.wp-a2z.org
© Copyright Genesis a2z 2014-2021. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites