Home/ Journal Bens Projects Binary Moon Archives About Ben Gillbanks Subscribe to Binary Moon Updates

Subscribe to Binary Moon Website Updates, it's Free and Easy to Stay in Touch

Search Binary Moon

Search Binary Moon

WordPress Tip: Modifying pluggable.php – How To Disable Emails

Ever heard the saying, 'the more I learn the less I know'? I often feel that way with WordPress! I like to think that my knowledge of WordPress is above average, but I keep learning new things, and they keep on changing it. My most recent 'discovery' is pluggable.php.

Pluggable.php is a php file full of a variety of WordPress functions. I was aware of its existence but until recently I didn't understand it's significance. The key thing that makes pluggable.php useful is that all the functions are wrapped in 'if function_exists' calls. This means that you can plug-in (hence the name I guess) your own versions to override the default WordPress functionality.

The reason I found out about this is because I was searching for a way to stop myself from receiving emails when a new user signed up for WordPress Vote. When you have a public site you don't always want to receive these notifications and so I headed over to Twitter and got the following message from mfields.

The function in question is wp_new_user_notification. In order to stop the emails all I have to do is create a new function with the same name inside my functions.php. If I do this then, because the function already exists, the built-in functionality doesn't get executed. It couldn't be easier.

Functions

Reading through pluggable.php there are a few different functions in there that it may be useful to override at some time and I have included the ones I find most interesting below. You can read the full list of functions on the pluggable.php code browser on WordPress trac.

  • wp_new_user_notification and wp_password_change_notification - these are the reason I first looked into pluggable.php. You can add blank functions to remove the notifications or you could change the email message or email destination to make them more useful.
  • wp_generate_password - create your own password generation algorithm
  • get_avatar - change the avatar system to use services other than Gravatar (are there any others?)

Your Ideas?

Pluggable.php isn't the solution to everything however, as with many things, this is another string to add to your bow. It's certainly not going to solve all of your WordPress problems, but if there's something you are not sure about then it could be worth checking out.

Had you looked at pluggable.php before? I'd be interested to know what you are overriding and why.

10 Responses to “WordPress Tip: Modifying pluggable.php – How To Disable Emails” Leave a reply ›

Leave a Reply

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

About me

About BenMy name is Ben Gillbanks. I'm a lover of Video Games, WordPress, Web Development and everything in between.

I have been working on the internet since 1998, and working with computers even longer. I am a hardcore Nintendo fanboy and have owned most of their consoles at one stage or another.

Read more about me on my about page.


Follow Me


Random Link-outs

  • WPVote WordPress voting and article submission community website
  • Front Row Reviews News and Reviews for the latest movies
  • Totebo Flash games with monkeys
  • CodeAid Web development hints and tips
The Binary Network links to all my websites
bengillbanks.co.uk - Ben Gillbanks

Ben Gillbanks

All my websites under 1 roof, the easiest way to find out what I do

Pro Theme Design - premium WordPress themes

Pro Theme Design

Premium WordPress themes by web design pros (erm... that includes me)

Binary Joy - gaming news and reviews

Binary Joy

Gaming news and reviews

Binary Sun - play free online games

Binary Sun

Play and download free and paid games (many made by me)

Gaming Angel - download and play games online

Gaming Angel

Stacks of shareware games, free to try and cheap to buy