Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd Archives block #7949
Conversation
talldan
added
the
New Block
label
Jul 13, 2018
talldan
self-assigned this
Jul 13, 2018
talldan
added
the
[Status] In Progress
label
Jul 13, 2018
talldan
force-pushed the
add/archives-block
branch
from
82008dd
to
31bccd8
Jul 13, 2018
Soean
reviewed
Jul 13, 2018
this.toggleDisplayAsDropdown = this.toggleDisplayAsDropdown.bind( this ); | ||
} | ||
|
||
toggleShowPostCounts() { |
This comment has been minimized.
This comment has been minimized.
Soean
Jul 13, 2018
Member
Can we use just one toggle function for both attributes? See: https://github.com/WordPress/gutenberg/pull/7941/files#diff-4a7082059a72e724bea52a0a00c65773R35
This comment has been minimized.
This comment has been minimized.
talldan
Jul 16, 2018
Author
Contributor
I've changed this now to a functional component in ad5aa1d as per previous feedback on the old PR, so I don't think making them a single function would be workable now. On the plus side they're both one-liners now. :)
Soean
reviewed
Jul 13, 2018
} | ||
$block_content = sprintf( | ||
'<div class="%1$s">%2$s</div>', |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
talldan
Jul 16, 2018
Author
Contributor
Nice catch! It should be a ul
when rendered as a list, and I've kept it as a div when rendered as a dropdown - 65025c1
talldan
and others
added some commits
Jul 13, 2018
talldan
force-pushed the
add/archives-block
branch
from
31bccd8
to
ad5aa1d
Jul 16, 2018
talldan
added some commits
Jul 16, 2018
talldan
requested review from
noisysocks
and
mcsf
Jul 16, 2018
This comment has been minimized.
This comment has been minimized.
Hey @noisysocks & @mcsf - I think I've addressed all the review feedback from #5495 now. Would be great if one of you could look over may changes to make sure they're ok. Thanks! |
mcsf
added some commits
Jul 16, 2018
mcsf
approved these changes
Jul 16, 2018
export const settings = { | ||
title: __( 'Archives' ), | ||
|
||
description: __( 'Display a monthly archive of your site’s Posts.' ), |
This comment has been minimized.
This comment has been minimized.
mcsf
Jul 16, 2018
Contributor
FWIW, filter widget_archives_dropdown_args
can change the periodic interval, meaning "monthly" may become inaccurate. However, I could see filtering as a more advanced feature, and sticking with "monthly" offers the benefit of conveying the basic idea of the block more clearly than e.g. "Display a periodic archive […]". Because of this, I don't mind sticking with the current copy.
talldan commentedJul 13, 2018
•
edited by mcsf
This PR is a continuation of #5495, moved to a local branch for easier collaboration. Props @miina for the bulk of the implementation.
Uses #5602
Continued archives block implementation from #1518 and #5495. Archive block implementation that uses similar output and filters as the archives widget. Has alignment toolbar within the block (
left
,center
,right
).Screenshots:
Block toolbar:




Inspector toolbar:
Dropdown view:
List view:
Fixes #1464.