Title: Hooking a Pluggable Function
Last modified: August 19, 2016

---

# Hooking a Pluggable Function

 *  [radiok](https://wordpress.org/support/users/radiok/)
 * (@radiok)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/hooking-a-pluggable-function/)
 * I hate to ask stupid questions, and I pray this isn’t one… Regardless, I am trying
   to hook the random_password filter in the pluggable wp_generate_password function.
   I spent a good long time trying to figure this out, and recently realized what
   I thought was my problem. I was adding the filter in the constructor of my plugin,
   which occurs before wp_generate_password exists. Now, as far as I know, you could
   add a filter for anything at anytime, and it only matters what’s hung on that
   hook when the apply_filter function is run. Well, better safe then sorry I say,
   so I added a plugins_loaded hook and moved my random_password in there so that
   my hook would safely be defined after pluggable was loaded. Still no dice! I’m
   losing my mind! Can anyone assist?

The topic ‘Hooking a Pluggable Function’ is closed to new replies.

## Tags

 * [pluggable.php](https://wordpress.org/support/topic-tag/pluggable-php/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 0 replies
 * 1 participant
 * Last reply from: [radiok](https://wordpress.org/support/users/radiok/)
 * Last activity: [15 years, 2 months ago](https://wordpress.org/support/topic/hooking-a-pluggable-function/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
