Making WordPress.org

Changeset 4009


Ignore:
Timestamp:
09/08/2016 09:27:47 PM (10 years ago)
Author:
jmdodd
Message:

Support Forums: Add subscription objects for plugins and themes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-support-compat.php

    r3999 r4009  
    1818                        // Topic resolution modifications.
    1919                        add_filter( 'wporg_bbp_topic_resolution_is_enabled_on_forum', array( $this, 'is_enabled_on_forum' ), 10, 2 );
     20
     21                        // Load plugin/theme subscriptions.
     22                        add_action( 'plugins_loaded', array( $this, 'load_compat_subscriptions' ), 9 );
    2023
    2124                        $this->loaded = true;
     
    9699        }
    97100
     101        /**
     102         * Enable theme and plugin subscriptions.
     103         */
     104        public function load_compat_subscriptions() {
     105                if ( class_exists( 'WordPressdotorg\Forums\Term_Subscription\Plugin' ) ) {
     106                        Plugin::get_instance()->plugin_subscriptions = new Term_Subscription\Plugin( array(
     107                                'taxonomy' => 'topic-plugin',
     108                                'labels'   => array(
     109                                        'receipt' => __( 'You are receiving this email because you are subscribed to a plugin.', 'wporg-forums' ),
     110                                ),
     111                        ) );
     112                        Plugin::get_instance()->theme_subscriptions = new Term_Subscription\Plugin( array(
     113                                'taxonomy' => 'topic-theme',
     114                                'labels'   => array(
     115                                        'receipt' => __( 'You are receiving this email because you are subscribed to a theme.', 'wporg-forums' ),
     116                                ),
     117                        ) );
     118                }
     119        }
     120
    98121        public static function get_compat_forums() {
    99122                return array( Plugin::PLUGINS_FORUM_ID, Plugin::THEMES_FORUM_ID, Plugin::REVIEWS_FORUM_ID );
Note: See TracChangeset for help on using the changeset viewer.