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

feat: add a global setting to suppress ads on sponsored posts #68

Merged
merged 1 commit into from
Sep 24, 2021

Conversation

dkoo
Copy link
Contributor

@dkoo dkoo commented Sep 23, 2021

All Submissions:

Changes proposed in this Pull Request:

Partially reverts the behavior from #62, which automatically suppresses all ads for all sponsored posts. This PR adds a new toggle option in plugin settings to do so (disabled by default), restoring the prior behavior but allowing publishers to opt into the new suppression.

Closes #67.

How to test the changes in this Pull Request:

  1. On master, publish a post with at least one sponsor and ensure at least one ad is displayed in a global position and/or block or widget.
  2. View the sponsored post on the front-end; observe that no ads are displayed on the post.
  3. Check out this branch. Refresh the sponsored post; confirm that ads are now displayed.
  4. Go to WP admin > Sponsors > Settings and confirm there's a new option here, disabled by default:

Screen Shot 2021-09-23 at 4 15 50 PM

  1. Toggle it on and save, refresh the sponsored post; confirm that the ads are no longer displayed.
  2. Edit the sponsored post and test the Newspack Ads Settings toggle to ensure that it still behaves as expected for the individual post when ads aren't suppressed globally for sponsored posts:

Screen Shot 2021-09-23 at 4 17 01 PM

### Other information:
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@dkoo dkoo requested a review from a team September 23, 2021 22:18
@dkoo dkoo self-assigned this Sep 23, 2021
Copy link
Contributor

@laurelfulford laurelfulford left a comment

Choose a reason for hiding this comment

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

This works as described for me! 👍

I had an ad in the global 'below header' position; when I applied this PR, it started displaying on my sponsored post, and when I checked "Suppress Ads" under the Sponsors settings, it stopped showing up on the sponsored post.

Copy link
Member

@adekbadek adekbadek left a comment

Choose a reason for hiding this comment

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

👌

@dkoo dkoo merged commit ce45916 into master Sep 24, 2021
@dkoo dkoo deleted the feat/suppress-all-toggle branch September 24, 2021 15:10
matticbot pushed a commit that referenced this pull request Sep 24, 2021
# [1.7.0-alpha.1](v1.6.0...v1.7.0-alpha.1) (2021-09-24)

### Features

* add a global setting to suppress ads on sponsored posts ([#68](#68)) ([ce45916](ce45916))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 1.7.0-alpha.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

matticbot pushed a commit that referenced this pull request Sep 24, 2021
# [1.7.0](v1.6.0...v1.7.0) (2021-09-24)

### Features

* add a global setting to suppress ads on sponsored posts ([#68](#68)) ([ce45916](ce45916))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 1.7.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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.

Add toggle to enable ads on sponsored posts
4 participants