Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions data-machine-code.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,16 @@ function datamachine_code_bootstrap() {
add_action('wp_abilities_api_categories_init', 'datamachine_code_register_ability_categories');
}
add_action('plugins_loaded', 'datamachine_code_bootstrap', 20);
add_action(
'activated_plugin',
static function (): void {
datamachine_code_bootstrap();
},
20
);
if ( function_exists('did_action') && did_action('plugins_loaded') ) {
datamachine_code_bootstrap();
}

/**
* Register DMC-owned webhook verifier modes with Data Machine core.
Expand Down
2 changes: 2 additions & 0 deletions tests/smoke-github-issue-publish-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
$assert(false !== strpos($handler, 'GitHubAbilities::createIssue'), 'handler delegates issue creation to GitHubAbilities');
$assert(false !== strpos($settings, "'labels'") && false !== strpos($settings, "'assignees'"), 'settings expose labels and assignees defaults');
$assert(false !== strpos($plugin, 'new \\DataMachineCode\\Handlers\\GitHub\\GitHubIssuePublish();'), 'plugin bootstraps GitHub issue publish handler');
$assert(false !== strpos($plugin, "did_action('plugins_loaded')") && false !== strpos($plugin, 'datamachine_code_bootstrap();'), 'plugin bootstraps immediately when loaded after plugins_loaded');
$assert(false !== strpos($plugin, "'activated_plugin'") && false !== strpos($plugin, 'datamachine_code_bootstrap();'), 'plugin retries bootstrap after late activation completes');

echo "\n";
if (empty($failures) ) {
Expand Down
Loading