Skip to content

Handle expired or missing tokens for orders autosuggest #3308

New issue

Have a question about this project? Sign up for a free account to open an issue and contact its maintainers and the community.

By clicking “Sign up for ”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on ? Sign in to your account

Merged
merged 12 commits into from
Feb 15, 2023
PrevPrevious commit
Next Next commit
add a trailing slash to EP.io host
  • Loading branch information
@felipeelia
felipeelia committedFeb 14, 2023
commit a54f85e1a999b2f25c7c9a00ef92a4beb7ec5f3c
4 changes: 2 additions & 2 deletions includes/classes/Feature/WooCommerce/Orders.php
Original file line numberDiff line numberDiff line change
Expand Up@@ -158,7 +158,7 @@ public function enqueue_admin_assets( $hook_suffix ) {
array(
'adminUrl' => admin_url( 'post.php' ),
'apiEndpoint' => $api_endpoint,
'apiHost' => ( 0 !== strpos( $api_endpoint, 'http' ) ) ? esc_url_raw( $api_host ) : '',
'apiHost' => ( 0 !== strpos( $api_endpoint, 'http' ) ) ? trailingslashit( esc_url_raw( $api_host ) ) : '',
'argsSchema' => $this->get_args_schema(),
'credentialsApiUrl' => rest_url( 'elasticpress/v1/token' ),
'credentialsNonce' => wp_create_nonce( 'wp_rest' ),
Expand All@@ -181,7 +181,7 @@ public function enqueue_admin_assets( $hook_suffix ) {
* @return void
*/
public function after_update_feature( $feature, $settings, $data ) {
if ( 'woocommerce' !== $feature ) {
if ( 'woocommerce' !== $featured ) {
return;
}

Expand Down