Bucket - Editor - #2415
Draft
lucatume wants to merge 818 commits into
Draft
Conversation
tec-bot
reviewed
Mar 3, 2025
tec-bot
reviewed
Jun 11, 2025
| /** | ||
| * Country constructor. | ||
| * | ||
| * since TBD |
Contributor
There was a problem hiding this comment.
[phpcs] reported by reviewdog 🐶Generic.Commenting.DocComment.LongNotCapital
Doc comment long description must start with a capital letter
| /** | ||
| * Country constructor. | ||
| * | ||
| * since TBD |
Contributor
There was a problem hiding this comment.
[phpcs] reported by reviewdog 🐶Generic.Commenting.DocComment.LongNotCapital
Doc comment long description must start with a capital letter
Add tests for plugin logic.
Co-authored-by: Dimitrios Pantazis <dpanta94@gmail.com>
…isting-checks TEC-5583 Don't set opt-in option prematurely
This is an automated PR created by Camwyn. Generated by: https://github.com/the-events-calendar/tribe-common/actions/runs/18290811785
…elease/T25.kiteman-c2bd9c9 [BOT] Version bump for 'release/T25.kiteman'
This is an automated PR created by Camwyn. Generated by: https://github.com/the-events-calendar/tribe-common/actions/runs/18290937313
…lease/T25.kiteman-with-6c2be06 [BOT] Generate POT file for 'release/T25.kiteman'
This is an automated PR created by Camwyn. Generated by: https://github.com/the-events-calendar/tribe-common/actions/runs/18291382146
…log/2025-10-07/6.9.6/1e311504a [BOT] Process changelog for 'release/T25.kiteman'
This is an automated PR created by rafsuntaskin. Generated by: https://github.com/the-events-calendar/tribe-common/actions/runs/18317717110
…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
…ort_button Added settimeout for opening the support beacon.
This is an automated PR created by dpanta94. Generated by: https://github.com/the-events-calendar/tribe-common/actions/runs/19439595240
…lease/T25.moonknight-with-9b13c94 [BOT] Generate POT file for 'release/T25.moonknight'
This is an automated PR created by dpanta94. Generated by: https://github.com/the-events-calendar/tribe-common/actions/runs/19442599189
…log/2025-11-18/6.10.0/0ac028682 [BOT] Process changelog for 'release/T25.moonknight'
…rmance-improvement Disable shepherd cleanup task by default
T25.moonknight sanity check
tec-bot
reviewed
Nov 24, 2025
| $post_id = get_the_ID(); | ||
|
|
||
| if ( ! $post_id ) { | ||
| $post_id = Arr::get_first_set( $_REQUEST, [ 'post', 'post_id', 'post_ID' ] ) |
Contributor
There was a problem hiding this comment.
[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' ] ); |
Contributor
There was a problem hiding this comment.
[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.
…t-domain Fix plugin textdomain loading
…nsion Add Suite_Env extension
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.
Add testing Filters facility
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.
No description provided.