Skip to content

Commit

Permalink
Components: only register installables for active components
Browse files Browse the repository at this point in the history
Otherwise the installables app will attempt to use the registered class,
which won't be loaded because the component isn't active.

See #404
  • Loading branch information
JDGrimes committed Aug 23, 2017
1 parent d3eab4d commit 7bf6819
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/classes/components.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,10 @@ public function register( $args ) {

$this->registered[ $component['slug'] ] = array_intersect_key( $component, $defaults );

if ( isset( $component['installable'] ) ) {
if (
isset( $component['installable'] )
&& $this->is_active( $component['slug'] )
) {

/** @var WordPoints_Installables_App $installables */
$installables = wordpoints_apps()->get_sub_app( 'installables' );
Expand Down

0 comments on commit 7bf6819

Please sign in to comment.