Skip to content

Commit eaaa32f

Browse files
authored
Merge pull request #1271 from salcode/sf/function-exist-add-action-1270
Add function_exists('add_action') check
2 parents 7fc4d69 + c160de7 commit eaaa32f

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎init.php‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,11 @@ private function __construct() {
123123
define( 'CMB2_LOADED', self::PRIORITY );
124124
}
125125

126+
if ( ! function_exists( 'add_action' ) ) {
127+
// We are running outside of the context of WordPress.
128+
return;
129+
}
130+
126131
add_action( 'init', array( $this, 'include_cmb' ), self::PRIORITY );
127132
}
128133

0 commit comments

Comments
 (0)