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 ) {
86
86
const { title, keywords } = settings ;
87
87
const titleSuffix = '(beta)' ;
88
88
const betaKeyword = 'beta' ;
89
-
90
- return {
89
+ const result = {
91
90
...settings ,
92
- title : title . toLowerCase ( ) . endsWith ( titleSuffix )
93
- ? title
94
- : `${ settings . title } ${ titleSuffix } ` ,
95
- kewords : keywords . includes ( betaKeyword ) ? keywords : [ ...keywords , betaKeyword ] ,
96
91
} ;
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 ;
97
104
}
98
105
99
106
addFilter ( 'blocks.registerBlockType' , 'jetpack/label-beta-blocks-title' , setBetaBlockTitle ) ;
You can’t perform that action at this time.
0 commit comments