Small code review changes
This commit is contained in:
parent
a2743e6d25
commit
9695bc4183
|
@ -513,24 +513,22 @@ class WC_Admin_Addons {
|
||||||
* Should an extension be shown on the featured page.
|
* Should an extension be shown on the featured page.
|
||||||
*
|
*
|
||||||
* @param object $item
|
* @param object $item
|
||||||
*
|
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public static function show_extension( $item ) {
|
public static function show_extension( $item ) {
|
||||||
$location = WC()->countries->get_base_country();
|
$location = WC()->countries->get_base_country();
|
||||||
$show = true;
|
if ( isset( $item->geowhitelist ) && ! in_array( $location, $item->geowhitelist, true ) ) {
|
||||||
if ( isset( $item->geowhitelist ) && ! in_array( $location, $item->geowhitelist ) ) {
|
return false;
|
||||||
$show = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( isset( $item->geoblacklist ) && in_array( $location, $item->geoblacklist ) ) {
|
if ( isset( $item->geoblacklist ) && in_array( $location, $item->geoblacklist, true ) ) {
|
||||||
$show = false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( is_plugin_active( $item->plugin ) ) {
|
if ( is_plugin_active( $item->plugin ) ) {
|
||||||
$show = false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $show;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue