Skip to content

Commit

Permalink
refactor: improved EditorAssetsProvider after inline scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
rezaelahidev committed Nov 12, 2024
1 parent f4f346f commit 318efb0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/blockera/php/Providers/EditorAssetsProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,15 @@ function ( string $block_type ) use ( $editor_object, $app ): string {
apply_filters( 'blockera/assets/provider/inline-script/register/3rd-party-blocks/attributes', [] )
);

return implode( ";\n", $blocks_attributes_scripts ) . '
$script = implode( ";\n", $blocks_attributes_scripts ) . '
' . $editor_object . '.editor.unstableRegistrationSharedBlockAttributes(' . wp_json_encode( $shared_block_attributes ) . ');';

if ( false !== strpos( $inline_script, $script ) ) {

return $inline_script;
}

return sprintf( '%s%s', $inline_script . PHP_EOL, $script );
}

/**
Expand Down

0 comments on commit 318efb0

Please sign in to comment.