| @@ -710,8 +710,17 @@ | ||
| 710 | 710 | if ( empty( $post_access_level ) || ! is_string( $post_access_level ) ) { |
| 711 | 711 | $post_access_level = Abstract_Token_Subscription_Service::POST_ACCESS_LEVEL_EVERYBODY; |
| 712 | 712 | } |
| 713 | 713 | |
| 714 | + // Only the editor switches a Paywall post to subscribers; REST, WP-CLI and importer saves don't. | |
| 715 | + // The block's name constant isn't loaded everywhere this runs, hence the literal. | |
| 716 | + if ( | |
| 717 | + Abstract_Token_Subscription_Service::POST_ACCESS_LEVEL_EVERYBODY === $post_access_level | |
| 718 | + && has_block( 'jetpack/paywall', $post_id ) | |
| 719 | + ) { | |
| 720 | + $post_access_level = Abstract_Token_Subscription_Service::POST_ACCESS_LEVEL_SUBSCRIBERS; | |
| 721 | + } | |
| 722 | + | |
| 714 | 723 | self::$post_access_level_cache[ $cache_key ] = $post_access_level; |
| 715 | 724 | |
| 716 | 725 | return $post_access_level; |
| 717 | 726 | } |