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

Refactor block-override-functions as extendable classes #33

Closed
2 tasks
bobbingwide opened this issue Nov 14, 2020 · 2 comments
Closed
2 tasks

Refactor block-override-functions as extendable classes #33

bobbingwide opened this issue Nov 14, 2020 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@bobbingwide
Copy link
Owner

bobbingwide commented Nov 14, 2020

For issues #27, #30, and #31, and the original issue #7, I've developed a solution that's not particularly extendable.
I want to deliver my solution as a fix for the issue(s) I've raised on Gutenberg.

But, I don't know how to deliver the solution to Gutenberg such that it can then go into core.

Proposed solution

  • Attempt to refactor the solution using classes
  • Implement classes that extend the base class to produce block specific problem determination support.
@bobbingwide bobbingwide added the enhancement New feature or request label Nov 14, 2020
@bobbingwide bobbingwide self-assigned this Nov 14, 2020
@bobbingwide bobbingwide changed the title Refactor block-override-functions as class Fizzie_Block_Recursion_Control Refactor block-override-functions as extendable classes Nov 15, 2020
@bobbingwide
Copy link
Owner Author

In the first refactoring there was only one class Fizzie_Block_Recursion_Control
This contained both the recursion control and the error reporting.

In the second refactoring there will be three classes:

Class Description
Fizzie_Block_Recursion_Control Keeps track of nested blocks
Fizzie_Block_Recursion_Error Reports the recursion error to the front end
Fizzie_Block_Recursion_Error_Blocks extends Fizzie_Block_Recursion_Error for reusable blocks

The three public APIs will be:

  • fizzie_process_this_content( $id, $block_name );
  • fizzie_clear_processed_content();
  • fizzie_report_recursion_error( $message, $class );

plus

  • fizzie_maybe_override_block filter function

There are parameter changes which will have to be applied.
The implementing files will be in the includes folder

File Contains
class-block-recursion-control.php Fizzie_Block_Recursion_Control
class-block-recursion-error.php Fizzie_Block_Recursion_Error
class-block-recursion-error-block Fizzie_Block_Recursion_Error_Block
block-override-functions.php 4 public APIs
block-overrides.php control routine for Fizzie's block overrides

@bobbingwide
Copy link
Owner Author

Delivered in v0.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant