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

Allow custom orderby in Gutenberg block preview #98

Closed
christophrado opened this issue Sep 22, 2020 · 1 comment
Closed

Allow custom orderby in Gutenberg block preview #98

christophrado opened this issue Sep 22, 2020 · 1 comment

Comments

@christophrado
Copy link

We're using SCPO alongside custom blocks that allow setting a custom order of objects.
SCPO overwrites the orderby parameter in queries within blocks in the editor preview/admin.

I narrowed the issue down to line 498, where the check says
if (isset($wp_query->query['post_type']) && !isset($_GET['orderby'])) {
Changing this to
if (isset($wp_query->query['post_type']) && !isset($wp_query->query['orderby'])) {
allows for queries with custom orderby values within the editor.

I've not found any issues with rewriting this line. Orders set by SCPO still work in other admin screens. This might need more testing though. If this isn't conflicting with other screens, I'd welcome this change for better block compatibility.

andyluak added a commit to WPChill/simple-custom-post-order that referenced this issue May 12, 2021
@giucu91
Copy link
Contributor

giucu91 commented May 27, 2021

fixed in 2.5.5

@giucu91 giucu91 closed this as completed May 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants