"core_files_loaded" action cannot be used... get rid of it!
|Reported by:||markjaquith||Owned by:||markjaquith|
|Component:||Administration||Keywords:||bg|has-patch bg|commit deprecated hook action core_files_loaded|
Skeltoac pointed out something to me in #wordpress: the "core_files_loaded" action hook is useless. It happens immediately after functions are loaded (so right after add_action() becomes available), but before my-hacks.php and plugins are loaded. Furthermore, plugins are loaded right afterwards... so there's no need for a hook there... a plugin can just run its code "live." I've commented the action out (no harm, nothing can use it, and no one is even trying) and marked it as deprecated.
skeltoac: MarkJaquith: What kind of person would use the "core_files_loaded" hook? skeltoac: That's the hook that comes just before my-hacks and plugins. MarkJaquith: skeltoac: hrm... caching? MarkJaquith: advanced-cache.php thing, maybe skeltoac: MarkJaquith: cache files are loaded before functions.php, so there isn't even a function "add_action" by then. MarkJaquith: skeltoac: hm... so basically the thing is useless. The only thing that could use it is WP, internally, and what's the point? skeltoac: Must be only for core stuff, or else serious core hackers. MarkJaquith: yeah, but how would you implement it? you'd have to edit core code, right? io_error: skeltoac: I might use core_files_loaded skeltoac: io_error: How? skeltoac: It's not even used by any core files. MarkJaquith: can't use it from a plugin, can't use it from pluggable-functions.php, can't use it from index.php or wp-config.php skeltoac: You'd have to manipulate $wp_filter without the help of add_action and you'd have to do it in a cache file or a db replacement file. MarkJaquith: not recommended to work around the helper functions like that... MarkJaquith: my-hacks.php is right after, and then plugins follow... you could just run the command live in the plugin. skeltoac: Yeah, I don't mean to confuse anyone, I just wondered if there was any conceivable use for that hook. It suddenly struck me that it's in a strange place. MarkJaquith: skeltoac: you're right. It's useless. I'm going to mark it as deprecated.