Skip to content

add filter for allowing REST requests when access is restricted#8

Closed
Shelob9 wants to merge 1 commit into10up:developfrom
Shelob9:7
Closed

add filter for allowing REST requests when access is restricted#8
Shelob9 wants to merge 1 commit into10up:developfrom
Shelob9:7

Conversation

@Shelob9
Copy link
Copy Markdown

@Shelob9 Shelob9 commented Mar 29, 2016

For #7

@adamsilverstein
Copy link
Copy Markdown

@Shelob9 if you want to enable rest requests when they would otherwise be restricted, something like the following code should work:

add_filter( 'restricted_site_access_is_restricted', function( $restricted ) {
	if ( defined( 'REST_REQUEST' ) && REST_REQUEST ) {
		return false;
	}
	return $restricted;
} );

Am I misunderstanding your use case? I don't see how your PR helps out with "allowing REST requests when access is restricted".

@adamsilverstein adamsilverstein added the needs:feedback This requires feedback to determine next steps. label Jan 4, 2018
@adamsilverstein
Copy link
Copy Markdown

@Shelob9 closing this as wontfix because you can achieve the same results with an existing filter (pull/8#issuecomment-355186577) - please feel free to re-open if I have missed something!

@adamsilverstein adamsilverstein added the resolution:wontfix We do not intend to resolve this issue. label Feb 5, 2019
@ktorktor ktorktor mentioned this pull request Oct 28, 2025
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs:feedback This requires feedback to determine next steps. resolution:wontfix We do not intend to resolve this issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants