File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed
projects/plugins/jetpack/extensions Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -86,14 +86,21 @@ function setBetaBlockTitle( settings, name ) {
8686 const { title, keywords } = settings ;
8787 const titleSuffix = '(beta)' ;
8888 const betaKeyword = 'beta' ;
89-
90- return {
89+ const result = {
9190 ...settings ,
92- title : title . toLowerCase ( ) . endsWith ( titleSuffix )
93- ? title
94- : `${ settings . title } ${ titleSuffix } ` ,
95- kewords : keywords . includes ( betaKeyword ) ? keywords : [ ...keywords , betaKeyword ] ,
9691 } ;
92+
93+ if ( title ) {
94+ result . title = title . toLowerCase ( ) . endsWith ( titleSuffix )
95+ ? title
96+ : `${ settings . title } ${ titleSuffix } ` ;
97+ }
98+
99+ if ( Array . isArray ( keywords ) ) {
100+ result . keywords = keywords . includes ( betaKeyword ) ? keywords : [ ...keywords , betaKeyword ] ;
101+ }
102+
103+ return result ;
97104}
98105
99106addFilter ( 'blocks.registerBlockType' , 'jetpack/label-beta-blocks-title' , setBetaBlockTitle ) ;
You can’t perform that action at this time.
0 commit comments