beans_primary_offcanvas_menu

Echo off-canvas primary menu.

beans_primary_offcanvas_menu( )

Return: (void)

Source

function beans_primary_offcanvas_menu() {

	if ( ! current_theme_supports( 'offcanvas-menu' ) ) {
		return;
	}

	beans_open_markup_e( 'beans_primary_offcanvas_menu', 'nav', array(
		'class' => 'tm-primary-offcanvas-menu uk-margin uk-margin-top',
		'role'  => 'navigation',
	) );

		/**
		 * Filter the off-canvas primary menu arguments.
		 *
		 * @since 1.0.0
		 *
		 * @param array $args Off-canvas nav menu arguments.
		 */
		$args = apply_filters( 'beans_primary_offcanvas_menu_args', array(
			'theme_location' => has_nav_menu( 'primary' ) ? 'primary' : '',
			'fallback_cb'    => 'beans_no_menu_notice',
			'container'      => '',
			'echo'           => false,
			'beans_type'     => 'offcanvas',
		) );

		beans_output_e( 'beans_primary_offcanvas_menu', wp_nav_menu( $args ) );

	beans_close_markup_e( 'beans_primary_offcanvas_menu', 'nav' );

}