RyanBayne / TwitchPress

TwitchPress is a system of plugins that combines the power of Twitch.tv with WordPress
http://twitchpress.wordpress.com
GNU General Public License v3.0
12 stars 6 forks source link

Condense Class Objects #245

Closed RyanBayne closed 6 years ago

RyanBayne commented 6 years ago

This is an approach I did consider already but some of the classes we're not going to work in this approach. That was way back and I'd like to revisit adding class objects to the core instance and make the project easier to work with.

This task is about exploring how will it's going to work in my current design.

We also need to look at classes with extensions being added to the core instance.

The goal is to reduce how often we create new objects and seriously simplify development.

/ @Init */ function init() {

    ob_start();

    require_once um_path . 'core/um-api.php';
    require_once um_path . 'core/um-rewrite.php';
    require_once um_path . 'core/um-setup.php';

    /* initialize UM */
    $this->api = new UM_REST_API();
    $this->rewrite = new UM_Rewrite();
    $this->setup = new UM_Setup();

    $this->options = get_option('um_options');
RyanBayne commented 6 years ago

This work has begun and will be systematic rather than doing it as one big job.