cedaro / satispress

Expose installed WordPress plugins and themes as Composer packages.
500 stars 49 forks source link

Load the plugin at plugins_loaded:5 #73

Closed bradyvercher closed 5 years ago

bradyvercher commented 5 years ago

Splitting the priority when the plugin is loaded meant that some extensions wouldn't be able to use the satispress_compose action to modify the filter, so they would have to load before SatisPress and check to make sure it exists first. The current logging example shows how this has to be done.

Registering the entire plugin at plugins_loaded:5 makes it cleaner for extensions to hook in without needing to check to see if SatisPress exists first.

add_action( 'satispress_compose', function( $plugin, $container ) {
    // $container['logger'] = ...
} );

@GaryJones Do you see any issue with loading everything this early?