su_shortcode_menu

The shortcodes-ultimate su shortcode menu function.

Published Date - February 15, 2021

Description

su_shortcode_menu( $atts, $content );

Parameters

  1. $atts

  2. $content


Usage

The following example is for adding a hook callback.

if ( !function_exists( 'su_shortcode_menu' ) ) {
    require_once ABSPATH . PLUGINDIR . 'shortcodes-ultimateshortcodes-ultimate/includes/shortcodes/menu.php';
}

// The input(s). 
$atts = null;
$content = null;

// NOTICE! Understand what this does before running.
$result = su_shortcode_menu( $atts, $content );
            

Defined

The function is defined in the following location(s).

shortcodes-ultimate/includes/shortcodes/menu.php

function su_shortcode_menu( $atts = null, $content = null ) {
	$atts = shortcode_atts( array(
			'name' => false,
			'class' => ''
		), $atts, 'menu' );
	$return = wp_nav_menu( array(
			'echo'        => false,
			'menu'        => $atts['name'],
			'container'   => false,
			'fallback_cb' => 'su_shortcode_menu_fallback',
			'items_wrap'  => '<ul id="%1$s" class="%2$s' . su_get_css_class( $atts ) . '">%3$s</ul>'
		) );
	return ( $atts['name'] ) ? $return : false;
}