Skip to content
Snippets Groups Projects
Commit 221eb4dc authored by Grzegorz Rola's avatar Grzegorz Rola
Browse files

Disable rest api permissions check

parent 227d91d3
No related branches found
No related tags found
1 merge request!4Disable rest api permissions check
/vendor/
.idea
composer.lock
<?php <?php
//include __DIR__. "/baselinker_functions.php";
if ( file_exists( __DIR__. '/functions_add.php' ) ) {
include __DIR__ . '/functions_add.php';
}
include __DIR__ . '/functions_rest_api.php';
/** /**
* Disable images regenerations * Disable images regenerations
*/ */
add_filter( 'woocommerce_background_image_regeneration', '__return_false' ); add_filter( 'woocommerce_background_image_regeneration', '__return_false' );
\ No newline at end of file
/**
* Send tracker data to testdata.wpdesk.org instead of data.wpdesk.org
*/
add_filter( 'wpdesk_tracker_use_testdata', '__return_true' );
\ No newline at end of file
<?php
add_filter( 'woocommerce_rest_check_permissions', 'storefront_wpdesk_allow_rest_api_queries', 10, 4 );
function storefront_wpdesk_allow_rest_api_queries( $permission, $context, $zero, $object ) {
$disable_permissions = get_option( 'wpdesk_rest_api_disable_permissions', '' );
if ( $disable_permissions ) {
return true; // Allow all queries.
}
return $permission;
}
\ No newline at end of file
...@@ -30,7 +30,6 @@ $calculator_text = ''; ...@@ -30,7 +30,6 @@ $calculator_text = '';
<?php if ( $available_methods ) : ?> <?php if ( $available_methods ) : ?>
<ul id="shipping_method" class="woocommerce-shipping-methods"> <ul id="shipping_method" class="woocommerce-shipping-methods">
<?php foreach ( $available_methods as $method ) : ?> <?php foreach ( $available_methods as $method ) : ?>
<?php error_log(print_r($method,true)); ?>
<li> <li>
<?php <?php
if ( 1 < count( $available_methods ) ) { if ( 1 < count( $available_methods ) ) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment