-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Add logic to sort posts by hierarchy #8014
base: trunk
Are you sure you want to change the base?
Add logic to sort posts by hierarchy #8014
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN:
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
2cdb0df
to
096976a
Compare
219a01b
to
48a1d59
Compare
c102ffa
to
a6000fc
Compare
Trac ticket https://core.trac.wordpress.org/ticket/62701
See related Gutenberg issues/PRs:
What
This PR expands the post controller to allow returning the data by parent-child relationship (sort by hierarchy).
Why
We want to display data in a hierarchical way in the site editor, similarly to what we do in wp-admin:
How to test
Added a new test suite to test the logic.
Steps to test this manually:
(alternatively, you may want to generate a gutenberg zip from
trunk
, use the normalwordpress-develop
setup and change the gutenberg's PHP code in the plugin directory)npm install && npm run build:dev
.trunk
, create a.wp-env.override.json
with the following contents (core is the local path of this PR's repository, so change accordingly):npm run wp-env start
. Thennpm install && npm run dev
.localhost:8888
, open the wp-admin, and go to "Tools > Import". Import this theme test data file, that comes with hierarchical pages (or create your own set of pages).