-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Display heading levels dynamically in Heading Options when Heading block is selected #14689
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
Changes from 1 commit
6791ea6
a75eef2
590592c
d0ab84a
e5d5256
cf484c4
9e71339
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,7 +36,7 @@ function HeadingEdit( { | |
| const tagName = 'h' + level; | ||
| const BlockControlsLevelsRange = ( levelChoices.length <= 3 ) ? | ||
| levelChoices : | ||
| levelChoices.slice( 1, 4 ); | ||
| levelChoices.slice( 1, 4 ); // | ||
|
||
| return ( | ||
| <Fragment> | ||
| <BlockControls> | ||
|
|
@@ -83,6 +83,7 @@ function HeadingEdit( { | |
| } | ||
|
|
||
| export default withSelect( ( select ) => { | ||
| // Parse the h1,h2,h3... choices to level numbers and pass it as a prop. | ||
| const levelChoices = get( | ||
| select( 'core/blocks' ).getBlockType( 'core/heading' ), | ||
| [ 'attributes', 'content', 'selector' ], | ||
|
|
||
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 should be camel-cased with an initial lower-case letter.
https://make.wordpress.org/core/handbook/best-practices/coding-standards/javascript/#naming-conventions
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.
Fixed