Making WordPress.org


Ignore:
Timestamp:
11/29/2015 04:34:17 AM (8 years ago)
Author:
nacin
Message:

Trac: Spoke too soon, revert [2140]

File:
1 edited

Legend:

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

    r2140 r2141  
    2828        $this->trac = $trac;
    2929
    30         $this->api = new Trac_Notifications_HTTP_Client( $this->trac_url() . '/wpapi', TRAC_NOTIFICATIONS_API_KEY );
     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        if ( 'core' === $trac ) {
     38            $this->api = new Trac_Notifications_DB( $GLOBALS['wpdb'] );
     39        } else {
     40            $this->api = new Trac_Notifications_HTTP_Client( $this->trac_url() . '/wpapi', TRAC_NOTIFICATIONS_API_KEY );
     41        }
    3142
    3243        if ( 'core' === $trac ) {
Note: See TracChangeset for help on using the changeset viewer.