# woocommerce-pos/1.10.13/includes/wcpos-store-functions.php

WCPOS – Point of Sale (POS) plugin for WooCommerce, version 1.10.13. 97 lines.

- Page: https://pluginprobe.com/plugins/woocommerce-pos/1.10.13/code/includes/wcpos-store-functions.php
- Raw: https://pluginprobe.com/plugins/woocommerce-pos/1.10.13/raw/includes/wcpos-store-functions.php
- Modified: 2026-05-15T18:12:48+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/woocommerce-pos/1.10.13/code/includes/wcpos-store-functions.php#L10-L20`.

```php
<?php
/**
 * WCPOS Store Functions.
 *
 * Functions for store specific things.
 *
 * @package WCPOS\WooCommercePOS
 */

\defined( 'ABSPATH' ) || exit;

use WCPOS\WooCommercePOS\Abstracts\Store;

/*
 * Standard way of retrieving stores based on certain parameters.
 *
 * This function should be used for store retrieval so that we have a data agnostic
 * way to get a list of stores.
 *
 * @since 1.4.0
 *
 * @param  array $args Array of args.
 * @return array|stdClass Number of pages and an array of product objects if
 *                             paginate is true, or just an array of values.
 */
if ( ! \function_exists( 'wcpos_get_stores' ) ) {
	/**
	 * Get stores based on certain parameters.
	 *
	 * @param array $args Array of args.
	 * @return array
	 */
	function wcpos_get_stores( $args = array() ) { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound
		$store = new Store();

		return apply_filters( 'woocommerce_pos_get_stores', array( $store ), $args );
	}
}

/*
 * Main function for returning store.
 *
 * This function should only be called after 'init' action is finished, as there might be taxonomies that are getting
 * registered during the init action.
 *
 * @since 1.4.0
 *
 * @param mixed $the_store Post object or post ID of the product.
 * @param array $args      Optional lookup args.
 * @return Store|null|false
 */
if ( ! \function_exists( 'wcpos_get_store' ) ) {
	/**
	 * Main function for returning store.
	 *
	 * @param mixed $the_store Post object or post ID of the product.
	 * @param array $args      Optional lookup args.
	 * @return Store|null|false
	 */
	function wcpos_get_store( $the_store = false, array $args = array() ) { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound
		$store = new Store();

		return apply_filters( 'woocommerce_pos_get_store', $store, $the_store, $args );
	}
}

/*
 * Helper to get the store name by ID.
 *
 * This function should only be called after 'init' action is finished, as there might be taxonomies that are getting
 * registered during the init action.
 *
 * @since 1.4.0
 *
 * @param mixed $the_store Post object or post ID of the product.
 * @param array $args      Optional lookup args.
 * @return Store|null|false
 */
if ( ! \function_exists( 'wcpos_get_store_name' ) ) {
	/**
	 * Helper to get the store name by ID.
	 *
	 * @param mixed $the_store Post object or post ID of the product.
	 * @param array $args      Optional lookup args.
	 * @return string
	 */
	function wcpos_get_store_name( $the_store = false, array $args = array() ) { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound
		$store = wcpos_get_store( $the_store, $args );

		if ( ! \is_object( $store ) || ! \method_exists( $store, 'get_name' ) ) {
			return '';
		}

		return $store->get_name();
	}
}

```
