Skip to content

Commit

Permalink
Merge pull request #1157 from Automattic/alpha
Browse files Browse the repository at this point in the history
Release Jul 03
  • Loading branch information
laurelfulford authored Jul 3, 2023
2 parents f1c10b3 + fc54d82 commit 127d65b
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 36 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# [2.21.0-alpha.1](https://github.com/Automattic/newspack-popups/compare/v2.20.0...v2.21.0-alpha.1) (2023-06-22)


### Bug Fixes

* ensure inline posts are inserted into main post content only ([#1137](https://github.com/Automattic/newspack-popups/issues/1137)) ([624bd56](https://github.com/Automattic/newspack-popups/commit/624bd56f4327ea92112cf465733837b1c343ac6c))
* remove dismissed event after form is submitted ([#1143](https://github.com/Automattic/newspack-popups/issues/1143)) ([b470efd](https://github.com/Automattic/newspack-popups/commit/b470efdc753f242b8470251345acea87a678414e))
* render prompts on metered content ([#1152](https://github.com/Automattic/newspack-popups/issues/1152)) ([05b5f76](https://github.com/Automattic/newspack-popups/commit/05b5f7621d4bf935904dd9a45a0832f1c3e34d90))


### Features

* front-end GA4 events for prompt interactions ([#1136](https://github.com/Automattic/newspack-popups/issues/1136)) ([ae274aa](https://github.com/Automattic/newspack-popups/commit/ae274aaed210e93a741d640f3d2b1c95ccacff8a)), closes [#1133](https://github.com/Automattic/newspack-popups/issues/1133)
* rearrange info on popup metadta events ([#1144](https://github.com/Automattic/newspack-popups/issues/1144)) ([dcac4b7](https://github.com/Automattic/newspack-popups/commit/dcac4b7823f9913572a67c9010d63a72a350d936))

# [2.20.0](https://github.com/Automattic/newspack-popups/compare/v2.19.0...v2.20.0) (2023-06-19)


Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
"yoast/phpunit-polyfills": "^1.0",
"phpunit/phpunit": "^7.0 || ^9.5",
"dms/phpunit-arraysubset-asserts": "^0.4.0"
"dms/phpunit-arraysubset-asserts": "^0.5.0"
},
"license": "GPL-3.0-or-later",
"scripts": {
Expand Down
43 changes: 21 additions & 22 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion includes/class-newspack-popups-inserter.php
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,12 @@ private static function is_memberships_restricted( $post_id = null ) {
if ( ! \wc_memberships_is_post_content_restricted( $post_id ) ) {
return false;
}
return ! is_user_logged_in() || ! current_user_can( 'wc_memberships_view_restricted_post_content', $post_id );
$is_restricted = ! is_user_logged_in() || ! current_user_can( 'wc_memberships_view_restricted_post_content', $post_id );
// Detect Content Gate Metering.
if ( $is_restricted && method_exists( 'Newspack\Memberships\Metering', 'is_metering' ) ) {
$is_restricted = ! Newspack\Memberships\Metering::is_metering();
}
return $is_restricted;
}

/**
Expand All @@ -461,6 +466,8 @@ public static function insert_popups_in_content( $content = '' ) {
// Don't inject inline popups on paywalled posts.
// It doesn't make sense with a paywall message and also causes an infinite loop.
|| self::is_memberships_restricted()
// At filter priority 1, $content should be the same as the unfiltered post_content. This guards against inserting in other content such as featured image captions/descriptions.
|| get_post()->post_content !== $content
) {
return $content;
}
Expand Down
2 changes: 1 addition & 1 deletion newspack-popups.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Author URI: https://newspack.blog
* Text Domain: newspack-popups
* Domain Path: /languages
* Version: 2.20.0
* Version: 2.21.0-alpha.1
*
* @package Newspack_Popups
*/
Expand Down
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "newspack-popups",
"version": "2.20.0",
"version": "2.21.0-alpha.1",
"main": "Gruntfile.js",
"author": "Automattic",
"scripts": {
Expand Down Expand Up @@ -37,7 +37,7 @@
"whatwg-fetch": "^3.6.2"
},
"devDependencies": {
"@rushstack/eslint-patch": "^1.3.0",
"@rushstack/eslint-patch": "^1.3.2",
"eslint": "^7.32.0",
"lint-staged": "^13.2.2",
"newspack-scripts": "^5.1.0",
Expand Down

0 comments on commit 127d65b

Please sign in to comment.