Modify walker with 'understarp' prefixed on class name and as textdomain

This commit is contained in:
William Patton 2018-04-17 17:10:40 +01:00
parent cea18747d9
commit 4f0295ebea
2 changed files with 4 additions and 4 deletions

View File

@ -70,7 +70,7 @@ $container = get_theme_mod( 'understrap_container_type' );
'fallback_cb' => '', 'fallback_cb' => '',
'menu_id' => 'main-menu', 'menu_id' => 'main-menu',
'depth' => 2, 'depth' => 2,
'walker' => new WP_Bootstrap_Navwalker(), 'walker' => new Understrap_WP_Bootstrap_Navwalker(),
) )
); ?> ); ?>
<?php if ( 'container' == $container ) : ?> <?php if ( 'container' == $container ) : ?>

View File

@ -20,13 +20,13 @@
*/ */
/* Check if Class Exists. */ /* Check if Class Exists. */
if ( ! class_exists( 'WP_Bootstrap_Navwalker' ) ) { if ( ! class_exists( 'Understrap_WP_Bootstrap_Navwalker' ) ) {
/** /**
* WP_Bootstrap_Navwalker class. * WP_Bootstrap_Navwalker class.
* *
* @extends Walker_Nav_Menu * @extends Walker_Nav_Menu
*/ */
class WP_Bootstrap_Navwalker extends Walker_Nav_Menu { class Understrap_WP_Bootstrap_Navwalker extends Walker_Nav_Menu {
/** /**
* Starts the list before the elements are added. * Starts the list before the elements are added.
@ -363,7 +363,7 @@ if ( ! class_exists( 'WP_Bootstrap_Navwalker' ) ) {
if ( $menu_class ) { if ( $menu_class ) {
$fallback_output .= ' class="' . esc_attr( $menu_class ) . '"'; } $fallback_output .= ' class="' . esc_attr( $menu_class ) . '"'; }
$fallback_output .= '>'; $fallback_output .= '>';
$fallback_output .= '<li><a href="' . esc_url( admin_url( 'nav-menus.php' ) ) . '" title="' . esc_attr__( 'Add a menu', 'wp-bootstrap-navwalker' ) . '">' . esc_html__( 'Add a menu', 'wp-bootstrap-navwalker' ) . '</a></li>'; $fallback_output .= '<li><a href="' . esc_url( admin_url( 'nav-menus.php' ) ) . '" title="' . esc_attr__( 'Add a menu', 'understrap' ) . '">' . esc_html__( 'Add a menu', 'understrap' ) . '</a></li>';
$fallback_output .= '</ul>'; $fallback_output .= '</ul>';
if ( $container ) { if ( $container ) {
$fallback_output .= '</' . esc_attr( $container ) . '>'; $fallback_output .= '</' . esc_attr( $container ) . '>';