Making WordPress.org

Ticket #3456: 3456_2.diff

File 3456_2.diff, 4.6 KB (added by psusu, 6 years ago)

Patch enhanced with subscribe email message

  • wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-directory-compat.php

    diff --git a/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-directory-compat.php b/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-directory-compat.php
    index 8b632b6..6ebdd7c 100644
    a b abstract class Directory_Compat { 
    751751                        if ( 'plugin' == $this->compat() ) {
    752752                                $subscribe   = esc_html__( 'Subscribe to this plugin', 'wporg-forums' );
    753753                                $unsubscribe = esc_html__( 'Unsubscribe from this plugin', 'wporg-forums' );
     754                                $subscribe_description   = esc_html__( 'Receive email updates about new topics on this plugin', 'wporg-forums' );
     755                                $unsubscribe_description = esc_html__( 'Unsubscribe from email updates about new topics on this plugin', 'wporg-forums' );
    754756                        } else {
    755757                                $subscribe   = esc_html__( 'Subscribe to this theme', 'wporg-forums' );
    756758                                $unsubscribe = esc_html__( 'Unsubscribe from this theme', 'wporg-forums' );
     759                                $subscribe_description   = esc_html__( 'Receive email updates about new topics on this theme', 'wporg-forums' );
     760                                $unsubscribe_description = esc_html__( 'Unsubscribe from email updates about new topics on this theme', 'wporg-forums' );
    757761                        }
    758762                        $term_subscription = Term_Subscription\Plugin::get_subscription_link( array(
    759763                                'term_id'     => $term->term_id,
    760764                                'taxonomy'    => $this->taxonomy(),
    761765                                'subscribe'   => $subscribe,
    762766                                'unsubscribe' => $unsubscribe,
     767                                'subscribe_description'   => $subscribe_description,
     768                                'unsubscribe_description' => $unsubscribe_description,
    763769                        ) );
    764770                }
    765771
  • wordpress.org/public_html/wp-content/plugins/wporg-bbp-term-subscription/inc/class-plugin.php

    diff --git a/wordpress.org/public_html/wp-content/plugins/wporg-bbp-term-subscription/inc/class-plugin.php b/wordpress.org/public_html/wp-content/plugins/wporg-bbp-term-subscription/inc/class-plugin.php
    index 08f77d4..fa41167 100644
    a b class Plugin { 
    226226                // Strip tags from text and set up message body.
    227227                $topic_content = strip_tags( bbp_get_topic_content( $topic_id ) );
    228228                $topic_url     = get_permalink( $topic_id );
    229 
     229                $forum_url = get_permalink( $forum_id )
    230230                $message = sprintf( __( '%1$s wrote:
    231231
    232232%2$s
    Topic Link: %3$s 
    237237
    238238%4$s
    239239
    240 Login and visit the topic to reply to the topic or unsubscribe from these emails. Note that replying to this email has no effect.', 'wporg-forums' ),
     240Login and visit the topic to reply.
     241To no longer receive emails about this topic, please visit the link below to unsubscribe:
     242%5$s
     243Note that replying to this email has no effect.', 'wporg-forums' ),
    241244                        $topic_author_name,
    242245                        $topic_content,
    243246                        $topic_url,
    244247                        // String may not have placeholders, ie. in the case of tags.
    245                         sprintf( $this->labels['receipt'], $this->directory ? $this->directory->title() : '' )
     248                        sprintf( $this->labels['receipt'], $this->directory ? $this->directory->title() : '' ),
     249                        $forum_url,
    246250                );
    247251
    248252                return $message;
    Login and visit the topic to reply to the topic or unsubscribe from these emails 
    579583                        'taxonomy'    => 'topic-tag',
    580584                        'subscribe'   => esc_html__( 'Subscribe to this topic tag', 'wporg-forums' ),
    581585                        'unsubscribe' => esc_html__( 'Unsubscribe from this topic tag', 'wporg-forums' ),
     586                        'subscribe_description'   => esc_html__( 'Receive email updates about new topics', 'wporg-forums' ),
     587                        'unsubscribe_description' => esc_html__( 'Unsubscribe from email updates about new topics', 'wporg-forums' ),
    582588                ), 'get_term_subscription_link' );
    583589                if ( empty( $r['user_id'] ) || empty( $r['term_id'] ) || empty( $r['taxonomy'] ) ) {
    584590                        return false;
    Login and visit the topic to reply to the topic or unsubscribe from these emails 
    590596
    591597                $url = self::get_subscription_url( $r['user_id'], $r['term_id'], $r['taxonomy'] );
    592598                $text = $r['subscribe'];
     599                $description = $r['subscribe_description'];
    593600                if ( self::is_user_subscribed_to_term( $r['user_id'], $r['term_id'] ) ) {
    594601                        $text = $r['unsubscribe'];
     602                        $description = $r['unsubscribe_description'];
    595603                }
    596                 return sprintf( "<div class='wporg-bbp-term-subscription'><a href='%s'>%s</a></div>",
     604
     605                return sprintf( "<div class='wporg-bbp-term-subscription'><a href='%s'>%s</a> <div class='notice notice-info notice-alt'>%s</div></div>",
    597606                        $url,
    598                         esc_html( $text ) );
     607                        esc_html( $text ),
     608                        esc_html( $description )
     609                );
    599610        }
    600611
    601612        public static function get_valid_actions() {