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

Minor: Allow extra argument to '/sites/%s/themes/mine' endpoint #25070

Merged
merged 2 commits into from
Jul 14, 2022

Conversation

andres-blanco
Copy link
Contributor

@andres-blanco andres-blanco commented Jul 12, 2022

This PR is a follow up to this other one. The idea is to allow the argument dont_change_homepage when POSTing to /sites/%s/themes/mine.

While the name might seem strange is the one actually being sent by Calypso for Simple sites.

For more context see: paYKcK-1Mb-p2#comment-1395

Testing instructions:

  1. Set up a Jurassic Ninja site.
  2. Connect it to WP.com.
  3. Connect to your JN site through ssh.
  4. Add this snippet to the bottom of /srv/users/[USER]/apps/[USER]/public/wp-load.php.
add_action('jetpack_pre_switch_theme', function($arg1, $args ) {
        error_log( var_export( $arg1, true ) );
        error_log( var_export( $args, true ) );
}, 10, 2);
  1. Run tail -F /srv/users/[USER]/apps/[USER]/public/wp-content/debug.log.
  2. Go to the calypso.live link on this PR and select your JN site.
  3. Go to the theme showcase.
  4. Select the twenty twenty theme and press Activate image
  5. Verify this is the output in the log:
[12-Jul-2022 15:01:49 UTC] 'twentytwenty'
[12-Jul-2022 15:01:49 UTC] array (
  'theme' => 'twentytwenty',
  'dont_change_homepage' => [true|false], ### The value will depend on the radio button selected in the Activate modal
)

Does this pull request change what data or activity we track or use?

No.

Related to Automattic/wp-calypso#56869

@andres-blanco andres-blanco requested a review from a team July 12, 2022 15:05
@andres-blanco andres-blanco self-assigned this Jul 12, 2022
@github-actions github-actions bot added [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Feature] WPCOM API labels Jul 12, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Jul 12, 2022

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ All commits were linted before commit.
  • ✅ Add a "[Status]" label (In Progress, Needs Team Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available.


Once your PR is ready for review, check one last time that all required checks (other than "Required review") appearing at the bottom of this PR are passing or skipped.
Then, add the "[Status] Needs Team review" label and ask someone from your team review the code.
Once you’ve done so, switch to the "[Status] Needs Review" label; someone from Jetpack Crew will then review this PR and merge it to be included in the next Jetpack release.


Jetpack plugin:

  • Next scheduled release: August 2, 2022.
  • Scheduled code freeze: July 25, 2022.

@github-actions github-actions bot added the [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! label Jul 12, 2022
@andres-blanco andres-blanco removed the [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! label Jul 12, 2022
markbiek
markbiek previously approved these changes Jul 13, 2022
Copy link
Contributor

@markbiek markbiek left a comment

Choose a reason for hiding this comment

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

LGTM!

…ck-endpoints.php

Co-authored-by: Mark Biek <mark.biek@automattic.com>
Copy link
Contributor

@markbiek markbiek left a comment

Choose a reason for hiding this comment

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

LGTM!

@andres-blanco andres-blanco added [Status] Needs Review To request a review from Crew. Label will be renamed soon. and removed [Status] Needs Team Review labels Jul 13, 2022
@jeherve jeherve added this to the jetpack/11.2 milestone Jul 14, 2022
@jeherve jeherve added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Review To request a review from Crew. Label will be renamed soon. labels Jul 14, 2022
@jeherve jeherve merged commit 6883f82 into trunk Jul 14, 2022
@jeherve jeherve deleted the add/parameter-theme-mine branch July 14, 2022 07:51
@github-actions github-actions bot removed the [Status] Ready to Merge Go ahead, you can push that green button! label Jul 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] WPCOM API [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants