-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from JetixWP/release-v0.14.0
Release v0.14.0
- Loading branch information
Showing
17 changed files
with
577 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
includes/Compatibility/Plugins/Divi/class-compatibility.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<?php | ||
/** | ||
* Divi compatibility handler. | ||
* | ||
* @package RSFV | ||
*/ | ||
|
||
namespace RSFV\Compatibility\Plugins\Divi; | ||
|
||
defined( 'ABSPATH' ) || exit; | ||
|
||
use RSFV\Compatibility\Plugins\Base_Compatibility; | ||
|
||
/** | ||
* Class Compatibility | ||
* | ||
* @package RSFV | ||
*/ | ||
class Compatibility extends Base_Compatibility { | ||
/** | ||
* Class instance. | ||
* | ||
* @var $instance | ||
*/ | ||
protected static $instance; | ||
|
||
/** | ||
* A counter variable. | ||
* | ||
* @var int $counter | ||
*/ | ||
protected $counter; | ||
|
||
/** | ||
* Constructor. | ||
*/ | ||
public function __construct() { | ||
parent::__construct(); | ||
|
||
$this->id = 'divi'; | ||
|
||
$this->setup(); | ||
} | ||
|
||
/** | ||
* Sets up hooks and filters. | ||
* | ||
* @return void | ||
*/ | ||
public function setup() { | ||
add_action( 'et_core_data_loaded', array( $this, 'run_extension' ) ); | ||
} | ||
|
||
/** | ||
* Runs extension hooks. | ||
* | ||
* @return void | ||
*/ | ||
public function run_extension() { | ||
if ( class_exists( 'WooCommerce' ) ) { | ||
// Registers related settings tab. | ||
add_filter( 'rsfv_get_settings_pages', array( $this, 'register_settings' ) ); | ||
} | ||
} | ||
|
||
/** | ||
* Register Settings. | ||
* | ||
* @param array $settings Active settings file array. | ||
* | ||
* @return array | ||
*/ | ||
public function register_settings( $settings ) { | ||
// Settings. | ||
$settings[] = include 'class-settings.php'; | ||
|
||
return $settings; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
<?php | ||
/** | ||
* Divi Settings | ||
* | ||
* @package RSFV_Pro | ||
*/ | ||
|
||
namespace RSFV\Compatibility\Plugins\Divi; | ||
|
||
use RSFV\Plugin; | ||
use RSFV\Settings\Settings_Page; | ||
use RSFV\Settings\Admin_Settings; | ||
|
||
if ( ! class_exists( '\RSFV\Settings\Admin_Settings' ) ) { | ||
return; | ||
} | ||
|
||
defined( 'ABSPATH' ) || exit; | ||
|
||
/** | ||
* Integrations controls. | ||
*/ | ||
class Settings extends Settings_Page { | ||
|
||
/** | ||
* Constructor. | ||
*/ | ||
public function __construct() { | ||
$this->id = 'divi'; | ||
$this->label = __( 'Divi', 'rsfv' ); | ||
|
||
parent::__construct(); | ||
} | ||
|
||
/** | ||
* Get sections. | ||
* | ||
* @return array | ||
*/ | ||
public function get_sections() { | ||
return apply_filters( 'rsfv_get_sections_' . $this->id, array() ); | ||
} | ||
|
||
/** | ||
* Get settings array. | ||
* | ||
* @param string $current_section Current section ID. | ||
* | ||
* @return array | ||
*/ | ||
public function get_settings( $current_section = '' ) { | ||
global $current_section; | ||
|
||
$settings = array(); | ||
|
||
if ( '' === $current_section ) { | ||
$settings = array(); | ||
|
||
if ( ! Plugin::get_instance()->has_pro_active() ) { | ||
$settings = array_merge( | ||
$settings, | ||
array( | ||
array( | ||
'type' => 'title', | ||
'id' => 'rsfv_pro_divi_woocommerce_title', | ||
), | ||
array( | ||
'title' => __( 'Featured Video for Divi Woo Product Images', 'rsfv' ), | ||
'desc' => __( 'When toggled on, it shows Featured Product Videos in Divi Woo Product Images Module/Widget. Turn it off if you\'re having problem with WooCommerce templates.', 'rsfv' ), | ||
'id' => 'promo-has-divi-woo-featured_video', | ||
'default' => false, | ||
'type' => 'promo-checkbox', | ||
), | ||
array( | ||
'type' => 'sectionend', | ||
'id' => 'rsfv_pro_divi_woocommerce_title', | ||
), | ||
) | ||
); | ||
} | ||
|
||
$settings = apply_filters( | ||
'rsfv_' . $this->id . '_settings', | ||
$settings | ||
); | ||
} | ||
|
||
return apply_filters( 'rsfv_get_settings_' . $this->id, $settings ); | ||
} | ||
|
||
/** | ||
* Save settings. | ||
*/ | ||
public function save() { | ||
global $current_section; | ||
|
||
$settings = $this->get_settings( $current_section ); | ||
|
||
Admin_Settings::save_fields( $settings ); | ||
if ( $current_section ) { | ||
do_action( 'rsfv_update_options_' . $this->id . '_' . $current_section ); | ||
} | ||
} | ||
} | ||
|
||
return new Settings(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.