The MU forums have moved to WordPress.org

benefit of class structure for plugins? (1 post)

  1. fleshins
    Member
    Posted 14 years ago #

    Other than to avoid naming collisions with other plugins, is there any other benefit to using a class structure for plugins as opposed to just referencing plugin-specific functions directly?

    e.g.
    $class_instance = new class1;
    $class_instance->function1();

    class class1 {
    function function1 {
    add_action('some_hook', array(&$this, 'function2'));
    }
    function function2 {
    // do something
    }
    }

About this Topic

  • Started 14 years ago by fleshins