Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add post thumbnail support for v2. #37

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion includes/wp-api-menus-v2.php
Expand Up @@ -280,13 +280,14 @@ public function get_menu_location( $request ) {
$cache = array();

foreach ( $rev_items as $item ) :

$post_id = url_to_postid( $item->url );
Copy link
Author

@samdotme samdotme Nov 15, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why the spacing is off here. I'm using Atom, and it's formatted perfectly. Same for below.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is because of tabs vs spaces

$formatted = array(
'ID' => abs( $item->ID ),
'order' => (int) $item->menu_order,
'parent' => abs( $item->menu_item_parent ),
'title' => $item->title,
'url' => $item->url,
'thumbnail' => has_post_thumbnail( $post_id ) ? get_the_post_thumbnail_url( $post_id ) : '',
'attr' => $item->attr_title,
'target' => $item->target,
'classes' => implode( ' ', $item->classes ),
Expand Down