PluginProbe
WCPOS – Point of Sale (POS) plugin for WooCommerce / trunk
WCPOS – Point of Sale (POS) plugin for WooCommerce vtrunk
1.10.17 1.10.16 1.10.15 1.10.13 1.10.14 1.10.12 1.10.11 1.10.10 1.10.9 1.10.8 untagged-3d9b7ccddc54df87c672 1.10.7 1.10.6 1.10.5 1.10.3 1.10.4 1.10.2 1.10.1 1.10.0 1.9.17 1.9.15 1.9.16 1.9.14 1.9.13 1.9.12 All 161 releases
woocommerce-pos / includes / API / V2 / Proxy / Terms_Proxy_Behavior.php

Terms_Proxy_Behavior.php in WCPOS – Point of Sale (POS) plugin for WooCommerce trunk, at includes/API/V2/Proxy/Terms_Proxy_Behavior.php

31 lines 863 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Term catalog proxy behavior (categories, tags, brands).
4 *
5 * @package WCPOS\WooCommercePOS\API\V2\Proxy
6 */
7
8 namespace WCPOS\WooCommercePOS\API\V2\Proxy;
9
10 /**
11 * Pins the stable name-sort tiebreak during the forward.
12 *
13 * The POS client's term lanes default to name ascending (mono#1371) and walk
14 * multi-page windows; see {@see Stable_Sort} for why ties need a secondary key.
15 */
16 final class Terms_Proxy_Behavior extends Scoped_Proxy_Behavior {
17 /**
18 * Install this resource's hooks and return their removal tuples.
19 *
20 * @return array<int, array{0: string, 1: callable, 2: int}>
21 */
22 protected function install(): array {
23 $filter = static function ( $clauses ) {
24 return Stable_Sort::with_term_id_tiebreak( (array) $clauses );
25 };
26 add_filter( 'terms_clauses', $filter );
27
28 return array( array( 'terms_clauses', $filter, 10 ) );
29 }
30 }
31