Skip to content

Commit

Permalink
Check for an instance of the main GistPress class before running
Browse files Browse the repository at this point in the history
Fixes #72
  • Loading branch information
robneu authored and bradyvercher committed Mar 27, 2017
1 parent 453dbc0 commit 4417f02
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions gistpress.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ function gistpress_i18n() {
*/
function gistpress_init() {
global $gistpress, $gistpress_logger;
$gistpress->set_logger( $gistpress_logger );
$gistpress->run();
if ( $gistpress instanceof GistPress ) {
$gistpress->set_logger( $gistpress_logger );
$gistpress->run();
}
}
add_action( 'init', 'gistpress_init' );

Expand Down

0 comments on commit 4417f02

Please sign in to comment.