Skip to content

Commit

Permalink
chore: changed some logic for divi notice display (#211)
Browse files Browse the repository at this point in the history
  • Loading branch information
GrigoreMihai authored and selul committed Jan 14, 2020
1 parent 577406b commit 07bf4b9
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions inc/conflicts/divi.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,19 @@ public function define_message() {
* @access public
*/
public function is_conflict_valid() {
if ( ! is_plugin_active( 'divi-builder/divi-builder.php' ) ) {
return false;
$show_message = false;
if ( is_plugin_active( 'divi-builder/divi-builder.php' ) ) {
$show_message = true;
}

$theme = wp_get_theme();
// No divi, no child theme.
if ( strcmp( $theme->get( 'Name' ), 'Divi' ) !== 0 && $theme->parent() === false ) {
return false;
// Divi, no child theme.
if ( strcmp( $theme->get( 'Name' ), 'Divi' ) === 0 && $theme->parent() === false ) {
$show_message = true;
}
// Child theme, no parent divi.
if ( $theme->parent() !== false && strcmp( $theme->parent()->get( 'Name' ), 'Divi' ) !== 0 ) {
return false;
// Child theme, parent divi.
if ( $theme->parent() !== false && strcmp( $theme->parent()->get( 'Name' ), 'Divi' ) === 0 ) {
$show_message = true;
}
if ( ! function_exists( 'et_get_option' ) ) {
return false;
Expand All @@ -55,6 +56,6 @@ public function is_conflict_valid() {
return false;
}

return true;
return $show_message;
}
}

0 comments on commit 07bf4b9

Please sign in to comment.