Closed paulgibbs closed 11 years ago
How does this look? https://github.com/Automattic/media-explorer/commit/5c23906ae96d87acb559472cb640d002698fbf5e (hooks
branch)
We're now firing a emm_init
action on the plugins_loaded
hook (actually, emm_loaded
might be a better name here) and then only loading the services (via the existing emm_services
filter) on the init
hook.
Can we filter the tabs and labels, add an action in the load method to enqueue/sequence JavaScript and CSS, etc? Somehow fire these hooks from the base class and suffix the class name ala the admin load actions. I'm thinking of people wanting to alter services, rather than add their own. In a motorway carpark, so guessing these possibility without decent code access. :)
@johnbillion - looks like that's on the right track.
@simonwheatley - yes we should action/filterify all the things.
I've created an action for enqueuing scripts in ca27f8a402d2dda89ff61dfed86554ef54d13c0c and filters for labels and tabs in 98556049f306fa552ca06e9d39882a3c47ee3f6d on hooks
branch.
There are 0 actions and only a few filters for third party devs to use to extend the plugin. We should audit the code and add actions and filters where appropriate.
An example of where this will help is https://github.com/Automattic/media-explorer/blob/master/extended-media-manager.php#L29 -- per the documentation on http://vip.wordpress.com/documentation/extending-media-explorer/, we say:
Obviously this can't be done on WordPress.com and most sites, and at the very least it adds a manual step to the installation of all plugins that extend the media manager.
Suggest something like this: