Skip to content
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

Merged
merged 5 commits into from
Nov 17, 2015
Merged

Conversation

enejb
Copy link
Member

@enejb enejb commented Nov 10, 2015

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.

@enejb enejb added this to the 3.8.1 milestone Nov 10, 2015
@jeherve jeherve added [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. Mercury labels Nov 10, 2015
@enejb
Copy link
Member Author

enejb commented Nov 13, 2015

@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/
I tested the /sites/123456789 api endpoint.

having this defined in wp-config.php
define( 'FS_METHOD', 'ssh2' );
define( 'DISALLOW_FILE_EDIT', true );
define( 'DISALLOW_FILE_MODS',true );
define( 'WP_AUTO_UPDATE_CORE', false );
define( 'AUTOMATIC_UPDATER_DISABLED', true );

gives me
screen shot 2015-11-12 at 4 31 06 pm

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_' ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:yoda: style

@roccotripaldi
Copy link
Member

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.

@enejb
Copy link
Member Author

enejb commented Nov 13, 2015

Fixed the typo and hopefully clarified the comment.

@roccotripaldi
Copy link
Member

Looks good @enejb !

@roccotripaldi roccotripaldi added [Status] Ready to Merge Go ahead, you can push that green button! [Status] Tested on WP.com and removed [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. Test on WP.com labels Nov 16, 2015
@enejb enejb force-pushed the update/api-get-site-endpoint branch from 92ee1aa to 5ac91f2 Compare November 16, 2015 23:52
@enejb
Copy link
Member Author

enejb commented Nov 16, 2015

@dereksmart just updated to use Yoda style in the if statement

@dereksmart
Copy link
Member

LGTM, thanks @enejb

dereksmart added a commit that referenced this pull request Nov 17, 2015
@dereksmart dereksmart merged commit a5c54e3 into master Nov 17, 2015
@dereksmart dereksmart deleted the update/api-get-site-endpoint branch November 17, 2015 05:50
@kraftbj kraftbj removed the [Status] Ready to Merge Go ahead, you can push that green button! label Oct 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] WPCOM API [Status] Tested on WP.com Touches WP.com Files [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants