-
Notifications
You must be signed in to change notification settings - Fork 383
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
Expose and store queried object for validated URL; show edit link #1426
Conversation
97dfd89
to
3a4d574
Compare
* Update HTML comment in valudation response to be AMP_VALIDATION with results as array item. * Include queried_object as another item in the AMP_VALIDATION, with type and id. * Add type-specific edit links to the AMP invalid URL screen's status metabox, if user has capability to edit.
3a4d574
to
93cb6ed
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved
Hi @westonruter,
This looks good.
Thanks a lot for storing the queried object. This will also help with displaying the title at the top of this screen.
<div class="misc-pub-section"> | ||
<?php | ||
$view_label = __( 'View URL', 'amp' ); | ||
$queried_object = get_post_meta( $post->ID, '_amp_queried_object', true ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea to store the queried object. This will also help with displaying the title, like on this design:
$view_label = $post_type_object->labels->view_item; | ||
} elseif ( 'term' === $queried_object['type'] && get_term( $queried_object['id'] ) && taxonomy_exists( get_term( $queried_object['id'] )->taxonomy ) ) { | ||
$taxonomy_object = get_taxonomy( get_term( $queried_object['id'] )->taxonomy ); | ||
edit_term_link( $taxonomy_object->labels->edit_item, '', $after, get_term( $queried_object['id'] ) ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$validity['url'], | ||
array_merge( | ||
array( | ||
'invalid_url_post' => $post, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was bad. Fixed in #1428
Applies the following part of the design from #1365: