Skip to content

Commit

Permalink
Corrected required Flatsome version
Browse files Browse the repository at this point in the history
  • Loading branch information
JimmyAppelt committed May 27, 2018
1 parent d2add47 commit 8656262
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 48 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Flatsome Custom Poduct Hooks
# Flatsome Custom Product Hooks
(Requires Flatsome 3.6.0 or above)

- Adds Germanized hooks into custom product builder (hooks element)

Expand Down
94 changes: 47 additions & 47 deletions includes/class-fl-cph-conditionals.php
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
<?php
/**
* Conditionals.
*
* @package Fl_Custom_Product_Hooks
*/

defined( 'ABSPATH' ) || exit;

/**
* Class FL_CPH_Conditionals
*/
class FL_CPH_Conditionals {

/**
* Check if Flatsome theme is activated and its version is 3.4 or above.
*
* @return bool
*/
public function is_flatsome_activated() {
$theme = wp_get_theme( get_template() );
$name = $theme->get( 'Name' );
$version = $theme->get( 'Version' );

return 'Flatsome' === $name && version_compare( $version, '3.4.0', '>=' );
}

/**
* Check if WooCommerce is activated.
*
* @return bool
*/
public function is_woocommerce_activated() {
return class_exists( 'WooCommerce', false );
}

/**
* Check if plugin is activated.
*
* @param string $class Class name.
* @param bool $autoload To autoload or not.
*
* @return bool
*/
public function is_plugin_activated( $class, $autoload = false ) {
return class_exists( $class, $autoload );
}
<?php
/**
* Conditionals.
*
* @package Fl_Custom_Product_Hooks
*/

defined( 'ABSPATH' ) || exit;

/**
* Class FL_CPH_Conditionals
*/
class FL_CPH_Conditionals {

/**
* Check if Flatsome theme is activated and its version is 3.6 or above.
*
* @return bool
*/
public function is_flatsome_activated() {
$theme = wp_get_theme( get_template() );
$name = $theme->get( 'Name' );
$version = $theme->get( 'Version' );

return 'Flatsome' === $name && version_compare( $version, '3.6.0', '>=' );
}

/**
* Check if WooCommerce is activated.
*
* @return bool
*/
public function is_woocommerce_activated() {
return class_exists( 'WooCommerce', false );
}

/**
* Check if plugin is activated.
*
* @param string $class Class name.
* @param bool $autoload To autoload or not.
*
* @return bool
*/
public function is_plugin_activated( $class, $autoload = false ) {
return class_exists( $class, $autoload );
}
}

0 comments on commit 8656262

Please sign in to comment.