PluginProbe
WCPOS – Point of Sale (POS) plugin for WooCommerce / 1.10.19
WCPOS – Point of Sale (POS) plugin for WooCommerce v1.10.19
1.10.19 1.10.18 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 All 163 releases
← All changes | includes/WC_API.php +5 -2 1.9.151.10.19 View file →
@@ -34,9 +34,9 @@
34 34 /**
35 35 * Constructor.
36 36 */
37 37 public function __construct() {
38 - $pos_only_products = woocommerce_pos_get_settings( 'general', 'pos_only_products' );
38 + $pos_only_products = Settings::instance()->pos_only_products_enabled();
39 39
40 40 if ( $pos_only_products ) {
41 41 add_filter( 'rest_pre_dispatch', array( $this, 'set_woocommerce_rest_api_request_flags' ), 10, 3 );
42 42 add_filter( 'posts_where', array( $this, 'exclude_pos_only_products_from_api_response' ), 10, 2 );
@@ -50,9 +50,12 @@
50 50 * @param \WP_REST_Server $server The server instance.
51 51 * @param \WP_REST_Request $request The request object.
52 52 */
53 53 public function set_woocommerce_rest_api_request_flags( $result, $server, $request ) {
54 - $route = $request->get_route();
54 + // WordPress matches REST routes case-insensitively, so a mixed-case path
55 + // still dispatches to the products controller — flag detection must not
56 + // be skippable by upper-casing the route.
57 + $route = strtolower( $request->get_route() );
55 58
56 59 if ( 0 === strpos( $route, '/wc/v3/products' ) || 0 === strpos( $route, '/wc/v2/products' ) || 0 === strpos( $route, '/wc/v1/products' ) ) {
57 60 $this->is_woocommerce_rest_api_products_request = true;
58 61