How can I make updates a public plugin of mine without breaking the plugin for all existing users.
Firstly, I'd like to change the main plugin's class/namespace, because I'd like it to be similar to other classes in the plugin that it extends.
So I'd like to change
class some_class(){}
to
class Some_Class(){}
Secondly, the whole class is instantiated and saved in a global variable.
global $some_class;
$some_class = new some_class();
Somewhere on here I saw a good example of how to instantiate a class without a global (can't find it now of course, #doh). The global can be used by users to add/remove a couple of templates. Is there a way to get rid of the global without completely breaking the themes of people who might be using it to manipulate the templates?
Thirdly, related to above, my main plugin file has gotten really big and I'd like to split it up into pieces for my own sanity. However, if the some_templates()
method is in the some_class()
is it possible to move it to the front_end_class()
without breaking things for users?
For example
To unhook an action in my plugin
function remove_method(){
global $some_class;
remove_action('wp_head', array($someclass, 'some_templates'));
}
add_action('init','remove_method');
Can the class structure and global variable setup be adjusted without breaking this. How can I alert people that this has changed? _doing_it_wrong()
?
Finally, I've been saving some post meta as "yes" versus "no" in lieu of a boolean. Does it make sense to change this?