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

Do not render font size picker when no font sizes are available and custom font sizes are disabled #13844

Conversation

jorgefilipecosta
Copy link
Member

Description

If the theme sets an empty array as font sizes and disables custom font sizes the user is not able to select any font size so the font size picker should not render.

How has this been tested?

I added the following code snippet in functions.php:

add_theme_support('disable-custom-font-sizes');
add_theme_support( 'editor-font-sizes',  array() );

I added a paragraph, and I verified the font size picker does not appear.

Screenshots

Before:
screenshot 2019-02-12 at 20 10 57

After:
screenshot 2019-02-12 at 20 51 42

@jorgefilipecosta jorgefilipecosta added [Type] Bug An existing feature does not function as intended [Package] Components /packages/components labels Feb 12, 2019
@gziolo gziolo added the Good First Review A PR that's suitable for someone looking to contribute for the first time by reviewing code label Feb 12, 2019
@gziolo gziolo added this to the 5.1 (Gutenberg) milestone Feb 12, 2019
Copy link
Member

@chrisvanpatten chrisvanpatten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@jorgefilipecosta jorgefilipecosta merged commit 73683aa into master Feb 13, 2019
@jorgefilipecosta jorgefilipecosta deleted the fix/do-not-display-font-size-picker-if-not-font-sizes-are-available-and-custom-fontsizes-are-disable branch February 13, 2019 10:20
youknowriad pushed a commit that referenced this pull request Mar 6, 2019
youknowriad pushed a commit that referenced this pull request Mar 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Review A PR that's suitable for someone looking to contribute for the first time by reviewing code [Package] Components /packages/components [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants