• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
WooCommerce a2z

WooCommerce a2z

WooCommerce

  • Home
  • Plugins
  • Blocks
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / ActionScheduler_HybridStore::action_counts() – Get a count of all actions in the store, grouped by status

You appear to be a bot. Output may be restricted

Description

Get a count of all actions in the store, grouped by status

Usage

$array = ActionScheduler_HybridStore::action_counts();

Parameters

Returns

array Set of 'status' => int $count pairs for statuses with 1 or more actions of that status.

Source

File name: woocommerce/packages/action-scheduler/classes/data-stores/ActionScheduler_HybridStore.php


Lines:

1 to 25 of 25
  public function action_counts() {
    $unmigrated_actions_count = $this->secondary_store->action_counts();
    $migrated_actions_count   = $this->primary_store->action_counts();
    $actions_count_by_status  = array();

    foreach ( $this->get_status_labels() as $status_key => $status_label ) {

      $count = 0;

      if ( isset( $unmigrated_actions_count[ $status_key ] ) ) {
        $count += $unmigrated_actions_count[ $status_key ];
      }

      if ( isset( $migrated_actions_count[ $status_key ] ) ) {
        $count += $migrated_actions_count[ $status_key ];
      }

      $actions_count_by_status[ $status_key ] = $count;
    }

    $actions_count_by_status = array_filter( $actions_count_by_status );

    return $actions_count_by_status;
  }
 

 View on GitHub View on Trac

Published: 6th April 2020 | Last updated: 6th May 2020

Primary Sidebar

Information

Function name: ActionScheduler_HybridStore::action_counts
Class ref: ActionScheduler_HybridStore
Plugin ref: WooCommerce
Version: 5.2.2
Sourcefile: packages/action-scheduler/classes/data-stores/ActionScheduler_HybridStore.php
File ref: packages/action-scheduler/classes/data-stores/ActionScheduler_HybridStore.php
Deprecated?: No
API Letters: A,C,H

Footer

WooCommerce a2z
WooCommerce a2z
WooCommerce
WordPress 5.7.1
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  woocommerce.wp-a2z.org
© Copyright WooCommerce a2z 2014-2021. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites