Anonymous & Global objects #29

Closed
tomjn opened this Issue Apr 10, 2013 · 2 comments

Comments

Projects
None yet
2 participants

tomjn commented Apr 10, 2013

Say I use this boilerplate, and add a filter to modify the menu order.

2 months later, developers Alice and Bob arrive, and notice an issue with my filter. So they need to remove my filter, but how?

I'd suggest code such as this to instantiate the main object

if ( PluginName::start_me() )
    add_action(
        'wp_loaded',
        array ( PluginName::get_instance(), 'plugin_setup' )
    );
Contributor

tommcfarlin commented Apr 10, 2013

I'm going to be doing something very similar to this in the next version of the plugin.

Thanks for bringing this up - I'm going to keep the issue open as a reminde.r

tommcfarlin was assigned Apr 10, 2013

Contributor

tommcfarlin commented May 8, 2013

Implemented the singleton pattern as a first step in a solution for this issue.

tommcfarlin closed this May 8, 2013

tommcfarlin removed their assignment Dec 29, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment