Fix namespace on helper class usage.
This commit is contained in:
parent
953427bea5
commit
37e849221b
|
@ -277,7 +277,7 @@ class OnboardingPlugins extends \WC_REST_Data_Controller {
|
|||
|
||||
$redirect_uri = wc_admin_url( '&task=connect&wccom-connected=1' );
|
||||
|
||||
$request = WC_Helper_API::post(
|
||||
$request = \WC_Helper_API::post(
|
||||
'oauth/request_token',
|
||||
array(
|
||||
'body' => array(
|
||||
|
@ -306,7 +306,7 @@ class OnboardingPlugins extends \WC_REST_Data_Controller {
|
|||
'secret' => rawurlencode( $secret ),
|
||||
'wccom-from' => 'onboarding',
|
||||
),
|
||||
WC_Helper_API::url( 'oauth/authorize' )
|
||||
\WC_Helper_API::url( 'oauth/authorize' )
|
||||
);
|
||||
|
||||
// Redirect to local calypso instead of production.
|
||||
|
@ -341,7 +341,7 @@ class OnboardingPlugins extends \WC_REST_Data_Controller {
|
|||
}
|
||||
|
||||
// Obtain an access token.
|
||||
$request = WC_Helper_API::post(
|
||||
$request = \WC_Helper_API::post(
|
||||
'oauth/access_token',
|
||||
array(
|
||||
'body' => array(
|
||||
|
@ -361,7 +361,7 @@ class OnboardingPlugins extends \WC_REST_Data_Controller {
|
|||
return new WP_Error( 'woocommerce_rest_helper_connect', __( 'There was an error connecting to WooCommerce.com. Please try again.', 'woocommerce-admin' ), 500 );
|
||||
}
|
||||
|
||||
WC_Helper_Options::update(
|
||||
\WC_Helper_Options::update(
|
||||
'auth',
|
||||
array(
|
||||
'access_token' => $access_token['access_token'],
|
||||
|
@ -372,13 +372,13 @@ class OnboardingPlugins extends \WC_REST_Data_Controller {
|
|||
)
|
||||
);
|
||||
|
||||
if ( ! WC_Helper::_flush_authentication_cache() ) {
|
||||
WC_Helper_Options::update( 'auth', array() );
|
||||
if ( ! \WC_Helper::_flush_authentication_cache() ) {
|
||||
\WC_Helper_Options::update( 'auth', array() );
|
||||
return new WP_Error( 'woocommerce_rest_helper_connect', __( 'There was an error connecting to WooCommerce.com. Please try again.', 'woocommerce-admin' ), 500 );
|
||||
}
|
||||
|
||||
delete_transient( '_woocommerce_helper_subscriptions' );
|
||||
WC_Helper_Updater::flush_updates_cache();
|
||||
\WC_Helper_Updater::flush_updates_cache();
|
||||
|
||||
do_action( 'woocommerce_helper_connected' );
|
||||
|
||||
|
|
|
@ -110,7 +110,7 @@ class OnboardingProfile extends \WC_REST_Data_Controller {
|
|||
$items[ $key ] = isset( $onboarding_data[ $key ] ) ? $onboarding_data[ $key ] : null;
|
||||
}
|
||||
|
||||
$wccom_auth = WC_Helper_Options::get( 'auth' );
|
||||
$wccom_auth = \WC_Helper_Options::get( 'auth' );
|
||||
$items['wccom_connected'] = empty( $wccom_auth['access_token'] ) ? false : true;
|
||||
|
||||
$item = $this->prepare_item_for_response( $items, $request );
|
||||
|
|
|
@ -301,7 +301,7 @@ class Onboarding {
|
|||
$profile = get_option( 'wc_onboarding_profile', array() );
|
||||
|
||||
include_once WC_ABSPATH . 'includes/admin/helper/class-wc-helper-options.php';
|
||||
$wccom_auth = WC_Helper_Options::get( 'auth' );
|
||||
$wccom_auth = \WC_Helper_Options::get( 'auth' );
|
||||
$profile['wccom_connected'] = empty( $wccom_auth['access_token'] ) ? false : true;
|
||||
|
||||
$settings['onboarding'] = array(
|
||||
|
|
Loading…
Reference in New Issue