-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
post-title: add text styling options #31400
Closed
kapilpaul
wants to merge
1
commit into
WordPress:trunk
from
kapilpaul:add/post-title-text-styling-options
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Hi @kapilpaul, thanks for attempting this PR as a first contribution 🎉
However, simply changing the block's component from PlainText to RichText has a number of unexpected effects in other places that use the post title, as it currently is not expected to contain rich text and the new HTML added by the RichText is displayed as content, like in the example below:
Grabacion.de.pantalla.2021-05-03.a.las.18.03.21.mov
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.
Hi @priethor Thanks for reviewing it. I understand this will cause a lot of issues. So in that case, how can I achieve this feature? Do you have anything in mind? Can you please guide me?
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.
Achieving fine-grained styling options that require markup inside the post title content would require quite some architectural changes, so a better approach would be adding styles that affect the whole block rather than the content in a similar way Font Size and Line Height work.
Users won't be able to make "Hello" bold and "world" italic, for example, which I would say is a very specific and not-so-common use case, but the whole block would be bold and/or italic. As these would be saved as block attributes and not inside the post title as markup, other uses of the post title like
get_the_title()
won't be impacted.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.
Exactly that comes to my mind. I will look deeper into it. Thanks for the guidance. I will work on it :)