PATH:
home
/
letacommog
/
newrdv1
/
wp-content
/
plugins1
/
woocommerce-services
/
classes
<?php if ( ! defined( 'ABSPATH' ) ) { exit; } if ( class_exists( 'WC_REST_Connect_Base_Controller' ) ) { return; } abstract class WC_REST_Connect_Base_Controller extends WP_REST_Controller { /** * Endpoint namespace. * * @var string */ protected $namespace = 'wc/v1'; /** * @var WC_Connect_API_Client */ protected $api_client; /** * @var WC_Connect_Service_Settings_Store */ protected $settings_store; /** * @var WC_Connect_Logger */ protected $logger; public function __construct( WC_Connect_API_Client $api_client, WC_Connect_Service_Settings_Store $settings_store, WC_Connect_Logger $logger ) { $this->api_client = $api_client; $this->settings_store = $settings_store; $this->logger = $logger; } public function register_routes() { if ( method_exists( $this, 'get' ) ) { register_rest_route( $this->namespace, '/' . $this->rest_base, array( array( 'methods' => 'GET', 'callback' => array( $this, 'get_internal' ), 'permission_callback' => array( $this, 'check_permission' ), ), ) ); } if ( method_exists( $this, 'post' ) ) { register_rest_route( $this->namespace, '/' . $this->rest_base, array( array( 'methods' => 'POST', 'callback' => array( $this, 'post_internal' ), 'permission_callback' => array( $this, 'check_permission' ), ), ) ); } } /** * Consolidate cache prevention mechanisms. */ public function prevent_route_caching() { if ( ! defined( 'DONOTCACHEPAGE' ) ) { define( 'DONOTCACHEPAGE', true ); // Play nice with WP-Super-Cache } // Prevent our REST API endpoint responses from being added to browser cache add_filter( 'rest_post_dispatch', array( $this, 'send_nocache_header' ), PHP_INT_MAX, 2 ); } /** * Send a no-cache header for WCS REST API responses. Prompted by cache issues * on the Pantheon hosting platform. * * See: https://pantheon.io/docs/cache-control/ * * @param WP_REST_Response $response * @param WP_REST_Server $server * * @return WP_REST_Response passthrough $response parameter */ public function send_nocache_header( $response, $server ) { $server->send_header( 'Cache-Control', 'no-cache, must-revalidate, max-age=0' ); return $response; } public function get_internal( $request ) { $this->prevent_route_caching(); return $this->get( $request ); } public function post_internal( $request ) { $this->prevent_route_caching(); return $this->post( $request ); } /** * Validate the requester's permissions */ public function check_permission( $request ) { return current_user_can( 'manage_woocommerce' ); } }
[+]
..
[-] class-wc-connect-payment-gateway.php
[edit]
[-] class-wc-connect-shipping-method.php
[edit]
[-] class-wc-connect-api-client.php
[edit]
[-] class-wc-connect-privacy.php
[edit]
[-] class-wc-rest-connect-base-controller.php
[edit]
[-] class-wc-rest-connect-stripe-deauthorize-controller.php
[edit]
[-] class-wc-rest-connect-stripe-account-controller.php
[edit]
[-] class-wc-rest-connect-shipping-label-print-controller.php
[edit]
[-] class-wc-connect-nux.php
[edit]
[-] class-wc-rest-connect-shipping-label-controller.php
[edit]
[-] class-wc-connect-taxjar-integration.php
[edit]
[-] class-wc-rest-connect-stripe-oauth-connect-controller.php
[edit]
[-] class-wc-rest-connect-address-normalization-controller.php
[edit]
[-] class-wc-connect-label-reports.php
[edit]
[+]
wc-api-dev
[-] class-wc-connect-functions.php
[edit]
[-] class-wc-rest-connect-stripe-oauth-init-controller.php
[edit]
[-] class-wc-rest-connect-self-help-controller.php
[edit]
[-] class-wc-rest-connect-packages-controller.php
[edit]
[-] class-wc-connect-debug-tools.php
[edit]
[-] class-wc-connect-compatibility.php
[edit]
[-] class-wc-connect-options.php
[edit]
[-] class-wc-connect-shipping-label.php
[edit]
[-] class-wc-rest-connect-shipping-label-refund-controller.php
[edit]
[-] class-wc-connect-service-settings-store.php
[edit]
[-] class-wc-connect-api-client-live.php
[edit]
[-] class-wc-connect-compatibility-wc30.php
[edit]
[-] .classes.php
[edit]
[-] class-wc-connect-jetpack.php
[edit]
[-] class-wc-connect-help-view.php
[edit]
[-] class-wc-rest-connect-account-settings-controller.php
[edit]
[-] class-wc-connect-logger.php
[edit]
[-] class-wc-rest-connect-assets-controller.php
[edit]
[-] class-wc-rest-connect-services-controller.php
[edit]
[-] class-wc-connect-stripe.php
[edit]
[-] class-wc-connect-compatibility-wc26.php
[edit]
[-] class-wc-connect-service-schemas-validator.php
[edit]
[-] class-wc-rest-connect-shipping-label-status-controller.php
[edit]
[-] class-wc-connect-extension-compatibility.php
[edit]
[-] class-wc-rest-connect-shipping-rates-controller.php
[edit]
[-] class-wc-connect-error-notice.php
[edit]
[-] class-wc-connect-service-schemas-store.php
[edit]
[-] class-wc-connect-settings-pages.php
[edit]
[-] class-wc-rest-connect-tos-controller.php
[edit]
[-] class-wc-rest-connect-shipping-label-preview-controller.php
[edit]
[-] class-wc-connect-paypal-ec.php
[edit]
[-] class-wc-connect-tracks.php
[edit]
[-] class-wc-connect-payment-methods-store.php
[edit]