Skip to content

Commit

Permalink
Release May 15 (#3103)
Browse files Browse the repository at this point in the history
* chore(deps-dev): bump @wordpress/browserslist-config

Bumps [@wordpress/browserslist-config](https://github.com/WordPress/gutenberg/tree/HEAD/packages/browserslist-config) from 5.37.0 to 5.38.0.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/browserslist-config/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/[email protected]/packages/browserslist-config)

---
updated-dependencies:
- dependency-name: "@wordpress/browserslist-config"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* chore(deps-dev): bump @rushstack/eslint-patch from 1.10.1 to 1.10.2

Bumps [@rushstack/eslint-patch](https://github.com/microsoft/rushstack/tree/HEAD/eslint/eslint-patch) from 1.10.1 to 1.10.2.
- [Changelog](https://github.com/microsoft/rushstack/blob/main/eslint/eslint-patch/CHANGELOG.md)
- [Commits](https://github.com/microsoft/rushstack/commits/@rushstack/eslint-patch_v1.10.2/eslint/eslint-patch)

---
updated-dependencies:
- dependency-name: "@rushstack/eslint-patch"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* chore(deps-dev): bump @types/wordpress__blocks from 12.5.13 to 12.5.14

Bumps [@types/wordpress__blocks](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/wordpress__blocks) from 12.5.13 to 12.5.14.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/wordpress__blocks)

---
updated-dependencies:
- dependency-name: "@types/wordpress__blocks"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* refactor(data-events): add abstract Connector class for shared methods (#3015)

* refactor: add abstract Connector class for shared methods

* chore: remove unused imports

* chore(deps-dev): bump @wordpress/browserslist-config

Bumps [@wordpress/browserslist-config](https://github.com/WordPress/gutenberg/tree/HEAD/packages/browserslist-config) from 5.38.0 to 5.39.0.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/browserslist-config/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/[email protected]/packages/browserslist-config)

---
updated-dependencies:
- dependency-name: "@wordpress/browserslist-config"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* chore(deps): bump qs and @types/qs

Bumps [qs](https://github.com/ljharb/qs) and [@types/qs](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/qs). These dependencies needed to be updated together.

Updates `qs` from 6.12.0 to 6.12.1
- [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md)
- [Commits](ljharb/qs@v6.12.0...v6.12.1)

Updates `@types/qs` from 6.9.14 to 6.9.15
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/qs)

---
updated-dependencies:
- dependency-name: qs
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: "@types/qs"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* fix: ensure only admins can reset starter content and newspack options (#3081)

* feat: add product option to autocomplete orders (#3072)

BREAKING CHANGE: Changes order autocompletion behavior for existing products!

* feat: add product option to autocomplete orders

* chore: update outdated docblock description

* feat(ras): skip campaign setup (#3051)

* feat(ras): skip campaign setup boilerplate

added new route, added fe logic

* feat(ras): added `is_skipped` to prerequisite status endpoint

* refactor: moved callback to named function

added ui to indicate async skipping flow

* feat: added skip logic to prerequisite component

combined "skipped" and "active" into single `isValid` const

* feat: `is_skipped` property to prerequisite type

added skip logic to RAS wizard

* fix: circle ci / typescript

* fix: ci / eslint

* refactor: remove redirect after skip

added allow continue when skipped.

* refactor: allow parametrized skip

* refactor: revert any type cast

* feat: pr feedback - added redirect, activation skip and remove `activationStep[0]`

* feat: pr feedback, appended `[skipped]` to select items

* chore(release): 4.0.0-alpha.1 [skip ci]

# [4.0.0-alpha.1](v3.8.0...v4.0.0-alpha.1) (2024-04-25)

### Bug Fixes

* ensure only admins can reset starter content and newspack options ([#3081](#3081)) ([4606721](4606721))

### Features

* add product option to autocomplete orders ([#3072](#3072)) ([4a2859b](4a2859b))
* **ras:** skip campaign setup ([#3051](#3051)) ([9ef0e6d](9ef0e6d))

### BREAKING CHANGES

* Changes order autocompletion behavior for existing products!

* feat: add product option to autocomplete orders

* chore: update outdated docblock description

* chore(release): 4.0.0-alpha.2 [skip ci]

# [4.0.0-alpha.2](v4.0.0-alpha.1...v4.0.0-alpha.2) (2024-04-25)

### Bug Fixes

* remove deprecated filter callback ([#3090](#3090)) ([5d7d0bf](5d7d0bf))

* chore(release): 4.0.0-alpha.3 [skip ci]

# [4.0.0-alpha.3](v4.0.0-alpha.2...v4.0.0-alpha.3) (2024-04-26)

### Bug Fixes

* enable Memberships fix cron job only when environment constant is defined ([#3087](#3087)) ([5d40297](5d40297))

* OAuth: use a custom table for transients (#3106)

* feat: start new custom table for oauth transients data

* fix: copy/paste error

* fix(google-oauth): use custom table for transients

* feat: cleanup old transients

* fix: clean up on the fly too, and limit to deleting 1000 at a time max

---------

Co-authored-by: Adam Cassis <[email protected]>

* fix: autocomplete orders only for virtual products (#3111)

* fix: autocomplete orders only for virtual products

* chore: remove console.log

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: matticbot <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Derrick Koo <[email protected]>
Co-authored-by: Jared Rethman <[email protected]>
Co-authored-by: matticbot <[email protected]>
Co-authored-by: dkoo <[email protected]>
  • Loading branch information
7 people authored May 15, 2024
1 parent 1bce4f8 commit 2f0fa92
Show file tree
Hide file tree
Showing 20 changed files with 1,050 additions and 373 deletions.
30 changes: 16 additions & 14 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,46 @@
## [3.8.6](https://github.com/Automattic/newspack-plugin/compare/v3.8.5...v3.8.6) (2024-05-15)
# [4.0.0-alpha.3](https://github.com/Automattic/newspack-plugin/compare/v4.0.0-alpha.2...v4.0.0-alpha.3) (2024-04-26)


### Bug Fixes

* **google-login:** get the email from the /tokeninfo endpoint ([#3117](https://github.com/Automattic/newspack-plugin/issues/3117)) ([3296f1a](https://github.com/Automattic/newspack-plugin/commit/3296f1a0b36c7992749d6209bce3ed3ef2ea5ec5))
* enable Memberships fix cron job only when environment constant is defined ([#3087](https://github.com/Automattic/newspack-plugin/issues/3087)) ([5d40297](https://github.com/Automattic/newspack-plugin/commit/5d40297252a9022bb9b63b72cf805a08c37eb553))

## [3.8.5](https://github.com/Automattic/newspack-plugin/compare/v3.8.4...v3.8.5) (2024-05-14)
# [4.0.0-alpha.2](https://github.com/Automattic/newspack-plugin/compare/v4.0.0-alpha.1...v4.0.0-alpha.2) (2024-04-25)


### Bug Fixes

* **oauth-transients:** remove redundant cleanup ([#3112](https://github.com/Automattic/newspack-plugin/issues/3112)) ([c123c02](https://github.com/Automattic/newspack-plugin/commit/c123c0248ecf9aab8f16e5ab63e84f9900b3d6f5))
* remove deprecated filter callback ([#3090](https://github.com/Automattic/newspack-plugin/issues/3090)) ([5d7d0bf](https://github.com/Automattic/newspack-plugin/commit/5d7d0bf71d16907d3aa98def372a7d9ede8949c6))

## [3.8.4](https://github.com/Automattic/newspack-plugin/compare/v3.8.3...v3.8.4) (2024-05-14)
## [3.8.1](https://github.com/Automattic/newspack-plugin/compare/v3.8.0...v3.8.1) (2024-04-25)


### Bug Fixes

* **google-oauth:** use a custom table for transients ([#3106](https://github.com/Automattic/newspack-plugin/issues/3106)) ([d4a2f5c](https://github.com/Automattic/newspack-plugin/commit/d4a2f5ce8ff6931b98593dafe759eab8b59d7ab2))
* remove deprecated filter callback ([#3090](https://github.com/Automattic/newspack-plugin/issues/3090)) ([5d7d0bf](https://github.com/Automattic/newspack-plugin/commit/5d7d0bf71d16907d3aa98def372a7d9ede8949c6))


## [3.8.3](https://github.com/Automattic/newspack-plugin/compare/v3.8.2...v3.8.3) (2024-05-13)
# [4.0.0-alpha.1](https://github.com/Automattic/newspack-plugin/compare/v3.8.0...v4.0.0-alpha.1) (2024-04-25)


### Bug Fixes

* **ras:** sync purchase data only for most recent order/subscription ([#3086](https://github.com/Automattic/newspack-plugin/issues/3086)) ([2c7763a](https://github.com/Automattic/newspack-plugin/commit/2c7763a53894e5c350d6ce76e0f4ab3b1e768bc5))
* ensure only admins can reset starter content and newspack options ([#3081](https://github.com/Automattic/newspack-plugin/issues/3081)) ([4606721](https://github.com/Automattic/newspack-plugin/commit/46067217985f904286ddb2c952ba0e1deb954e56))

## [3.8.2](https://github.com/Automattic/newspack-plugin/compare/v3.8.1...v3.8.2) (2024-04-26)

### Features

### Bug Fixes
* add product option to autocomplete orders ([#3072](https://github.com/Automattic/newspack-plugin/issues/3072)) ([4a2859b](https://github.com/Automattic/newspack-plugin/commit/4a2859b894eab499e194102b0636dc20466e0c22))
* **ras:** skip campaign setup ([#3051](https://github.com/Automattic/newspack-plugin/issues/3051)) ([9ef0e6d](https://github.com/Automattic/newspack-plugin/commit/9ef0e6d1de8d4dafda4d2af1304206d0f8190b15))

* enable Memberships fix cron job only when environment constant is defined ([#3087](https://github.com/Automattic/newspack-plugin/issues/3087)) ([5d40297](https://github.com/Automattic/newspack-plugin/commit/5d40297252a9022bb9b63b72cf805a08c37eb553))

## [3.8.1](https://github.com/Automattic/newspack-plugin/compare/v3.8.0...v3.8.1) (2024-04-25)
### BREAKING CHANGES

* Changes order autocompletion behavior for existing products!

### Bug Fixes
* feat: add product option to autocomplete orders

* remove deprecated filter callback ([#3090](https://github.com/Automattic/newspack-plugin/issues/3090)) ([5d7d0bf](https://github.com/Automattic/newspack-plugin/commit/5d7d0bf71d16907d3aa98def372a7d9ede8949c6))
* chore: update outdated docblock description

# [3.8.0](https://github.com/Automattic/newspack-plugin/compare/v3.7.0...v3.8.0) (2024-04-25)

Expand Down
19 changes: 19 additions & 0 deletions assets/other-scripts/custom-product-options/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/* globals jQuery */
( function ( $ ) {
if ( ! $ ) {
return;
}
$( '#variable_product_options' ).on( 'change', 'input.variable_is_virtual', function ( e ) {
$( e.currentTarget )
.closest( '.woocommerce_variation' )
.find( '.show_if_variation_virtual' )
.hide();

if ( $( e.currentTarget ).is( ':checked' ) ) {
$( e.currentTarget )
.closest( '.woocommerce_variation' )
.find( '.show_if_variation_virtual' )
.show();
}
} );
} )( jQuery );
19 changes: 10 additions & 9 deletions assets/wizards/engagement/components/prerequisite.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ export default function Prerequisite( {
saveConfig,
}: PrequisiteProps ) {
const { href } = prerequisite;
const isValid = Boolean( prerequisite.active || prerequisite.is_skipped );

// If the prerequisite is active but has empty fields, show a warning.
const hasEmptyFields = () => {
if ( prerequisite.active && prerequisite.fields && prerequisite.warning ) {
if ( isValid && prerequisite.fields && prerequisite.warning ) {
const emptyValues = Object.keys( prerequisite.fields ).filter(
fieldName => '' === config[ fieldName as keyof Config ]
);
Expand Down Expand Up @@ -93,9 +94,7 @@ export default function Prerequisite( {
: sprintf(
// Translators: Save or Update settings.
__( '%s settings', 'newspack-plugin' ),
prerequisite.active
? __( 'Update', 'newspack-plugin' )
: __( 'Save', 'newspack-plugin' )
isValid ? __( 'Update', 'newspack-plugin' ) : __( 'Save', 'newspack-plugin' )
) }
</Button>
</div>
Expand Down Expand Up @@ -138,7 +137,7 @@ export default function Prerequisite( {
} }
>
{ /* eslint-disable no-nested-ternary */ }
{ ( prerequisite.active
{ ( isValid
? __( 'Update ', 'newspack-plugin' )
: prerequisite.fields
? __( 'Save ', 'newspack-plugin' )
Expand All @@ -158,8 +157,10 @@ export default function Prerequisite( {
);

let status = __( 'Pending', 'newspack-plugin' );
if ( prerequisite.active ) {
status = __( 'Ready', 'newspack-plugin' );
if ( isValid ) {
status = `${ __( 'Ready', 'newspack-plugin' ) } ${
prerequisite.is_skipped ? `(${ __( 'Skipped', 'newspack-plugin' ) })` : ''
}`;
}
if ( prerequisite.is_unavailable ) {
status = __( 'Unavailable', 'newspack-plugin' );
Expand All @@ -170,14 +171,14 @@ export default function Prerequisite( {
className="newspack-ras-wizard__prerequisite"
isMedium
expandable={ ! prerequisite.is_unavailable }
collapse={ prerequisite.active }
collapse={ isValid }
title={ prerequisite.label }
description={ sprintf(
/* translators: %s: Prerequisite status */
__( 'Status: %s', 'newspack-plugin' ),
status
) }
checkbox={ prerequisite.active ? 'checked' : 'unchecked' }
checkbox={ isValid ? 'checked' : 'unchecked' }
notificationLevel="info"
notification={ hasEmptyFields() }
>
Expand Down
1 change: 1 addition & 0 deletions assets/wizards/engagement/components/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ export type PrequisiteProps = {
action_enabled?: boolean;
disabled_text?: string;
is_unavailable?: boolean;
is_skipped?: boolean;
};
};

Expand Down
65 changes: 63 additions & 2 deletions assets/wizards/engagement/views/reader-activation/campaign.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,26 @@ import {
SectionHeader,
Waiting,
withWizardScreen,
utils,
} from '../../../../components/src';
import Prompt from '../../components/prompt';
import Router from '../../../../components/src/proxied-imports/router';
import './style.scss';

const { useHistory } = Router;

export default withWizardScreen( () => {
const { is_skipped_campaign_setup, reader_activation_url } = newspack_engagement_wizard;

const [ inFlight, setInFlight ] = useState( false );
const [ error, setError ] = useState( false );
const [ prompts, setPrompts ] = useState( null );
const [ allReady, setAllReady ] = useState( false );
const { reader_activation_url } = newspack_engagement_wizard;
const [ skipped, setSkipped ] = useState( {
status: '',
isSkipped: is_skipped_campaign_setup === '1',
} );
const history = useHistory();

const fetchPrompts = () => {
setError( false );
Expand All @@ -40,6 +50,45 @@ export default withWizardScreen( () => {
.finally( () => setInFlight( false ) );
};

/**
* Display prompt requiring editors to confirm skipping, on confirmation send request to
* server to store skipped option in options table and redirect back to RAS
*
* @return {void}
*/
async function onSkipCampaignSetup() {
if (
! utils.confirmAction(
__(
'Are you sure you want to skip setting up a reader activation campaign?',
'newspack-plugin'
)
)
) {
return;
}
setError( false );
setSkipped( { ...skipped, status: 'pending' } );
try {
const request = await apiFetch( {
path: '/newspack/v1/wizard/newspack-engagement-wizard/reader-activation/skip-campaign-setup',
method: 'POST',
data: { skip: ! skipped.isSkipped },
} );
if ( ! request.updated ) {
setError( { message: __( 'Server not updated', 'newspack-plugin' ) } );
setSkipped( { isSkipped: false, status: '' } );
return;
}
setSkipped( { isSkipped: Boolean( request.skipped ), status: '' } );
newspack_engagement_wizard.is_skipped_campaign_setup = request.skipped ? '1' : '';
history.push( '/reader-activation/complete' );
} catch ( err ) {
setError( err );
setSkipped( { isSkipped: false, status: '' } );
}
}

useEffect( () => {
window.scrollTo( 0, 0 );
fetchPrompts();
Expand Down Expand Up @@ -83,9 +132,21 @@ export default withWizardScreen( () => {
/>
) ) }
<div className="newspack-buttons-card">
<Button
isTertiary
disabled={ inFlight || skipped.isSkipped || skipped.status === 'pending' }
onClick={ onSkipCampaignSetup }
>
{ /* eslint-disable-next-line no-nested-ternary */ }
{ skipped.status === 'pending'
? __( 'Skipping…', 'newspack-plugin' )
: skipped.isSkipped
? __( 'Skipped', 'newspack-plugin' )
: __( 'Skip', 'newspack-plugin' ) }
</Button>
<Button
isPrimary
disabled={ inFlight || ! allReady }
disabled={ inFlight || ( ! allReady && ! skipped.isSkipped ) }
href={ `${ reader_activation_url }/complete` }
>
{ __( 'Continue', 'newspack-plugin' ) }
Expand Down
63 changes: 49 additions & 14 deletions assets/wizards/engagement/views/reader-activation/complete.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,26 @@ import {
} from '../../../../components/src';

const listItems = [
__(
'Your <strong>current segments and prompts</strong> will be deactivated and archived.',
'newspack-plugin'
),
__(
'<strong>Reader registration</strong> will be activated to enable better targeting for driving engagement and conversations.',
'newspack-plugin'
),
__(
'The <strong>Reader Activation campaign</strong> will be activated with default segments and settings.',
'newspack-plugin'
),
{
text: __(
'Your <strong>current segments and prompts</strong> will be deactivated and archived.',
'newspack-plugin'
),
isSkipped: '<span class="is-skipped">[skipped]</span>',
},
{
text: __(
'<strong>Reader registration</strong> will be activated to enable better targeting for driving engagement and conversations.',
'newspack-plugin'
),
},
{
text: __(
'The <strong>Reader Activation campaign</strong> will be activated with default segments and settings.',
'newspack-plugin'
),
isSkipped: '<span class="is-skipped">[skipped]</span>',
},
];

const activationSteps = [
Expand All @@ -42,6 +50,8 @@ const activationSteps = [
__( 'Activating Reader Activation Campaign…', 'newspack-plugin' ),
];

const activationStepsCount = activationSteps.length;

/**
* Get a random number between min and max.
*
Expand All @@ -60,7 +70,29 @@ export default withWizardScreen( () => {
const [ progressLabel, setProgressLabel ] = useState( false );
const [ completed, setCompleted ] = useState( false );
const timer = useRef();
const { reader_activation_url } = newspack_engagement_wizard;
const { reader_activation_url, is_skipped_campaign_setup = '' } = newspack_engagement_wizard;
const isSkippedCampaignSetup = is_skipped_campaign_setup === '1';

/**
* If skipped, remove first item.
*/
if ( isSkippedCampaignSetup && activationSteps.length !== activationStepsCount - 1 ) {
activationSteps.shift();
}

/**
* Generate step list strings
*/
for ( const listItemIndex in listItems ) {
if ( ! listItems[ listItemIndex ].text ) {
continue;
}
const suffix = isSkippedCampaignSetup ? ` ${ listItems[ listItemIndex ].isSkipped ?? '' }` : '';
listItems[ listItemIndex ] = `${ listItems[ listItemIndex ].text }${ suffix }`;
if ( isSkippedCampaignSetup ) {
listItems[ listItemIndex ] += ` ${ listItems[ listItemIndex ].isSkipped ?? '' }`;
}
}

useEffect( () => {
if ( timer.current ) {
Expand All @@ -80,7 +112,7 @@ export default withWizardScreen( () => {
setProgressLabel( __( 'Done!', 'newspack-plugin' ) );
setTimeout( () => {
setInFlight( false );
window.location = reader_activation_url;
// window.location = reader_activation_url;
}, 3000 );
}
}, [ completed, progress ] );
Expand All @@ -95,6 +127,9 @@ export default withWizardScreen( () => {
await apiFetch( {
path: '/newspack/v1/wizard/newspack-engagement-wizard/reader-activation/activate',
method: 'post',
data: {
skip_activation: isSkippedCampaignSetup,
},
} )
);
} catch ( err ) {
Expand Down
4 changes: 3 additions & 1 deletion assets/wizards/engagement/views/reader-activation/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ export default withWizardScreen( ( { wizardApiFetch } ) => {
const _allReady =
! missingPlugins.length &&
prerequisites &&
Object.keys( prerequisites ).every( key => prerequisites[ key ]?.active );
Object.keys( prerequisites ).every(
key => prerequisites[ key ]?.active || prerequisites[ key ]?.skipped
);

setAllReady( _allReady );

Expand Down
4 changes: 4 additions & 0 deletions assets/wizards/engagement/views/reader-activation/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
margin-top: 0 !important;
}

span.is-skipped {
color: wp-colors.$gray-700;
}

.newspack-ras-campaign {
&__prompt-wizard,
&__completed {
Expand Down
4 changes: 4 additions & 0 deletions includes/class-newspack.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ private function includes() {
include_once NEWSPACK_ABSPATH . 'includes/data-events/class-popups.php';
include_once NEWSPACK_ABSPATH . 'includes/data-events/class-memberships.php';
include_once NEWSPACK_ABSPATH . 'includes/data-events/connectors/ga4/class-ga4.php';
include_once NEWSPACK_ABSPATH . 'includes/data-events/connectors/class-connector.php';
include_once NEWSPACK_ABSPATH . 'includes/data-events/connectors/class-mailchimp.php';
include_once NEWSPACK_ABSPATH . 'includes/data-events/connectors/class-activecampaign.php';
include_once NEWSPACK_ABSPATH . 'includes/data-events/class-woo-user-registration.php';
Expand Down Expand Up @@ -207,6 +208,9 @@ class_exists( 'Newspack_Popups' ) && 'edit.php?post_type=' . \Newspack_Popups::N
* Handle resetting of various options and content.
*/
public function handle_resets() {
if ( ! current_user_can( 'manage_options' ) ) {
return;
}
$redirect_url = admin_url( 'admin.php?page=newspack' );
$newspack_reset = filter_input( INPUT_GET, 'newspack_reset', FILTER_SANITIZE_FULL_SPECIAL_CHARS );
if ( 'starter-content' === $newspack_reset ) {
Expand Down
Loading

0 comments on commit 2f0fa92

Please sign in to comment.