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

Editor: Return previewLink from post link only if available #12800

Merged
merged 4 commits into from Dec 21, 2018

Conversation

Projects
None yet
3 participants
@aduth
Copy link
Member

aduth commented Dec 11, 2018

Fixes #12677

This pull request seeks to resolve an error which occurs when autosaving a post whose post type is registered using 'publicly_queryable' => false.

An in-depth explanation of the issue can be found at #12677 (comment) .

Testing instructions:

Verify using the following example post type definition that autosave occurs without error:

<?php

/**
 * Plugin Name: Demo CPT
 */
add_action( 'init', function() {
	register_post_type( 'book', [
		'label' => 'Book',
		'show_in_rest' => true,
		'public' => true,
		'publicly_queryable' => false,
		'supports' => [ 'title', 'editor', 'revisions' ],
	] );
} );
@jorgefilipecosta
Copy link
Member

jorgefilipecosta left a comment

LGTM 👍 It fixed the problem in my tests.

@youknowriad youknowriad added this to the 4.8 milestone Dec 20, 2018

@youknowriad youknowriad merged commit 13683ff into master Dec 21, 2018

1 check passed

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

@youknowriad youknowriad deleted the fix/12677-preview-link-empty branch Dec 21, 2018

youknowriad added a commit that referenced this pull request Jan 3, 2019

Editor: Return previewLink from post link only if available (#12800)
* Editor: Return previewLink from post link only if available

* Editor: Add CHANGELOG entry for publicly_queryable autosave fix

* Editor: Resolve previewLink lint errors

* Editor: Document autosave error handling
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment