summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jetpack/modules/subscriptions.php')
-rw-r--r--plugins/jetpack/modules/subscriptions.php21
1 files changed, 20 insertions, 1 deletions
diff --git a/plugins/jetpack/modules/subscriptions.php b/plugins/jetpack/modules/subscriptions.php
index de7cd148..8db983d3 100644
--- a/plugins/jetpack/modules/subscriptions.php
+++ b/plugins/jetpack/modules/subscriptions.php
@@ -100,6 +100,8 @@ class Jetpack_Subscriptions {
add_action( 'transition_post_status', array( $this, 'maybe_send_subscription_email' ), 10, 3 );
add_filter( 'jetpack_published_post_flags', array( $this, 'set_post_flags' ), 10, 2 );
+
+ add_filter( 'post_updated_messages', array( $this, 'update_published_message' ), 18, 1 );
}
/**
@@ -183,6 +185,24 @@ class Jetpack_Subscriptions {
}
}
+ function update_published_message( $messages ) {
+ global $post;
+ if ( ! $this->should_email_post_to_subscribers( $post ) ) {
+ return $messages;
+ }
+
+ $view_post_link_html = sprintf( ' <a href="%1$s">%2$s</a>',
+ esc_url( get_permalink( $post ) ),
+ __( 'View post' ) // intentinally omitted domain
+ );
+
+ $messages['post'][6] = sprintf(
+ /* translators: Message shown after a post is published */
+ esc_html__( 'Post published and sending emails to subscribers.', 'jetpack' )
+ ) . $view_post_link_html;
+ return $messages;
+ }
+
public function should_email_post_to_subscribers( $post ) {
$should_email = true;
if ( get_post_meta( $post->ID, '_jetpack_dont_email_post_to_subs', true ) ) {
@@ -320,7 +340,6 @@ class Jetpack_Subscriptions {
*/
function subscriptions_settings_section() {
?>
-
<p id="jetpack-subscriptions-settings"><?php _e( 'Change whether your visitors can subscribe to your posts or comments or both.', 'jetpack' ); ?></p>
<?php