parent
dcdca4d4d2
commit
001ce0fc3e
|
@ -99,6 +99,14 @@ class WC_Settings_General extends WC_Settings_Page {
|
|||
'autoload' => false
|
||||
),
|
||||
|
||||
array(
|
||||
'title' => __( 'API', 'woocommerce' ),
|
||||
'desc' => __( 'Enable the REST API', 'woocommerce' ),
|
||||
'id' => 'woocommerce_api_enabled',
|
||||
'type' => 'checkbox',
|
||||
'default' => 'yes',
|
||||
),
|
||||
|
||||
array( 'type' => 'sectionend', 'id' => 'general_options'),
|
||||
|
||||
array( 'title' => __( 'Currency Options', 'woocommerce' ), 'type' => 'title', 'desc' => __( 'The following options affect how prices are displayed on the frontend.', 'woocommerce' ), 'id' => 'pricing_options' ),
|
||||
|
@ -293,4 +301,4 @@ class WC_Settings_General extends WC_Settings_Page {
|
|||
|
||||
endif;
|
||||
|
||||
return new WC_Settings_General();
|
||||
return new WC_Settings_General();
|
||||
|
|
|
@ -203,10 +203,8 @@ class WC_API_Server {
|
|||
|
||||
$this->header( 'Content-Type', $this->handler->get_content_type(), true );
|
||||
|
||||
// TODO: can we prevent wc_cookie from being sent for API requests?
|
||||
|
||||
// the API is enabled by default TODO: implement check for enabled setting here
|
||||
if ( ! apply_filters( 'woocommerce_api_enabled', true, $this ) ) {
|
||||
// the API is enabled by default
|
||||
if ( ! apply_filters( 'woocommerce_api_enabled', true, $this ) || ( 'no' === get_option( 'woocommerce_api_enabled' ) ) ) {
|
||||
|
||||
$this->send_status( 404 );
|
||||
|
||||
|
|
Loading…
Reference in New Issue