-
Notifications
You must be signed in to change notification settings - Fork 5
kernel
Simone Montali edited this page Sep 2, 2019
·
1 revision
Aeria's kernel is simple, yet powerful. It autonomously boots what it needs, without having you do anything.
You may want to do things while Aeria is booting. That's why we added the possibility to extend the kernel with custom functions.
To do so, you just have to extend the abstract class Aeria\Kernel\AbstractClasses\Task
. This class contains 2 properties and a method:
-
$priority
decides the invocation order. Don't know what to use? Check the priorities section. -
$admin_only
is a boolean, true if the function must be executed in admin only. -
do(array $args)
is the function you want to implement. By default,$args
contains 3 values:-
'container'
, Aeria's container. -
'config'
, Aeria's configuration. -
'service'
, containing references to the various Aeria's services.
-
You can set $priority
to whatever number you like, floats too. By default, Aeria's kernel contains 9 functions:
Key | priority | admin_only |
---|---|---|
create_post_type | 1 | false |
create_field | 2 | false |
create_taxonomy | 3 | false |
create_meta | 4 | true |
create_updater | 5 | true |
create_options | 6 | true |
create_renderer | 7 | false |
create_controllers | 8 | false |
create_router | 9 | false |