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

Merged
merged 1 commit into from Sep 13, 2018

Conversation

Projects
None yet
2 participants
@westonruter
Member

westonruter commented Sep 12, 2018

Applies the following part of the design from #1365:

image

@westonruter westonruter added this to the v1.0 milestone Sep 12, 2018

@westonruter westonruter force-pushed the add/invalid-url-edit-link branch from 97dfd89 to 3a4d574 Sep 12, 2018

Expose and store queried object for validated URL; show edit link
* 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.

@westonruter westonruter force-pushed the add/invalid-url-edit-link branch from 3a4d574 to 93cb6ed Sep 13, 2018

@westonruter westonruter changed the title from WIP: Remember queried object when obtaining validation results; show edit post link to Expose and store queried object for validated URL; show edit link Sep 13, 2018

@westonruter westonruter requested a review from kienstra Sep 13, 2018

@kienstra

kienstra approved these changes Sep 13, 2018 edited

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 );

This comment has been minimized.

@kienstra

kienstra Sep 13, 2018

Collaborator

Great idea to store the queried object. This will also help with displaying the title, like on this design:

will-help-with-title

$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'] ) );

This comment has been minimized.

@kienstra

kienstra Sep 13, 2018

Collaborator

edit-term-link

@kienstra

This comment has been minimized.

Collaborator

kienstra commented Sep 13, 2018

This will help with #1365, so I'll merge in the develop branch to its PR once this is merged.

@westonruter westonruter merged commit 1992dbd into develop Sep 13, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@westonruter westonruter deleted the add/invalid-url-edit-link branch Sep 13, 2018

$validity['url'],
array_merge(
array(
'invalid_url_post' => $post,

This comment has been minimized.

@westonruter

westonruter Sep 14, 2018

Member

This was bad. Fixed in #1428

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment