diff --git a/projects/plugins/jetpack/changelog/Subscriber-Cap-Filter b/projects/plugins/jetpack/changelog/Subscriber-Cap-Filter new file mode 100644 index 0000000000000..a90f17f1c8886 --- /dev/null +++ b/projects/plugins/jetpack/changelog/Subscriber-Cap-Filter @@ -0,0 +1,4 @@ +Significance: minor +Type: enhancement + +Subscription: Add Filter to Allow Newsletter Block Meta to Capability to be Changed. diff --git a/projects/plugins/jetpack/modules/subscriptions.php b/projects/plugins/jetpack/modules/subscriptions.php index 7f4d4ab8c99e9..bbdc4b9619b53 100644 --- a/projects/plugins/jetpack/modules/subscriptions.php +++ b/projects/plugins/jetpack/modules/subscriptions.php @@ -960,7 +960,17 @@ public function maybe_set_first_published_status( $new_status, $old_status, $pos * @return bool */ public function first_published_status_meta_auth_callback() { - if ( current_user_can( 'publish_posts' ) ) { + /** + * Filter the capability to view if a post was ever published in the Subscription Module. + * + * @module subscriptions + * + * @since $$next-version$$ + * + * @param string $capability User capability needed to view if a post was ever published. Default to publish_posts. + */ + $capability = apply_filters( 'jetpack_subscriptions_post_was_ever_published_capability', 'publish_posts' ); + if ( current_user_can( $capability ) ) { return true; } return false;