Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
storefront-wpdesk-tests
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wpdesk
storefront-wpdesk-tests
Commits
221eb4dc
Commit
221eb4dc
authored
5 years ago
by
Grzegorz Rola
Browse files
Options
Downloads
Patches
Plain Diff
Disable rest api permissions check
parent
227d91d3
No related branches found
Branches containing commit
No related tags found
1 merge request
!4
Disable rest api permissions check
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitignore
+3
-0
3 additions, 0 deletions
.gitignore
functions.php
+14
-1
14 additions, 1 deletion
functions.php
functions_rest_api.php
+10
-0
10 additions, 0 deletions
functions_rest_api.php
woocommerce/cart/cart-shipping.php
+0
-1
0 additions, 1 deletion
woocommerce/cart/cart-shipping.php
with
27 additions
and
2 deletions
.gitignore
0 → 100644
+
3
−
0
View file @
221eb4dc
/vendor/
.idea
composer.lock
This diff is collapsed.
Click to expand it.
functions.php
+
14
−
1
View file @
221eb4dc
<?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
This diff is collapsed.
Click to expand it.
functions_rest_api.php
0 → 100644
+
10
−
0
View file @
221eb4dc
<?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
This diff is collapsed.
Click to expand it.
woocommerce/cart/cart-shipping.php
+
0
−
1
View file @
221eb4dc
...
@@ -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
)
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment