Helper: Add a new filter to display only installed extensions.
This commit is contained in:
parent
1fa049415b
commit
d63eb56753
|
@ -330,6 +330,7 @@ class WC_Helper {
|
|||
'all' => __( 'All', 'woocommerce' ),
|
||||
'active' => __( 'Active', 'woocommerce' ),
|
||||
'inactive' => __( 'Inactive', 'woocommerce' ),
|
||||
'installed' => __( 'Installed', 'woocommerce' ),
|
||||
'update-available' => __( 'Update Available', 'woocommerce' ),
|
||||
'expiring' => __( 'Expiring Soon', 'woocommerce' ),
|
||||
'expired' => __( 'Expired', 'woocommerce' ),
|
||||
|
@ -399,6 +400,14 @@ class WC_Helper {
|
|||
$subscriptions = wp_list_filter( $subscriptions, array( 'active' => false ) );
|
||||
break;
|
||||
|
||||
case 'installed':
|
||||
foreach ( $subscriptions as $key => $subscription ) {
|
||||
if ( empty( $subscription['local']['installed'] ) ) {
|
||||
unset( $subscriptions[ $key ] );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'update-available':
|
||||
$subscriptions = wp_list_filter( $subscriptions, array( 'has_update' => true ) );
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue