Skip to content

Commit d58c183

Browse files
committed
Add guard clause if free version is disabled
1 parent eab98da commit d58c183

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

genesis-ads.php

+5
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ function advanced_ads_genesis_init() {
7070
function wp_advads_genesis_halt_code() {
7171
global $advads_halt_notices;
7272

73+
// Early bail!!
74+
if ( ! defined( 'ADVADS_VERSION' ) ) {
75+
return;
76+
}
77+
7378
if ( version_compare( ADVADS_VERSION, '2.0.0', '>=' ) ) {
7479
if ( ! isset( $advads_halt_notices ) ) {
7580
$advads_halt_notices = [];

includes/admin/class-admin.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class Admin implements Integration_Interface {
2222
/**
2323
* Hook into WordPress.
2424
*/
25-
public function hooks() {
25+
public function hooks(): void {
2626
// Add sticky placement.
2727
add_action( 'advanced-ads-placement-types', [ $this, 'add_placement' ] );
2828

includes/class-frontend.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Frontend implements Integration_Interface {
3030
*
3131
* @return void
3232
*/
33-
public function hooks() {
33+
public function hooks(): void {
3434
$hooks = array_keys( $this->get_genesis_hooks() );
3535
foreach ( $hooks as $hook ) {
3636
add_action( $hook, [ $this, 'execute_hook' ] );

includes/class-plugin.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public static function get() {
4040
/**
4141
* Hook into WordPress.
4242
*/
43-
public function hooks() {
43+
public function hooks(): void {
4444
$this->init();
4545
$this->load_plugin_textdomain();
4646
}

0 commit comments

Comments
 (0)