Modify walker with 'understarp' prefixed on class name and as textdomain
This commit is contained in:
parent
cea18747d9
commit
4f0295ebea
|
@ -70,7 +70,7 @@ $container = get_theme_mod( 'understrap_container_type' );
|
|||
'fallback_cb' => '',
|
||||
'menu_id' => 'main-menu',
|
||||
'depth' => 2,
|
||||
'walker' => new WP_Bootstrap_Navwalker(),
|
||||
'walker' => new Understrap_WP_Bootstrap_Navwalker(),
|
||||
)
|
||||
); ?>
|
||||
<?php if ( 'container' == $container ) : ?>
|
||||
|
|
|
@ -20,13 +20,13 @@
|
|||
*/
|
||||
|
||||
/* Check if Class Exists. */
|
||||
if ( ! class_exists( 'WP_Bootstrap_Navwalker' ) ) {
|
||||
if ( ! class_exists( 'Understrap_WP_Bootstrap_Navwalker' ) ) {
|
||||
/**
|
||||
* WP_Bootstrap_Navwalker class.
|
||||
*
|
||||
* @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.
|
||||
|
@ -363,7 +363,7 @@ if ( ! class_exists( 'WP_Bootstrap_Navwalker' ) ) {
|
|||
if ( $menu_class ) {
|
||||
$fallback_output .= ' class="' . esc_attr( $menu_class ) . '"'; }
|
||||
$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>';
|
||||
if ( $container ) {
|
||||
$fallback_output .= '</' . esc_attr( $container ) . '>';
|
||||
|
|
Reference in New Issue