Skip to content

Commit

Permalink
Merge pull request #192 from Codeinwp/fix/issue-94
Browse files Browse the repository at this point in the history
Avoids conflicts with Enfold Theme
  • Loading branch information
HardeepAsrani authored Oct 5, 2023
2 parents 7238d19 + 21ff8b6 commit 50115d4
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/Modules/Promotions.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,22 @@ public function is_writeable() {
return false;
}

/**
* Third-party compatibility.
*
* @return boolean
*/
private function has_conflicts() {
global $pagenow;

// Editor notices aren't compatible with Enfold theme.
if ( defined( 'AV_FRAMEWORK_VERSION' ) && in_array( $pagenow, array( 'post.php', 'post-new.php' ) ) ) {
return true;
}

return false;
}

/**
* Get promotions.
*
Expand Down Expand Up @@ -359,7 +375,7 @@ private function get_promotions() {

foreach ( $all as $slug => $data ) {
foreach ( $data as $key => $conditions ) {
if ( ! $conditions['env'] ) {
if ( ! $conditions['env'] || $this->has_conflicts() ) {
unset( $all[ $slug ][ $key ] );

continue;
Expand Down

0 comments on commit 50115d4

Please sign in to comment.