Skip to content

Commit

Permalink
Merge pull request #1205 from mboynes/patch-1
Browse files Browse the repository at this point in the history
Fixing typo in menu bulk deleting
  • Loading branch information
danielbachhuber committed May 14, 2014
2 parents b69da34 + c582fa3 commit bdd601c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
22 changes: 22 additions & 0 deletions features/menu.feature
Expand Up @@ -18,6 +18,21 @@ Feature: Manage WordPress menus
0
"""

When I run `wp menu create "First Menu"`
And I run `wp menu create "Second Menu"`
And I run `wp menu list --fields=name,slug`
Then STDOUT should be a table containing rows:
| name | slug |
| First Menu | first-menu |
| Second Menu | second-menu |

When I run `wp menu delete "First Menu" "Second Menu"`
And I run `wp menu list --format=count`
Then STDOUT should be:
"""
0
"""

Scenario: Assign / remove location from a menu

When I run `wp theme install p2 --activate`
Expand Down Expand Up @@ -86,3 +101,10 @@ Feature: Manage WordPress menus
"""
2
"""

When I run `wp menu item delete {POST_ITEM_ID} {TERM_ITEM_ID}`
And I run `wp menu item list sidebar-menu --format=count`
Then STDOUT should be:
"""
0
"""
2 changes: 1 addition & 1 deletion php/commands/menu.php
Expand Up @@ -74,7 +74,7 @@ public function delete( $args, $_ ) {

foreach( $args as $arg ) {

$ret = wp_delete_nav_menu( $args[0] );
$ret = wp_delete_nav_menu( $arg );

if ( ! $ret || is_wp_error( $ret ) ) {

Expand Down

0 comments on commit bdd601c

Please sign in to comment.