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

CPT: Enable type toggles for supported Jetpack versions #6722

Merged
merged 2 commits into from
Jul 25, 2016

Conversation

aduth
Copy link
Contributor

@aduth aduth commented Jul 12, 2016

Related: #4502
Related: #6105
Blocked by: #4369

This pull request seeks to allow Jetpack sites running supported versions and having enabled the "Custom Content Types" feature to toggle the active custom post types for their site.

Testing instructions:

As noted above, this is blocked by #4369. It is not currently possible to change the active setting of a custom post type without these changes. Pending future release or with these changes applied manually to your Jetpack site (and meeting or changing the versionCompare version), verify that you can toggle custom post types on a site.

  1. Navigate to the site writing settings
  2. Select a site
  3. Note that if your site is hosted on WordPress.com or has the Jetpack "Custom Content Types" module running on a supported Jetpack version, you are offered the option to toggle testimonials or portfolio projects
  4. Note that the current toggle setting matches expectations
  5. Toggle one or both of the post types and save your changes
  6. Note that the save completes successfully and the sidebar navigation item is added or removed to reflect your change
  7. Refresh the page to confirm that the setting change has persisted

Test live: https://calypso.live/?branch=update/cpt-jetpack-writing-settings

@aduth aduth added Jetpack [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. Custom Post Types (CPT) labels Jul 12, 2016
}

return (
site.versionCompare( '4.2.0', '>=' ) >= 0 &&
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't this be site.versionCompare( '4.2.0', '>=' ) && - since versionCompare returns a boolean?

@timmyc
Copy link
Contributor

timmyc commented Jul 22, 2016

I tested this out against a site that is running 4.1.1 and I was still seeing the <CustomPostTypeFieldset />, I think it is related to my comment above. Using the toggles against my 4.1.1 site did not persist the changes, but toggling CPT for wpcom sites still works as expected.

@timmyc timmyc added [Status] Needs Author Reply and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Jul 22, 2016
@aduth
Copy link
Contributor Author

aduth commented Jul 22, 2016

@timmyc Yeah, that would make sense, since false >= 0. #6744 added a new isJetpackMinimumVersion selector, so I think I'll change to use that instead anyways.

@aduth aduth force-pushed the update/cpt-jetpack-writing-settings branch from b81aa6c to 9d8f828 Compare July 22, 2016 20:33
@aduth
Copy link
Contributor Author

aduth commented Jul 22, 2016

Rebased and pushed an alternate solution using isJetpackMinimumVersion. @timmyc could you take this for another spin on your Jetpack site?

@aduth aduth added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. and removed [Status] Needs Author Reply labels Jul 22, 2016
@timmyc
Copy link
Contributor

timmyc commented Jul 22, 2016

Working as expected now. 🚢

@timmyc timmyc added [Status] Ready to Merge and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Jul 22, 2016
@aduth aduth force-pushed the update/cpt-jetpack-writing-settings branch from 9d8f828 to 538f3c0 Compare July 25, 2016 20:23
@aduth aduth merged commit 287fcec into master Jul 25, 2016
@aduth aduth deleted the update/cpt-jetpack-writing-settings branch July 25, 2016 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants