<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[3719] sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-bbp-term-subscription: Support: Term Subscription initial commit.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="http://meta.trac.wordpress.org/changeset/3719">3719</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://meta.trac.wordpress.org/changeset/3719","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>jmdodd</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2016-07-25 19:51:31 +0000 (Mon, 25 Jul 2016)</dd>
</dl>

<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Support: Term Subscription initial commit.

See <a href="http://meta.trac.wordpress.org/ticket/1544">#1544</a>.</pre>

<h3>Added Paths</h3>
<ul>
<li>sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-bbp-term-subscription/inc/</li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporgbbptermsubscriptionincclasspluginphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-bbp-term-subscription/inc/class-plugin.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginswporgbbptermsubscriptionwporgbbptermsubscriptionphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-bbp-term-subscription/wporg-bbp-term-subscription.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporgbbptermsubscriptionincclasspluginphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-bbp-term-subscription/inc/class-plugin.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-bbp-term-subscription/inc/class-plugin.php                         (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-bbp-term-subscription/inc/class-plugin.php   2016-07-25 19:51:31 UTC (rev 3719)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,467 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+namespace WordPressdotorg\Forums\Term_Subscription;
+
+class Plugin {
+
+       /**
+        * @todo Subscribe/unsubscribe link in topic view sidebar next to topic tag.
+        * @todo AJAXify subscription action.
+        * @todo Abstract for plugin/theme taxonomies as needed.
+        */
+
+       private $subscribers;
+
+       /**
+        * @var Plugin The singleton instance.
+        */
+       private static $instance;
+
+       const META_KEY = '_bbp_term_subscription';
+
+       /**
+        * Always return the same instance of this plugin.
+        *
+        * @return Plugin
+        */
+       public static function get_instance() {
+               if ( ! ( self::$instance instanceof Plugin ) ) {
+                       self::$instance = new Plugin();
+               }
+               return self::$instance;
+       }
+
+       /**
+        * Instantiate a new Plugin object.
+        */
+       private function __construct() {
+               $this->subscribers = array();
+
+               add_action( 'bbp_init', array( $this, 'bbp_init' ) );
+       }
+
+       /**
+        * Initialize the plugin.
+        */
+       public function bbp_init() {
+               $user_id = get_current_user_id();
+               if ( ! $user_id ) {
+                       return;
+               }
+
+               // Add views and actions for users.
+               add_action( 'bbp_get_request', array( $this, 'term_subscribe_handler' ) );
+
+               // Notify subscribers when a topic or reply with a given term is added.
+               add_action( 'bbp_new_topic', array( $this, 'notify_term_subscribers_of_new_topic' ), 10, 4 );
+               add_action( 'bbp_new_reply', array( $this, 'notify_term_subscribers_of_new_reply' ), 10, 5 );
+       }
+
+       /**
+        * Handle a user subscribing to and unsubscribing from a topic tag.
+        *
+        * @param string $action The requested action to compare this function to
+        */
+       public static function term_subscribe_handler( $action = '' ) {
+               if ( ! bbp_is_subscriptions_active() ) {
+                       return false;
+               }
+
+               // Bail if the actions aren't meant for this function.
+               if ( ! in_array( $action, self::get_valid_actions() ) ) {
+                       return;
+               }
+
+               // Bail if no term id is passed.
+               if ( empty( $_GET['term_id'] ) ) {
+                       return;
+               }
+
+               // Get required data.
+               $user_id = get_current_user_id(); 
+               $term_id = intval( $_GET['term_id'] );
+               $term = get_term( $term_id );
+
+               // Check for empty term id.
+               if ( ! $term ) {
+                       bbp_add_error( 'wporg_bbp_subscribe_term_id', __( '<strong>ERROR</strong>: No term was found! Which term are you subscribing/unsubscribing to?', 'wporg' ) );
+
+               // Check for current user.
+               } elseif ( empty( $user_id ) ) {
+                       bbp_add_error( 'wporg_bbp_subscribe_logged_id', __( '<strong>ERROR</strong>: You must be logged in to do this!', 'wporg' ) );
+
+               // Check nonce.
+               } elseif ( ! bbp_verify_nonce_request( 'toggle-term-subscription_' . $user_id . '_' . $term_id ) ) {
+                       bbp_add_error( 'wporg_bbp_subscribe_nonce', __( '<strong>ERROR</strong>: Are you sure you wanted to do that?', 'wporg' ) );
+
+               // Check current user's ability to spectate.
+               } elseif ( ! current_user_can( 'spectate' ) ) {
+                       bbp_add_error( 'wporg_bbp_subscribe_permissions', __( '<strong>ERROR</strong>: You don\'t have permission to do this!', 'wporg' ) );
+               }
+
+               if ( bbp_has_errors() ) {
+                       return;
+               }
+
+               $is_subscribed = self::is_user_subscribed_to_term( $user_id, $term_id );
+               $success = false;
+
+               if ( true === $is_subscribed && 'wporg_bbp_unsubscribe_term' === $action ) {
+                       self::remove_user_subscription( $user_id, $term_id );
+               } elseif ( false === $is_subscribed && 'wporg_bbp_subscribe_term' === $action ) {
+                       self::add_user_subscription( $user_id, $term_id );
+               }
+
+               // Success!
+               if ( true === $success ) {
+                       $redirect = get_term_link( $term_id );
+                       bbp_redirect( $redirect );
+               } elseif ( true === $is_subscribed && 'wporg_bbp_subscribe_term' === $action ) {
+                       bbp_add_error( 'wporg_bbp_subscribe_user', __( '<strong>ERROR</strong>: There was a problem subscribing to that term!', 'wporg' ) );
+               } elseif ( false === $is_subscribed && 'wporg_bbp_unsubscribe_term' === $action ) {
+                       bbp_add_error( 'wporg_bbp_unsubscribe_user', __( '<strong>ERROR</strong>: There was a problem unsubscribing from that term!', 'wporg' ) );
+               }
+       }
+
+       /**
+        * Use the existing bbp_notify_forum_subscribers() to send out term subscriptions for new topics.
+        * Avoid duplicate notifications for forum subscribers through the judicious use of filters within
+        * the function.
+        *
+        * @param int $topic_id The topic id
+        * @param int $forum_id The forum id
+        * @param mixed $anonymous_data Array of anonymous user data
+        * @param int $topic_author The topic author id
+        */
+       public function notify_term_subscribers_of_new_topic( $topic_id, $forum_id,  $anonymous_data = false, $topic_author = 0 ) {
+               $terms = get_the_terms( $topic_id, 'topic-tag' );
+               if ( ! $terms ) {
+                       return;
+               }
+
+               foreach ( $terms as $term ) {
+                       $subscribers = $this->get_term_subscribers( $term->term_id );
+                       if ( $subscribers ) {
+                               $this->subscribers = array_unique( array_merge( $subscribers, $this->subscribers ) );
+                       }
+               }
+
+               // Get users who were already notified and exclude them.
+               $forum_subscribers = bbp_get_forum_subscribers( $forum_id, true );
+               if ( ! empty( $forum_subscribers ) ) {
+                       $this->subscribers = array_diff( $this->subscribers, $forum_subscribers );
+               }
+
+               if ( empty( $this->subscribers ) ) {
+                       return;
+               }
+
+               // Replace forum-specific messaging with term subscription messaging.
+               add_filter( 'bbp_forum_subscription_mail_message', array( $this, 'replace_forum_subscription_mail_message' ), 10, 4 );
+
+               // Replace forum subscriber list with term subscribers, avoiding duplicates.
+               add_filter( 'bbp_forum_subscription_user_ids', array( $this, 'add_term_subscribers_to_forum' ) );
+
+               // Actually notify our term subscribers.
+               bbp_notify_forum_subscribers( $topic_id, $forum_id );
+
+               // Remove filters.
+               remove_filter( 'bbp_forum_subscription_user_ids', array( $this, 'add_term_subscribers_to_forum' ) );
+               remove_filter( 'bbp_forum_subscription_mail_message', array( $this, 'replace_forum_subscription_mail_message' ) );
+       }
+
+       /**
+        * Temporarily replace the forum subscriber list with any unincluded term subscribers.
+        */
+       public function add_term_subscribers_to_forum( $users ) {
+               return array_diff( $this->subscribers, $users );
+       }
+
+       /**
+        * Replace the forum subscription message with term-specific messaging.
+        *
+        * @param string $message The message
+        * @param int $topic_id The topic id
+        * @param int $forum_id The forum id
+        * @param int $user_id 0
+        */
+       public function replace_forum_subscription_mail_message( $message, $topic_id, $forum_id, $user_id ) {
+               // Poster name.
+               $topic_author_name = bbp_get_topic_author_display_name( $topic_id );
+
+               remove_all_filters( 'bbp_get_topic_content' );
+
+               // Strip tags from text and set up message body.
+               $topic_content = strip_tags( bbp_get_topic_content( $topic_id ) );
+               $topic_url     = get_permalink( $topic_id );
+
+               $message = sprintf( __( '%1$s wrote:
+
+%2$s
+
+Topic Link: %3$s
+
+-----------
+
+You are receiving this email because you subscribed to a topic tag.
+
+Login and visit the topic to unsubscribe from these emails.', 'wporg' ),
+                       $topic_author_name,
+                       $topic_content,
+                       $topic_url
+               );
+
+               return $message;
+       }
+
+       /**
+        * Use the existing bbp_notify_topic_subscribers() to send out term subscriptions for replies.
+        * Avoid duplicate notifications for topic subscribers through the judicious use of filters within
+        * the function.
+        *
+        * @param int $reply_id The reply id
+        * @param int $topic_id The topic id
+        * @param int $forum_id The forum id
+        * @param mixed $anonymous_data
+        * @param int $reply_author
+        */
+       public function notify_term_subscribers_of_new_reply( $reply_id, $topic_id, $forum_id, $anonymous_data, $reply_author ) {
+               $terms = get_the_terms( $topic_id, 'topic-tag' );
+               if ( ! $terms ) {
+                       return;
+               }
+
+               foreach ( $terms as $term ) {
+                       $subscribers = $this->get_term_subscribers( $term->term_id );
+                       if ( $subscribers ) {
+                               $this->subscribers = array_unique( array_merge( $subscribers, $this->subscribers ) );
+                       }
+               }
+
+               // Get users who were already notified and exclude them.
+               $topic_subscribers = bbp_get_topic_subscribers( $topic_id, true );
+               if ( ! empty( $topic_subscribers ) ) {
+                       $this->subscribers = array_diff( $this->subscribers, $topic_subscribers );
+               }
+
+               if ( empty( $this->subscribers ) ) {
+                       return;
+               }
+
+               // Replace topic-specific messaging with term subscription messaging.
+               add_filter( 'bbp_subscription_mail_message', array( $this, 'replace_topic_subscription_mail_message' ), 10, 3 );
+
+               // Replace forum subscriber list with term subscribers, avoiding duplicates.
+               add_filter( 'bbp_topic_subscription_user_ids', array( $this, 'add_term_subscribers_to_topic' ) );
+
+               // Actually notify our term subscribers.
+               bbp_notify_topic_subscribers( $reply_id, $topic_id, $forum_id );
+
+               // Remove filters.
+               remove_filter( 'bbp_topic_subscription_user_ids', array( $this, 'add_term_subscribers_to_topic' ) );
+               remove_filter( 'bbp_subscription_mail_message', array( $this, 'replace_topic_subscription_mail_message' ) );
+       }
+
+       /**
+        * Temporarily replace the forum subscriber list with any unincluded term subscribers.
+        */
+       public function add_term_subscribers_to_topic( $users ) {
+               return array_diff( $this->subscribers, $users );
+       }
+
+       /**
+        * Replace the topic subscription message with term-specific messaging.
+        *
+        * @param string $message The message
+        * @param int $reply_id The reply id
+        * @param int $topic_id The topic id
+        */
+       public function replace_topic_subscription_mail_message( $message, $reply_id, $topic_id ) {
+               // Poster name.
+               $reply_author_name = bbp_get_reply_author_display_name( $reply_id );
+
+               remove_all_filters( 'bbp_get_reply_content' );
+
+               // Strip tags from text and set up message body.
+               $reply_content = strip_tags( bbp_get_reply_content( $reply_id ) );
+               $reply_url = bbp_get_reply_url( $reply_id );
+
+               $message = sprintf( __( '%1$s wrote:
+
+%2$s
+
+Reply Link: %3$s
+
+-----------
+
+You are receiving this email because you subscribed to a topic tag.
+
+Login and visit the topic to unsubscribe from these emails.', 'wporg' ),
+                       $reply_author_name,
+                       $reply_content,
+                       $reply_url
+               );
+
+               return $message;
+       }
+
+       /**
+        * Get the user's subscriptions for a given taxonomy; defaults to 'topic-tag'.
+        *
+        * @param $user_id int The user id
+        * @param $taxonomy string Optional. The taxonomy
+        * @return array|bool Results if user has subscriptions, otherwise false
+        */
+       public function get_user_taxonomy_subscriptions( $user_id = 0, $taxonomy = 'topic-tag' ) {
+               $retval = false;
+
+               if ( empty( $user_id ) ) {
+                       return false;
+               }
+
+               $terms = get_terms( array(
+                       'taxonomy'   => $taxonomy,
+                       'meta_key'   => self::META_KEY,
+                       'meta_value' => $user_id,
+               ) );
+
+               if ( ! empty( $terms ) ) {
+                       $retval = $terms;
+               }
+               return apply_filters( 'wporg_bbp_get_user_taxonomy_subscriptions', $retval, $user_id, $taxonomy );
+       }
+
+       /**
+        * Get the user IDs of users subscribed to a given term.
+        *
+        * @param $term_id int The term id
+        * @return array|bool Results if the term is valid, otherwise false
+        */
+       public static function get_term_subscribers( $term_id = 0 ) {
+               if ( empty( $term_id ) ) {
+                       return false;
+               }
+
+               $subscribers = wp_cache_get( 'wporg_bbp_get_term_subscribers_' . $term_id, 'bbpress_users' );
+               if ( false === $subscribers ) {
+                       $subscribers = get_term_meta( $term_id, self::META_KEY );
+                       wp_cache_set( 'wporg_bbp_get_term_subscribers_' . $term_id, $subscribers, 'bbpress_users' );
+               }
+               return apply_filters( 'wporg_bbp_get_term_subscribers', $subscribers, $term_id );
+       }
+
+       /**
+        * Is the user subscribed to a term?
+        *
+        * @param $user_id int The user id
+        * @param $term_id int The term id
+        * @return bool True if the user is subscribed, otherwise false
+        */
+       public static function is_user_subscribed_to_term( $user_id = 0, $term_id = 0 ) {
+               if ( empty( $user_id ) || empty( $term_id ) ) {
+                       return false;
+               }
+
+               $subscriptions = self::get_term_subscribers( $term_id );
+               if ( in_array( $user_id, $subscriptions ) ) {
+                       return true;
+               }
+
+               return false;
+       }
+
+       /**
+        * Add a term to a user's subscriptions.
+        *
+        * @param $user_id int The user id
+        * @param $term_id int The term id
+        * @return bool False if invalid, otherwise true 
+        */
+       public static function add_user_subscription( $user_id = 0, $term_id = 0 ) {
+               if ( empty( $user_id ) || empty( $term_id ) ) {
+                       return false;
+               }
+
+               if ( ! self::is_user_subscribed_to_term( $user_id, $term_id ) ) {
+                       add_term_meta( $term_id, self::META_KEY, $user_id ); 
+                       wp_cache_delete( 'wporg_bbp_get_term_subscribers_' . $term_id, 'bbpress_users' );
+               }
+               do_action( 'wporg_bbp_add_user_term_subscription', $user_id, $term_id );
+
+               return true;
+       }
+
+       /**
+        * Remove a term from a user's subscriptions.
+        *
+        * @param $user_id int The user id
+        * @param $term_id int The term id
+        * @return bool False if invalid, otherwise true
+        */
+       public static function remove_user_subscription( $user_id = 0, $term_id = 0 ) {
+               if ( empty( $user_id ) || empty( $term_id ) ) {
+                       return false;
+               }
+
+               if ( self::is_user_subscribed_to_term( $user_id, $term_id ) ) {
+                       delete_term_meta( $term_id, self::META_KEY, $user_id );
+                       wp_cache_delete( 'wporg_bbp_get_term_subscribers_' . $term_id, 'bbpress_users' );
+               }
+               do_action( 'wporg_bbp_remove_user_term_subscription', $user_id, $term_id );
+
+               return true;
+       }
+
+       /**
+        * Create the link for subscribing to/unsubscribing from a given term.
+        *
+        * @param string $action The action
+        * @param int $user_id The user id
+        * @param int $term_id The term id
+        * @return string
+        */
+       public static function get_subscription_link( $args = array() ) {
+               if ( ! current_user_can( 'spectate' ) ) {
+                       return false;
+               }
+
+               $r = bbp_parse_args( $args, array(
+                       'user_id'     => get_current_user_id(),
+                       'term_id'     => 0,
+                       'subscribe'   => esc_html__( 'Subscribe to this topic tag', 'wporg' ),
+                       'unsubscribe' => esc_html__( 'Unsubscribe from this topic tag', 'wporg' ),
+               ), 'get_term_subscription_link' );
+               if ( empty( $r['user_id'] ) || empty( $r['term_id'] ) ) {
+                       return false;
+               }
+               $user_id = $r['user_id'];
+               $term_id = $r['term_id'];
+
+               $term = get_term( $term_id );
+               if ( ! $term ) {
+                       return false;
+               }
+
+               if ( self::is_user_subscribed_to_term( $user_id, $term_id ) ) {
+                       $text = $r['unsubscribe'];
+                       $query_args = array( 'action' => 'wporg_bbp_unsubscribe_term', 'term_id' => $term_id );
+               } else {
+                       $text = $r['subscribe'];
+                       $query_args = array( 'action' => 'wporg_bbp_subscribe_term', 'term_id' => $term_id );
+               }
+
+               $permalink = get_term_link( $term_id );
+
+               $url = esc_url( wp_nonce_url( add_query_arg( $query_args, $permalink ), 'toggle-term-subscription_' . $user_id . '_' . $term_id ) );
+               return sprintf( "<div class='wporg-bbp-term-subscription'><a href='%s'>%s</a></div>",
+                       $url,
+                       esc_html( $text ) );
+       }
+
+       public static function get_valid_actions() {
+               return array(
+                       'wporg_bbp_subscribe_term',
+                       'wporg_bbp_unsubscribe_term',
+               );
+       }
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-bbp-term-subscription/inc/class-plugin.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginswporgbbptermsubscriptionwporgbbptermsubscriptionphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-bbp-term-subscription/wporg-bbp-term-subscription.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-bbp-term-subscription/wporg-bbp-term-subscription.php                              (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-bbp-term-subscription/wporg-bbp-term-subscription.php        2016-07-25 19:51:31 UTC (rev 3719)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,27 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * Plugin Name: bbPress: Term Subscription
+ * Description: Allow users to subscribe to topic tags. Provides foundation for generic taxonomy term subscriptions.
+ * Version:     1.0
+ * Author:      WordPress.org
+ * Author URI:  http://wordpress.org/
+ * License:     GPLv2 or later
+ *
+ * Based on Subscribe to Tags by Otto.
+ */
+
+namespace WordPressdotorg\Forums\Term_Subscription;
+
+// Store the root plugin file for usage with functions which use the plugin basename
+define( __NAMESPACE__ . '\PLUGIN_FILE', __FILE__ );
+
+// Includes
+include( dirname( __FILE__ ) . '/inc/class-plugin.php' );
+
+// Instantiate the Plugin
+Plugin::get_instance();
+
+// Easy access for templates
+function get_subscription_link( $term_id ) {
+       return Plugin::get_subscription_link( array( 'term_id' => $term_id ) );
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-bbp-term-subscription/wporg-bbp-term-subscription.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span></div>

</body>
</html>