Permalink
Browse files

Fix fatal error on WP 5.0 Beta (#51)

  • Loading branch information...
AlexBordei authored and ajitbohra committed Oct 29, 2018
1 parent e5aedd0 commit 49f30247adb3fa7202b23a1beea7bef34412a6f4
@@ -44,7 +44,7 @@ function gutenberg_examples_01_esnext_register_block() {
'gutenberg-examples-01-esnext',
sprintf(
'var gutenberg_examples_01_esnext = { localeData: %s };',
json_encode( gutenberg_get_jed_locale_data( 'gutenberg-examples' ) )
json_encode( ! function_exists( 'wp_get_jed_locale_data' ) ? gutenberg_get_jed_locale_data( 'gutenberg-examples' ) : wp_get_jed_locale_data( 'gutenberg-examples' ) )
),
'before'
);
@@ -44,7 +44,7 @@ function gutenberg_examples_01_register_block() {
'gutenberg-examples-01',
sprintf(
'var gutenberg_examples_01 = { localeData: %s };',
json_encode( gutenberg_get_jed_locale_data( 'gutenberg-examples' ) )
json_encode( ! function_exists( 'wp_get_jed_locale_data' ) ? gutenberg_get_jed_locale_data( 'gutenberg-examples' ) : wp_get_jed_locale_data( 'gutenberg-examples' ) )
),
'before'
);
@@ -58,7 +58,7 @@ function gutenberg_examples_02_register_block() {
*/
wp_add_inline_script(
'gutenberg-examples-02',
'wp.i18n.setLocaleData( ' . json_encode( gutenberg_get_jed_locale_data( 'gutenberg-examples' ) ) . ', "gutenberg-examples" );',
'wp.i18n.setLocaleData( ' . json_encode( ! function_exists( 'wp_get_jed_locale_data' ) ? gutenberg_get_jed_locale_data( 'gutenberg-examples' ) : wp_get_jed_locale_data( 'gutenberg-examples' ) ) . ', "gutenberg-examples" );',
'before'
);
@@ -60,7 +60,7 @@ function gutenberg_examples_03_esnext_register_block() {
'gutenberg-examples-03-esnext',
sprintf(
'var gutenberg_examples_03_esnext = { localeData: %s };',
json_encode( gutenberg_get_jed_locale_data( 'gutenberg-examples' ) )
json_encode( ! function_exists( 'wp_get_jed_locale_data' ) ? gutenberg_get_jed_locale_data( 'gutenberg-examples' ) : wp_get_jed_locale_data( 'gutenberg-examples' ) )
),
'before'
);
@@ -60,7 +60,7 @@ function gutenberg_examples_03_register_block() {
'gutenberg-examples-03',
sprintf(
'var gutenberg_examples_03 = { localeData: %s };',
json_encode( gutenberg_get_jed_locale_data( 'gutenberg-examples' ) )
json_encode( ! function_exists( 'wp_get_jed_locale_data' ) ? gutenberg_get_jed_locale_data( 'gutenberg-examples' ) : wp_get_jed_locale_data( 'gutenberg-examples' ) )
),
'before'
);
@@ -60,7 +60,7 @@ function gutenberg_examples_04_esnext_register_block() {
'gutenberg-examples-04-esnext',
sprintf(
'var gutenberg_examples_04_esnext = { localeData: %s };',
json_encode( gutenberg_get_jed_locale_data( 'gutenberg-examples' ) )
json_encode( ! function_exists( 'wp_get_jed_locale_data' ) ? gutenberg_get_jed_locale_data( 'gutenberg-examples' ) : wp_get_jed_locale_data( 'gutenberg-examples' ) )
),
'before'
);
@@ -60,7 +60,7 @@ function gutenberg_examples_04_register_block() {
'gutenberg-examples-04',
sprintf(
'var gutenberg_examples_04 = { localeData: %s };',
json_encode( gutenberg_get_jed_locale_data( 'gutenberg-examples' ) )
json_encode( ! function_exists( 'wp_get_jed_locale_data' ) ? gutenberg_get_jed_locale_data( 'gutenberg-examples' ) : wp_get_jed_locale_data( 'gutenberg-examples' ) )
),
'before'
);
@@ -52,7 +52,7 @@ function gutenberg_examples_05_esnext_register_block() {
'gutenberg-examples-05-esnext',
sprintf(
'var gutenberg_examples_05_esnext = { localeData: %s };',
json_encode( gutenberg_get_jed_locale_data( 'gutenberg-examples' ) )
json_encode( ! function_exists( 'wp_get_jed_locale_data' ) ? gutenberg_get_jed_locale_data( 'gutenberg-examples' ) : wp_get_jed_locale_data( 'gutenberg-examples' ) )
),
'before'
);
@@ -52,7 +52,7 @@ function gutenberg_examples_05_register_block() {
'gutenberg-examples-05',
sprintf(
'var gutenberg_examples_05 = { localeData: %s };',
json_encode( gutenberg_get_jed_locale_data( 'gutenberg-examples' ) )
json_encode( ! function_exists( 'wp_get_jed_locale_data' ) ? gutenberg_get_jed_locale_data( 'gutenberg-examples' ) : wp_get_jed_locale_data( 'gutenberg-examples' ) )
),
'before'
);

0 comments on commit 49f3024

Please sign in to comment.