Skip to content

Commit

Permalink
CPT: Enable type toggles only when Jetpack module active
Browse files Browse the repository at this point in the history
  • Loading branch information
aduth committed Jul 25, 2016
1 parent fb26927 commit 538f3c0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions client/my-sites/site-settings/form-writing.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import FormLabel from 'components/forms/form-label';
import SectionHeader from 'components/section-header';
import Card from 'components/card';
import Button from 'components/button';
import { isJetpackMinimumVersion } from 'state/sites/selectors';
import { isJetpackModuleActive, isJetpackMinimumVersion } from 'state/sites/selectors';
import { getSelectedSiteId } from 'state/ui/selectors';
import { requestPostTypes } from 'state/post-types/actions';
import CustomPostTypeFieldset from './custom-post-types-fieldset';
Expand Down Expand Up @@ -62,7 +62,8 @@ const SiteSettingsFormWriting = React.createClass( {
isCustomPostTypesSettingsEnabled() {
return (
config.isEnabled( 'manage/custom-post-types' ) &&
false !== this.props.jetpackVersionSupportsCustomTypes
false !== this.props.jetpackVersionSupportsCustomTypes &&
false !== this.props.jetpackCustomTypesModuleActive
);
},

Expand Down Expand Up @@ -200,6 +201,7 @@ export default connect(
const siteId = getSelectedSiteId( state );

return {
jetpackCustomTypesModuleActive: isJetpackModuleActive( state, siteId, 'custom-content-types' ),
jetpackVersionSupportsCustomTypes: isJetpackMinimumVersion( state, siteId, '4.2.0' )
};
},
Expand Down

0 comments on commit 538f3c0

Please sign in to comment.