Making WordPress.org

Changeset 10420


Ignore:
Timestamp:
10/30/2020 06:47:16 AM (4 years ago)
Author:
dd32
Message:

Trac Notifications plugin: Add extra getters for Trac details.

This removes some now unused code too.

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/trac-notifications
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/trac-notifications/trac-notifications-db.php

    r10382 r10420  
    242242     *  - Removes Subscriptions & notification prefs
    243243     *  - Removes user Trac preferences
    244      * 
     244     *
    245245     * The $to user doesn't have to be unique, but associated user-data (NOT content) of that user will be lost.
    246      * 
     246     *
    247247     * @param string $from The user login of the user to anonymize.
    248248     * @param string $to   The new user login placeholder for the user, should be unique.
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/trac-notifications/trac-notifications.php

    r9353 r10420  
    1111
    1212    protected $trac;
     13    protected $api;
    1314    protected $components;
    1415
     
    2728
    2829        $this->trac = $trac;
    29 
    30         if ( 'core' === $trac && function_exists( 'add_db_table' ) ) {
    31             $tables = array( 'ticket', '_ticket_subs', '_notifications', 'ticket_change', 'component', 'milestone', 'ticket_custom' );
    32             foreach ( $tables as $table ) {
    33                 add_db_table( 'trac_' . $trac, $table );
    34             }
    35         }
    36 
    37         $this->api = new Trac_Notifications_HTTP_Client( $this->trac_url() . '/wpapi', TRAC_NOTIFICATIONS_API_KEY );
     30        $this->api  = new Trac_Notifications_HTTP_Client( $this->trac_url() . '/wpapi', TRAC_NOTIFICATIONS_API_KEY );
    3831
    3932        if ( 'core' === $trac ) {
     
    4942    function trac_url() {
    5043        return 'https://' . $this->trac . '.trac.wordpress.org';
     44    }
     45
     46    function trac_name() {
     47        return ucfirst( $this->trac );
     48    }
     49
     50    function trac_api() {
     51        if ( ! $this->trac || ! $this->api ) {
     52            return false;
     53        }
     54
     55        return $this->api;
    5156    }
    5257
Note: See TracChangeset for help on using the changeset viewer.