Skip to content

Bucket - Editor - #2415

Draft
lucatume wants to merge 818 commits into
masterfrom
bucket/editor
Draft

Bucket - Editor#2415
lucatume wants to merge 818 commits into
masterfrom
bucket/editor

Conversation

@lucatume

@lucatume lucatume commented Feb 24, 2025

Copy link
Copy Markdown
Contributor

No description provided.

@lucatume lucatume self-assigned this Feb 24, 2025
Comment thread src/functions/editor.php
/**
* Country constructor.
*
* since TBD

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[phpcs] reported by reviewdog 🐶
Generic.Commenting.DocComment.LongNotCapital
Doc comment long description must start with a capital letter

/**
* Country constructor.
*
* since TBD

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[phpcs] reported by reviewdog 🐶
Generic.Commenting.DocComment.LongNotCapital
Doc comment long description must start with a capital letter

Camwyn and others added 27 commits October 3, 2025 10:23
Co-authored-by: Dimitrios Pantazis <dpanta94@gmail.com>
…isting-checks

TEC-5583 Don't set opt-in option prematurely
…elease/T25.kiteman-c2bd9c9

[BOT] Version bump for 'release/T25.kiteman'
…lease/T25.kiteman-with-6c2be06

[BOT] Generate POT file for 'release/T25.kiteman'
…log/2025-10-07/6.9.6/1e311504a

[BOT] Process changelog for 'release/T25.kiteman'
…elease/T25.krypto-e1d3c33

[BOT] Version bump for 'release/T25.krypto'
This component is intended to be the wrapper for each main field in the Classy application
Because this attribute was applied directly to the <svg> element, it was overriding applied styles from the stylesheet. This allows for the stylesheet to specify the fill for the element.
These 2 components are intended to facilitate consistency across the Classy application when it comes to structure and styling.

* ClassyModal wraps the WordPress <Modal> element with our typical settings and styling classes
* ClassyActions is meant as a wrapper for <Button> elements that handle the modal actions
redscar and others added 18 commits November 14, 2025 11:34
…ort_button

Added settimeout for opening the support beacon.
…lease/T25.moonknight-with-9b13c94

[BOT] Generate POT file for 'release/T25.moonknight'
…log/2025-11-18/6.10.0/0ac028682

[BOT] Process changelog for 'release/T25.moonknight'
…rmance-improvement

Disable shepherd cleanup task by default
$post_id = get_the_ID();

if ( ! $post_id ) {
$post_id = Arr::get_first_set( $_REQUEST, [ 'post', 'post_id', 'post_ID' ] )

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[phpcs] reported by reviewdog 🐶
WordPress.Security.NonceVerification.Recommended
Processing form data without nonce verification.


if ( ! $post_id ) {
$post_id = Arr::get_first_set( $_REQUEST, [ 'post', 'post_id', 'post_ID' ] )
?? Arr::get_first_set( $_GET, [ 'post', 'post_id', 'post_ID' ] );

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[phpcs] reported by reviewdog 🐶
WordPress.Security.NonceVerification.Recommended
Processing form data without nonce verification.

This updates the controller test case to manage and use the concept of
"sub-controllers".
Sub-controllers are stand-alone controllers that are managed, in their
registration and unregistrations lifecycle, by a "main" controller.

While testing a main controller it's likely there will be a need to test
whether certain pre-conditions affect the registration of a certain
sub-controller or not.

Example:
```
// file Main_Controller.php
class Main_Controller extends TEC\Common\Contracts\Provider\Controller {
  public function do_register(): void {
    add_action('some_action', [$this, 'on_some_action']);

    if(get_option('sub_feature_active')){
      $this->container->register(Sub_Controller::class);
    }
  }

  public function unregister(): void {
    remove_action('some_action', [$this, 'on_some_action']);

    if(get_option('sub_feature_active')){
      // The sub-controller will hook on the `feature_action` the
      `on_feature_action` method.
      $this->container->get(Sub_Controller::class)->unregister();
    }
  }
}
```

A test case for the `Main_Controller` would likely need to check on the
`Sub_Controller` registration as well.

```
class Main_Controller_Test extends
TEC\Common\Tests\Provider\Controller_Test_Case
{
  protected $controller_class = Main_Controller::class;
  protected $sub_controller_classes = [Sub_Controller::class];

  public function test_sub_controller_not_registered(): void{
    // The sub-controller registration guard.
    update_option('sub_feature_active', false);

    // Build and register the main controller.
    $controller = $this->make_controller();
    $sub_controller = tribe()->get(Sub_Controller::class);

    $this->assertFalse(has_action(
      'feature_action',
      [$sub_controller, 'on_feature_action']
    ));
  }

  public function test_sub_controller_registered(): void{
    // The sub-controller registration guard.
    update_option('sub_feature_active', true);

    // Build and register the main controller.
    $controller = $this->make_controller();
    $sub_controller = tribe()->get(Sub_Controller::class);

    $this->assertEquals(10, has_action(
      'feature_action',
      [$sub_controller, 'on_feature_action']
    ));
  }
}
```

The `sub_controller_classes` optional property does not break
back-compatibility wit existing test code, but adds a new feature to
manage, at test-time, the correct unregistration of sub-controllers that
might be registered during the plugin load.
…-support

Manage sub-controller in test case
This fixes the logic that would load plugin translation files from
custom paths part of the plugins to work correctly.
Starting from WordPress 6.7.1, **not** 6.7.0 which is the currently
minimum supported version, the `load_plugin_textdomain()` function will
reset the global `l10n`; the first fix consists in making sure that
reset is replicated in the context of sites running WordPress 6.7.0.

The second fix is needed regardless of the WordPress version: when a
translation is required early (e.g. a call to the `__()` function for
the plugin domain) then the translations are loaded early and, **in the
registry** set to `false` to indicate no translation file was found for
that domain and locale.
The `load_plugin_textdomain()` function will not reset that value in the
registry, but it will set the registry to include a custom path to look
for the plugin file. That custom path will not be used, though, since
the translation registry will not look up the files again. The
`$wp_textdomain_registry->set()` call overrides that cached value
providing now a translation file for the domain and locale.
This adds the `TEC\Common\Tests\Filters` class to allow adding filters
and actions before or after WordPress is loaded.

Under the hood the class will use the pre-initialized hook system from
the `WP_Hook::build_preinitialized_hooks` method to add filters and
actions before WordPress is loaded.
The functions will fall-back to use the `add_filter` and `add_action`
functions if they are defined the moment the functions are called making
them safe to use even after WorPress has loaded.
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.

10 participants