Making WordPress.org


Ignore:
Timestamp:
11/01/2015 06:33:25 PM (10 years ago)
Author:
nacin
Message:

Trac Notifications: Fewer cross dependencies.

File:
1 edited

Legend:

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

    r2022 r2023  
    2424        }
    2525
    26         require __DIR__ . '/trac-notifications-db.php';
     26        spl_autoload_register( array( $this, 'autoload' ) );
    2727
    2828        if ( function_exists( 'add_db_table' ) ) {
     
    4444        add_action( 'template_redirect', array( $this, 'action_template_redirect' ) );
    4545        add_shortcode( 'trac-notifications', array( $this, 'notification_settings_page' ) );
     46    }
     47
     48    function autoload( $class ) {
     49        $class = strtolower( $class );
     50        if ( 0 === strpos( $class, 'trac_notifications_' ) ) {
     51            require __DIR__ . '/' . str_replace( '_', '-', $class ) . '.php';
     52        }
    4653    }
    4754
Note: See TracChangeset for help on using the changeset viewer.