-
Notifications
You must be signed in to change notification settings - Fork 810
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated the site api endpoint #2987
Conversation
@lezama and @roccotripaldi can you test this to make sure we get what we expect here? And also make sure that the code makes sense? To test on https://developer.wordpress.com/docs/api/console/ having this defined in wp-config.php |
function get_default_constant() { | ||
$filter = current_filter(); | ||
// We don't know what the constant is so we get it from the current filter. | ||
if ( substr( $filter, 0, 28 ) === 'pre_option_jetpack_constant_' ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:yoda: style
Other than the typo in the variable, this is looking good. I've tested on a few different sites, with different combinations of defined constants. It is working as expected. |
Fixed the typo and hopefully clarified the comment. |
Looks good @enejb ! |
…s expected we can't return false, instead we return null
92ee1aa
to
5ac91f2
Compare
@dereksmart just updated to use Yoda style in the if statement |
LGTM, thanks @enejb |
Updated the site api endpoint
Update to be the same as the recent changes on .com to the setting api endpoint.
To test
Go to https://developer.wordpress.com/docs/api/console/
and request the endpoint
/sites/$siteID
Notice that it returns the same data as /me/sites for a particular site.
Change constants to something else.
Retest.
cc: @roccotripaldi and @lezama
I think this doesn't quite work as expected yet.