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

Latest Posts Block: Hardcode class for post date #4018

Closed
wants to merge 1 commit into from

Conversation

Soean
Copy link
Member

@Soean Soean commented Dec 14, 2017

Description

The class for the post date in the Latest posts block should always be wp-block-latest-posts__post-date. Without this PR the class changes, when the user adds an additional class to the block.

@aduth
Copy link
Member

aduth commented Dec 15, 2017

The class for the post date in the Latest posts block should always be wp-block-latest-posts__post-date.

Hmm, my understanding of the className prop was that we didn't want block implementers to assume what the class name would be, in which case we'd want to avoid such hard-coding.

@Soean
Copy link
Member Author

Soean commented Dec 29, 2017

Its just the class for the date. The class is also hard-coded in the PHP file: https://github.com/WordPress/gutenberg/blob/update/latest-posts-postdate-class/blocks/library/latest-posts/index.php#L41

If I add an additional class xxx to the block, the date class changes from wp-block-latest-posts__post-date to wp-block-latest-posts xxx__post-date

@aduth
Copy link
Member

aduth commented Jan 3, 2018

Its just the class for the date. The class is also hard-coded in the PHP file: https://github.com/WordPress/gutenberg/blob/update/latest-posts-postdate-class/blocks/library/latest-posts/index.php#L41

Makes me wonder if it should. If we're providing utilities for save implementation in the client to assign a class name, should these same utilities not exist for a dynamic block's render?

@youknowriad
Copy link
Contributor

What's the next step here? Add server side generated className to the render callback?

@danielbachhuber
Copy link
Member

Closing per #4018 (comment)

@danielbachhuber danielbachhuber deleted the update/latest-posts-postdate-class branch May 22, 2018 16:54
@Soean Soean mentioned this pull request Dec 9, 2018
4 tasks
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

Successfully merging this pull request may close these issues.

4 participants