summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2018-06-08 10:09:24 -0400
committerAnthony G. Basile <blueness@gentoo.org>2018-06-08 10:09:24 -0400
commita6b006c0f1ef757f23375f7906193370337d8bd7 (patch)
tree4467c6423b2c54e6ef8c3e79241a833fb17833a5 /plugins/jetpack/modules/subscriptions.php
parentUpdate akismet 4.0.7 (diff)
downloadblogs-gentoo-a6b006c0f1ef757f23375f7906193370337d8bd7.tar.gz
blogs-gentoo-a6b006c0f1ef757f23375f7906193370337d8bd7.tar.bz2
blogs-gentoo-a6b006c0f1ef757f23375f7906193370337d8bd7.zip
Update jetpack 6.2
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