Hooking into Features

You may wish to run additional logic after a feature is registered. This is possible with the Flynt\registerFeature hook.

After each feature is registered, the Flynt\registerFeature action is fired:

<?php

add_action('registerFeature', function ($feature, $options, $dir) {
  // Do something after each feature is registered.
}, 10, 3);

It is also possible to target a specific feature:

<?php

add_action('registerFeature?name=CustomPostTypes', function ($feature, $options, $dir) {
  // Do something when the custom post type feature is registered.
}, 10, 3);