Code changes as suggested in #4238
This commit is contained in:
parent
d9039672bc
commit
5291f2eec6
|
@ -157,11 +157,9 @@ abstract class WC_Shipping_Method extends WC_Settings_API {
|
|||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
* @todo Must return false if does not
|
||||
*/
|
||||
function has_settings() {
|
||||
if ( $this->has_settings )
|
||||
return true;
|
||||
return ( $this->has_settings );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -171,9 +169,6 @@ abstract class WC_Shipping_Method extends WC_Settings_API {
|
|||
* @return bool
|
||||
*/
|
||||
public function is_available( $package ) {
|
||||
/** @todo Delete this */
|
||||
global $woocommerce;
|
||||
|
||||
if ( $this->enabled == "no" )
|
||||
return false;
|
||||
|
||||
|
@ -234,4 +229,4 @@ abstract class WC_Shipping_Method extends WC_Settings_API {
|
|||
function supports( $feature ) {
|
||||
return apply_filters( 'woocommerce_shipping_method_supports', in_array( $feature, $this->supports ) ? true : false, $feature, $this );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -262,8 +262,7 @@ class WC_Admin_Assets {
|
|||
*/
|
||||
public function product_taxonomy_styles() {
|
||||
|
||||
/** @todo This should be just 'return', without false */
|
||||
if ( ! current_user_can( 'manage_woocommerce' ) ) return false;
|
||||
if ( ! current_user_can( 'manage_woocommerce' ) ) return;
|
||||
?>
|
||||
<style type="text/css">
|
||||
<?php if ( isset($_GET['taxonomy']) && $_GET['taxonomy']=='product_cat' ) : ?>
|
||||
|
@ -278,4 +277,4 @@ class WC_Admin_Assets {
|
|||
|
||||
endif;
|
||||
|
||||
return new WC_Admin_Assets();
|
||||
return new WC_Admin_Assets();
|
||||
|
|
|
@ -49,8 +49,7 @@ class WC_Widget_Layered_Nav extends WC_Widget {
|
|||
*/
|
||||
public function form( $instance ) {
|
||||
$this->init_settings();
|
||||
/** @todo This must be only call to parent, with no return. It's a void function */
|
||||
return parent::form( $instance );
|
||||
parent::form( $instance );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -386,4 +385,4 @@ class WC_Widget_Layered_Nav extends WC_Widget {
|
|||
}
|
||||
}
|
||||
|
||||
register_widget( 'WC_Widget_Layered_Nav' );
|
||||
register_widget( 'WC_Widget_Layered_Nav' );
|
||||
|
|
Loading…
Reference in New Issue