Merged
Conversation
olafleur-godaddy
approved these changes
Jul 11, 2023
Contributor
olafleur-godaddy
left a comment
There was a problem hiding this comment.
This is awesome work, good job!
.dev/tests/jest/helpers.js
Outdated
| registerBlockType( masonryName, { category: 'common', ...masonrySettings, ...v2Masonry } ); // Register masonry block | ||
| registerBlockType( offsetName, { category: 'common', ...offsetSettings, ...v2Offset } ); // Register offset block | ||
| registerBlockType( stackedName, { category: 'common', ...stackedSettings, ...v2Stacked } ); // Register stacked block | ||
| // const getV2Settings = ( blockMeta, blockSettings ) => { |
Contributor
There was a problem hiding this comment.
If you don't need that code anymore, you can remove it ;)
| public function coblocks_enqueue_scripts_for_core_blocks( $block_content, $block ) { | ||
|
|
||
| $block_name = $block['blockName']; | ||
| $block_attributes = $block['attrs']; |
Contributor
There was a problem hiding this comment.
I have a warning on the front page of my website :
Warning: Undefined array key "attrs" in /var/www/html/wp-content/plugins/coblocks/includes/class-coblocks-block-assets.php on line 519
Member
Author
There was a problem hiding this comment.
Good call! I've added some bail logic for if the block does not have attributes, or a name defined.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The many changes are a first pass to convert the blocks to register in PHP. The reason for this change has several benefits.
By registering in PHP
lightbox, services-script, counter-script, gist-script, events-script, post-carousel-script, tiny-swiper-sciprs, masonry and animation scripts. While a number of these scripts had attempted to render 'per-block', in many cases the whole script would render regardless. This change aligns us with core practice in that regard.Screenshots
Types of changes
How has this been tested?
Acceptance criteria
Checklist: