-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 "Archives" block #1518
Add "Archives" block #1518
Conversation
For alignment options, see #1803. |
@@ -23,4 +23,5 @@ | |||
|
|||
// Register server-side code for individual blocks. | |||
require_once dirname( __FILE__ ) . '/lib/blocks/latest-posts.php'; | |||
require_once dirname( __FILE__ ) . '/lib/blocks/archives.php'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be changed in light of #2014.
/** | ||
* WordPress dependencies | ||
*/ | ||
import { Component } from 'element'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note with #2172, these need to be updated to prefix the dependencies with @wordpress/
. You will need to perform a rebase against the latest version of master and apply your changes:
git fetch origin
git rebase origin/master
@swissspidy, do you plan to continue the work started in this PR. It might require some extra work to make it up to date. |
Not sure what the issue was, but you can see how it was done for the Latest Posts block. See https://github.com/WordPress/gutenberg/tree/master/blocks/library/latest-posts. |
@swissspidy I don't think that we should use the REST API to populate the editor preview. We could instead use the |
So this should move forward now without |
@swissspidy since the ticket can move forward without |
@miina Go for it! :) Feel free to pick some bits of this PR and let me know if I can help with anything. |
Closing in favor of #1518 where this work is being picked up. |
For reference: I guess it's #5495 |
This is a possible implementation for an archives block that uses the same code as the archives widget currently in code. The same code and filters are used for output on the front end, so there shouldn't be any BC concerns.
Todo:
Right now, a fake loading screen is shown in the editor.
Probably something to happen in core directly, see Add Block: Archive #1464 (comment)). Not really a blocker for this implementation
Screenshots:
Fixes #1464.