Skip to content
Snippets Groups Projects
Verified Commit ddca3cac authored by Bartek Jaskulski's avatar Bartek Jaskulski
Browse files

feat: allow specifing target plugin at boot


Signed-off-by: default avatarBart Jaskulski <bjaskulski@protonmail.com>
parent 46c06d49
No related branches found
No related tags found
2 merge requests!3improve into wp-hook and some additional unfinished things,!21.x
......@@ -48,13 +48,18 @@ final class Init {
}
}
public function boot() {
/**
* @param string|null $filename Filename of the booted plugin. May be null, if called from plugin's main file.
*/
public function boot( string? $filename = null ) {
if ( self::$bootable === false ) {
return;
}
$backtrace = \debug_backtrace( \DEBUG_BACKTRACE_IGNORE_ARGS, 1 );
$filename = $backtrace[0]['file'];
if ( $filename === null ) {
$backtrace = \debug_backtrace( \DEBUG_BACKTRACE_IGNORE_ARGS, 1 );
$filename = $backtrace[0]['file'];
}
$extensions = new ExtensionsSet(
new BuiltinExtension(),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment