Skip to content

Commit

Permalink
Fix two typos in lib rest menu controller (#21418)
Browse files Browse the repository at this point in the history
* Fix two typos in lib rest menu controller

Fixes 21416

* Remove stray space characters

> The DB ID of the nav_menu_item that is this item\'s menu parent, if any . 0 otherwise . 

Change to

> The DB ID of the nav_menu_item that is this item\'s menu parent, if any, otherwise 0.
  • Loading branch information
tobifjellner authored Apr 6, 2020
1 parent 370d10d commit 62e7ad8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/class-wp-rest-menu-items-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -422,10 +422,10 @@ protected function prepare_item_for_database( $request ) {
// Check if menu item is type custom, then title and url are required.
if ( 'custom' === $prepared_nav_item['menu-item-type'] ) {
if ( '' === $prepared_nav_item['menu-item-title'] ) {
return new WP_Error( 'rest_title_required', __( 'Title require if menu item of type custom.', 'gutenberg' ), array( 'status' => 400 ) );
return new WP_Error( 'rest_title_required', __( 'Title required if menu item of type custom.', 'gutenberg' ), array( 'status' => 400 ) );
}
if ( empty( $prepared_nav_item['menu-item-url'] ) ) {
return new WP_Error( 'rest_url_required', __( 'URL require if menu item of type custom.', 'gutenberg' ), array( 'status' => 400 ) );
return new WP_Error( 'rest_url_required', __( 'URL required if menu item of type custom.', 'gutenberg' ), array( 'status' => 400 ) );
}
}

Expand Down Expand Up @@ -840,7 +840,7 @@ public function get_item_schema() {
);

$schema['properties']['menu_order'] = array(
'description' => __( 'The DB ID of the nav_menu_item that is this item\'s menu parent, if any . 0 otherwise . ', 'gutenberg' ),
'description' => __( 'The DB ID of the nav_menu_item that is this item\'s menu parent, if any, otherwise 0.', 'gutenberg' ),
'context' => array( 'view', 'edit', 'embed' ),
'type' => 'integer',
'minimum' => 0,
Expand Down

0 comments on commit 62e7ad8

Please sign in to comment.