Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend the dynamic implementation of oik-block/blocklist to "Determine updates to apply" #88

Closed
bobbingwide opened this issue Sep 26, 2022 · 3 comments
Assignees
Labels
enhancement Gutenberg WordPress 5.0 block editor

Comments

@bobbingwide
Copy link
Owner

bobbingwide commented Sep 26, 2022

In bobbingwide/oik-blocks#57 I've added a new toggle for the oik-block/blocklist block.
Labeled "Determine updates to apply" this toggle can be used to indicate to the oik-shortcodes plugin that it should extend the dynamic processing of the oik-block/blocklist block.

Requirement

  • Improve ability to determine which blocks need to be newly catalogued, updated or deleted.
  • Automatically add blocks during server rendering of the block list, for particular settings.

Proposed solution

  • Extend the dynamic rendering of the oik-blocks/blocklist block by implementing a filter function for render_block_oik-block/blocklist.
  • When the determineUpdates attribute is true, showBatch is true, and showBlockLink is true then extend the processing to determine, and potentially apply, updates to the blocks catalogued for the selected component.
  • The server logic should take into account the showVariations setting. When it's false then it shouldn't report registered variations as needing deletion.
  • The server logic should also take into account each block's prefix, which is different from the component.
@bobbingwide bobbingwide added enhancement Gutenberg WordPress 5.0 block editor labels Sep 26, 2022
@bobbingwide bobbingwide self-assigned this Sep 26, 2022
@bobbingwide
Copy link
Owner Author

The server logic should also take into account each block's prefix, which is different from the component.

For the Stackable plugin there are 28 blocks which are prefixed ugb - version 2 blocks. When processing the list of blocks prefixed ugb any blocks prefixed stackable should be ignored. Similarly for stackable; ignore ugb blocks.

@bobbingwide
Copy link
Owner Author

The dynamic rendering should only be performed when the block is being processed on the front end, not during save.
How do we check for this?

@bobbingwide
Copy link
Owner Author

Released in v1.41.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Gutenberg WordPress 5.0 block editor
Projects
None yet
Development

No branches or pull requests

1 participant