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

Edit Site: Remove templateIds prop from NavigateToLink #21877

Merged
merged 5 commits into from
May 13, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix logic
  • Loading branch information
ockham committed May 13, 2020
commit 326d349cd3d571734c019669639b2cfa2611728d
2 changes: 1 addition & 1 deletion lib/templates.php
Original file line number Diff line number Diff line change
@@ -183,7 +183,7 @@ function filter_rest_wp_template_collection_params( $query_params ) {
function filter_rest_wp_template_query( $args, $request ) {
if ( $request['resolved'] ) {
$template_ids = array( 0 ); // Return nothing by default (the 0 is needed for `post__in`).
$template_types = $request['slug'] ? array( $request['slug'] ) : get_template_types();
$template_types = $request['slug'] ? $request['slug'] : get_template_types();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the bug I missed in #21981. Turns out that $request['some-param'] is an array 😬


foreach ( $template_types as $template_type ) {
// Skip 'embed' for now because it is not a regular template type.