Skip to content

Commit 26a280a

Browse files
authored
Merge pull request #400 from wp-bootstrap/fix/issue/395/typo-in-function-name
Correct typo in function name
2 parents 6b4880b + fb53150 commit 26a280a

File tree

3 files changed

+24
-21
lines changed

3 files changed

+24
-21
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#CHANGELOG
22

3+
## [4.2.0]
4+
- Fix typo in function name 'seporate'->'separate' (private function, no need to add back-compat).
5+
36
## [4.1.0]
47
- Prevent error `trying to get property of non-object` when no menu is set to a location using the walker.
58
- Add `$depth` as 4th parameter passed to `nav_menu_link_attributes`.

class-wp-bootstrap-navwalker.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0
116116
* NOTE: linkmod and icon class arrays are passed by reference and
117117
* are maybe modified before being used later in this function.
118118
*/
119-
$classes = self::seporate_linkmods_and_icons_from_classes( $classes, $linkmod_classes, $icon_classes, $depth );
119+
$classes = self::separate_linkmods_and_icons_from_classes( $classes, $linkmod_classes, $icon_classes, $depth );
120120

121121
// Join any icon classes plucked from $classes into a string.
122122
$icon_class_string = join( ' ', $icon_classes );
@@ -396,7 +396,7 @@ public static function fallback( $args ) {
396396
*
397397
* @return array $classes a maybe modified array of classnames.
398398
*/
399-
private function seporate_linkmods_and_icons_from_classes( $classes, &$linkmod_classes, &$icon_classes, $depth ) {
399+
private function separate_linkmods_and_icons_from_classes( $classes, &$linkmod_classes, &$icon_classes, $depth ) {
400400
// Loop through $classes array to find linkmod or icon classes.
401401
foreach ( $classes as $key => $class ) {
402402
// If any special classes are found, store the class in it's

tests/test-navwalker.php

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -240,18 +240,18 @@ public function test_fallback_function_output_loggedin() {
240240
}
241241

242242
/**
243-
* Test seporate_linkmods_and_icons_from_classes Function exists.
243+
* Test separate_linkmods_and_icons_from_classes Function exists.
244244
*
245245
* @access public
246246
* @return void
247247
*/
248-
public function test_seporate_linkmods_and_icons_from_classes_function_exists() {
248+
public function test_separate_linkmods_and_icons_from_classes_function_exists() {
249249

250250
$wp_bootstrap_navwalker = $this->walker;
251251

252252
$this->assertTrue(
253-
method_exists( $wp_bootstrap_navwalker, 'seporate_linkmods_and_icons_from_classes' ),
254-
'Class does not have method seporate_linkmods_and_icons_from_classes.'
253+
method_exists( $wp_bootstrap_navwalker, 'separate_linkmods_and_icons_from_classes' ),
254+
'Class does not have method separate_linkmods_and_icons_from_classes.'
255255
);
256256

257257
}
@@ -260,19 +260,19 @@ public function test_seporate_linkmods_and_icons_from_classes_function_exists()
260260
* Test that the function catches a random assortment of glyphicon icon
261261
* classes mixed with with regular classnames.
262262
*
263-
* @depends test_seporate_linkmods_and_icons_from_classes_function_exists
263+
* @depends test_separate_linkmods_and_icons_from_classes_function_exists
264264
*
265265
* @access public
266266
* @return void
267267
*/
268-
public function test_seporate_linkmods_and_icons_from_classes_fontawesome() {
268+
public function test_separate_linkmods_and_icons_from_classes_fontawesome() {
269269

270270
$wp_bootstrap_navwalker = $this->walker;
271271
// since we're working with private methods we need to use a reflector.
272272
$reflector = new ReflectionClass( 'WP_Bootstrap_Navwalker' );
273273

274274
// get a reflected method for the opener function and set to public.
275-
$method_open = $reflector->getMethod( 'seporate_linkmods_and_icons_from_classes' );
275+
$method_open = $reflector->getMethod( 'separate_linkmods_and_icons_from_classes' );
276276
$method_open->setAccessible( true );
277277

278278
$icons_array = $this->some_fontawesome_classes;
@@ -314,19 +314,19 @@ public function test_seporate_linkmods_and_icons_from_classes_fontawesome() {
314314
* Test that the function catches a random assortment of font awesome icon
315315
* classes mixed with with regular classnames.
316316
*
317-
* @depends test_seporate_linkmods_and_icons_from_classes_function_exists
317+
* @depends test_separate_linkmods_and_icons_from_classes_function_exists
318318
*
319319
* @access public
320320
* @return void
321321
*/
322-
public function test_seporate_linkmods_and_icons_from_classes_glyphicons() {
322+
public function test_separate_linkmods_and_icons_from_classes_glyphicons() {
323323

324324
$wp_bootstrap_navwalker = $this->walker;
325325
// since we're working with private methods we need to use a reflector.
326326
$reflector = new ReflectionClass( 'WP_Bootstrap_Navwalker' );
327327

328328
// get a reflected method for the opener function and set to public.
329-
$method_open = $reflector->getMethod( 'seporate_linkmods_and_icons_from_classes' );
329+
$method_open = $reflector->getMethod( 'separate_linkmods_and_icons_from_classes' );
330330
$method_open->setAccessible( true );
331331

332332
$icons_array = $this->some_glyphicons_classes;
@@ -368,19 +368,19 @@ public function test_seporate_linkmods_and_icons_from_classes_glyphicons() {
368368
* Test that the function catches a random assortment of font awesome icon
369369
* classes mixed with with regular classnames.
370370
*
371-
* @depends test_seporate_linkmods_and_icons_from_classes_function_exists
371+
* @depends test_separate_linkmods_and_icons_from_classes_function_exists
372372
*
373373
* @access public
374374
* @return void
375375
*/
376-
public function test_seporate_linkmods_and_icons_from_classes_linkmods() {
376+
public function test_separate_linkmods_and_icons_from_classes_linkmods() {
377377

378378
$wp_bootstrap_navwalker = $this->walker;
379379
// since we're working with private methods we need to use a reflector.
380380
$reflector = new ReflectionClass( 'WP_Bootstrap_Navwalker' );
381381

382382
// get a reflected method for the opener function and set to public.
383-
$method_open = $reflector->getMethod( 'seporate_linkmods_and_icons_from_classes' );
383+
$method_open = $reflector->getMethod( 'separate_linkmods_and_icons_from_classes' );
384384
$method_open->setAccessible( true );
385385

386386
$valid_linkmods = $this->valid_linkmod_classes;
@@ -439,23 +439,23 @@ public function test_seporate_linkmods_and_icons_from_classes_linkmods() {
439439
* Test that the function catches all possible linkmod classes, any icon
440440
* classes and leaves the other classes as-is on the array.
441441
*
442-
* @depends test_seporate_linkmods_and_icons_from_classes_function_exists
442+
* @depends test_separate_linkmods_and_icons_from_classes_function_exists
443443
*
444-
* @depends test_seporate_linkmods_and_icons_from_classes_fontawesome
445-
* @depends test_seporate_linkmods_and_icons_from_classes_glyphicons
446-
* @depends test_seporate_linkmods_and_icons_from_classes_linkmods
444+
* @depends test_separate_linkmods_and_icons_from_classes_fontawesome
445+
* @depends test_separate_linkmods_and_icons_from_classes_glyphicons
446+
* @depends test_separate_linkmods_and_icons_from_classes_linkmods
447447
*
448448
* @access public
449449
* @return void
450450
*/
451-
public function test_seporate_linkmods_and_icons_from_classes_fulltest() {
451+
public function test_separate_linkmods_and_icons_from_classes_fulltest() {
452452

453453
$wp_bootstrap_navwalker = $this->walker;
454454
// since we're working with private methods we need to use a reflector.
455455
$reflector = new ReflectionClass( 'WP_Bootstrap_Navwalker' );
456456

457457
// get a reflected method for the opener function and set to public.
458-
$method_open = $reflector->getMethod( 'seporate_linkmods_and_icons_from_classes' );
458+
$method_open = $reflector->getMethod( 'separate_linkmods_and_icons_from_classes' );
459459
$method_open->setAccessible( true );
460460

461461
$icons_array = array_merge( $this->some_fontawesome_classes, $this->some_glyphicons_classes );

0 commit comments

Comments
 (0)