Skip to content

Commit 2de6bbf

Browse files
authored
Merge branch 'master' into fallback
2 parents 5c6823c + bff47bd commit 2de6bbf

6 files changed

Lines changed: 668 additions & 158 deletions

File tree

.travis.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,17 @@ before_script:
3838
- |
3939
composer global require wp-coding-standards/wpcs
4040
phpcs --config-set installed_paths $HOME/.composer/vendor/wp-coding-standards/wpcs
41+
- |
42+
if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.3" ]]; then
43+
composer require "szepeviktor/phpstan-wordpress:^0.5.0"
44+
fi
4145
4246
script:
4347
- phpcs --standard=phpcs.ruleset.xml $(find -name "*.php")
48+
- |
49+
if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.3" ]]; then
50+
vendor/bin/phpstan analyze
51+
fi
4452
- phpunit
4553

4654
cache:

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
[![Code Coverage](https://scrutinizer-ci.com/g/wp-bootstrap/wp-bootstrap-navwalker/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/wp-bootstrap/wp-bootstrap-navwalker/?branch=master)
99
[![Build Status](https://scrutinizer-ci.com/g/wp-bootstrap/wp-bootstrap-navwalker/badges/build.png?b=master)](https://scrutinizer-ci.com/g/wp-bootstrap/wp-bootstrap-navwalker/build-status/master)
1010

11+
**This code in the main repo branch is undergoing a big shakeup to bring it in line with recent standards and to merge and test the backlog of PRs I have left for too long. Please use the v4.3.0 tag for stable version while this process happens. https://github.com/wp-bootstrap/wp-bootstrap-navwalker/releases/tag/v4.3.0**
12+
1113
A custom WordPress Nav Walker Class to fully implement the Bootstrap 4 navigation style in a custom theme using the WordPress built in menu manager.
1214

1315
## NOTES
@@ -32,9 +34,9 @@ Here is a list of the most notable changes:
3234

3335
## Installation
3436

35-
Place **class-wp-bootstrap-navwalker.php** in your WordPress theme folder `/wp-content/your-theme/`
37+
Place **class-wp-bootstrap-navwalker.php** in your WordPress theme folder `/wp-content/themes/your-theme/`
3638

37-
Open your WordPress themes **functions.php** file - `/wp-content/your-theme/functions.php` - and add the following code:
39+
Open your WordPress themes **functions.php** file - `/wp-content/themes/your-theme/functions.php` - and add the following code:
3840

3941
```php
4042
/**
@@ -91,7 +93,7 @@ Typically the menu is wrapped with additional markup, here is an example of a `f
9193
<nav class="navbar navbar-expand-md navbar-light bg-light" role="navigation">
9294
<div class="container">
9395
<!-- Brand and toggle get grouped for better mobile display -->
94-
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-controls="bs-example-navbar-collapse-1" aria-expanded="false" aria-label="Toggle navigation">
96+
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-controls="bs-example-navbar-collapse-1" aria-expanded="false" aria-label="<?php esc_attr_e( 'Toggle navigation', 'your-theme-slug' ); ?>">
9597
<span class="navbar-toggler-icon"></span>
9698
</button>
9799
<a class="navbar-brand" href="#">Navbar</a>
@@ -119,14 +121,14 @@ Review options in the Bootstrap docs for more information on [nav classes](https
119121

120122
To display the menu you must associate your menu with your theme location. You can do this by selecting your theme location in the *Theme Locations* list while editing a menu in the WordPress menu manager.
121123

122-
### Making this Walker the Default Walker for Nav Manus
124+
### Making this Walker the Default Walker for Nav Menus
123125

124126
There has been some interest in making this walker the default walker for all menus. That could result in some unexpected situations but it can be achieved by adding this function to your functions.php file.
125127

126128
```php
127129
function prefix_modify_nav_menu_args( $args ) {
128130
return array_merge( $args, array(
129-
'walker' => WP_Bootstrap_Navwalker(),
131+
'walker' => new WP_Bootstrap_Navwalker(),
130132
) );
131133
}
132134
add_filter( 'wp_nav_menu_args', 'prefix_modify_nav_menu_args' );

0 commit comments

Comments
 (0)