Skip to content

Conversation

@dwanjuki
Copy link
Contributor

All Submissions:

Changes proposed in this Pull Request:

Removed the pmpro_courses_block_scripts function hooked on enqueue_block_editor_assets to stop the blocks being registered twice. The register_block_type function already enqueues editor assets based on the contents of block.json. Resolves warnings:

Block "pmpro-courses/my-courses" is already registered.
Block "pmpro-courses/all-courses" is already registered.

Returning a fragment instead of an array of elements in the block edit functions. Resolves:

Each child in a list should have a unique "key" prop.

Added __nextHasNoMarginBottom and __next40pxDefaultSize props to TextControls to adopt new default field spacing/sizing and prevent deprecation warnings.

36px default size for wp.components.TextControl is deprecated
Bottom margin styles for wp.components.TextControl is deprecated

Rebuilt assets.

How to test the changes in this Pull Request:

The deprecation warnings can be triggered by adding a course block to a page. Applying the PR resolves all warnings.

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you successfully run tests with your changes locally?

register_block_type enqueues assets defined in block.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant