Replacing a function in pluggable.php
-
Hello,
im trying to replace a function in pluggable.php, where i can define some options to use instead of the predefined text.
It is the wp_new_user_notification function, and i know a lot of people ask on here about changing the text etc, and i know there is already the custom log in plugin that can change this, but i know people have had problems with it, so i thought i’d have a go at writing my first plugin.
i keep getting a fatal error though, and i know that the offending code is this bit, as without it, the rest of the plugin functions fine.
function wp_new_user_notification($user_id, $plaintext_pass = '') { $user = new WP_User($user_id); $user_login = stripslashes($user->user_login); $user_email = stripslashes($user->user_email); $message = sprintf(__('New user registration on your blog %s:'), get_option('blogname')) . "\r\n\r\n"; $message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n"; $message .= sprintf(__('E-mail: %s'), $user_email) . "\r\n"; @wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Registration'), get_option('blogname')), $message); if ( empty($plaintext_pass) ) return; $message = sprintf(__('Hi %s'), $user_login) . "\r\n"; $message .= $emailOptions('newuseremailtext') . "\r\n"; $message .= sprintf(__('Username: %s'), $user_login) . "\r\n"; $message .= sprintf(__('Password: %s'), $plaintext_pass) . "\r\n"; wp_mail($user_email, $emailOptions('newuseremailsubject'), get_option('blogname')), $message); }
I have $emailOptions defined to be get_option, this is after following the devlounge plugin series.
as it is my first plugin, i cant see what is wrong, and this function hasnt really had much changed, so its annoying that i cant sort it!!
thanks in advance
- The topic ‘Replacing a function in pluggable.php’ is closed to new replies.