Skip to content

Commit

Permalink
refactor: register channel during init
Browse files Browse the repository at this point in the history
  • Loading branch information
johnhooks committed Apr 11, 2023
1 parent 1f9879b commit cb4954e
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions wp-feature-notifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,18 @@
// TODO: Standardise structure and/or autoloading.
new REST\Notification_Controller();

register_channel(
new Notifications\Channel(
'core/updates',
array(
'title' => __( 'WordPress Updates', 'wp-feature-notifications' ),
'icon' => 'wordpress',
'description' => __( 'WordPress core update events.', 'wp-feature-notifications' ),
)
)
add_action(
'init',
function () {
register_channel(
new Notifications\Channel(
'core/updates',
array(
'title' => __( 'WordPress Updates', 'wp-feature-notifications' ),
'icon' => 'wordpress',
'description' => __( 'WordPress core update events.', 'wp-feature-notifications' ),
)
)
);
}
);

0 comments on commit cb4954e

Please sign in to comment.