Title: [Plugin: Theme My Login] call_user_func_array Error
Last modified: August 20, 2016

---

# [Plugin: Theme My Login] call_user_func_array Error

 *  Resolved [ctruelson](https://wordpress.org/support/users/ctruelson/)
 * (@ctruelson)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-theme-my-login-call_user_func_array-error/)
 * Hello! I am getting this error right below the password fields:
 * > call_user_func_array() [function.call-user-func-array]: First argument is expected
   > to be a valid callback, ‘Array’ was given in /html/wp-includes/plugin.php on
   > line 405
 * Does anyone have any idea what this means or how to fix it?
    Everything looks
   fine on the admin side when I disable the profile module.
 * Thanks in advance!
    Charles
 * [http://wordpress.org/extend/plugins/theme-my-login/](http://wordpress.org/extend/plugins/theme-my-login/)

Viewing 15 replies - 1 through 15 (of 17 total)

1 [2](https://wordpress.org/support/topic/plugin-theme-my-login-call_user_func_array-error/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/plugin-theme-my-login-call_user_func_array-error/page/2/?output_format=md)

 *  Plugin Author [Jeff Farthing](https://wordpress.org/support/users/jfarthing84/)
 * (@jfarthing84)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-theme-my-login-call_user_func_array-error/#post-2545748)
 * Where? On the registration form or themed profile? Or both?
 *  Thread Starter [ctruelson](https://wordpress.org/support/users/ctruelson/)
 * (@ctruelson)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-theme-my-login-call_user_func_array-error/#post-2545772)
 * Hey Jeff, thanks for getting back so quickly.
 * The error is occurring on the themed profile, underneath the “change password”
   fields. I’m not using Theme My Profile for user registration; I’m using the Gravity
   Forms User Registration Plugin.
 * C
 *  Plugin Author [Jeff Farthing](https://wordpress.org/support/users/jfarthing84/)
 * (@jfarthing84)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-theme-my-login-call_user_func_array-error/#post-2545808)
 * Wait – are you using Theme My Login or Theme My Profile?
 *  Thread Starter [ctruelson](https://wordpress.org/support/users/ctruelson/)
 * (@ctruelson)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-theme-my-login-call_user_func_array-error/#post-2545823)
 * I’m sorry, I am using Theme My Login with the “Themed Profile” module.
 * C
 *  Thread Starter [ctruelson](https://wordpress.org/support/users/ctruelson/)
 * (@ctruelson)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-theme-my-login-call_user_func_array-error/#post-2545839)
 * I just tried using Theme My Profile, with the “Themed Profiles” module disabled
   on Theme My Login. I am getting the same error.
 * What I also realized is that after clicking the “Update Profile” button, I am
   getting a warning page with several warnings, which read:
 * > Warning: Cannot modify header information – headers already sent by (output
   > started at /home/content/80/8787380/html/wp-includes/plugin.php:405) in /home/
   > content/80/8787380/html/wp-includes/pluggable.php on line 686
 * Thanks for your help.
 *  Plugin Author [Jeff Farthing](https://wordpress.org/support/users/jfarthing84/)
 * (@jfarthing84)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-theme-my-login-call_user_func_array-error/#post-2545845)
 * Please, don’t use Theme My Profile – it is no longer supported.
 * Have you created any of your own functions, using _theme-my-login-custom.php_
   or your theme’s _functions.php_?
 *  Thread Starter [ctruelson](https://wordpress.org/support/users/ctruelson/)
 * (@ctruelson)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-theme-my-login-call_user_func_array-error/#post-2545856)
 * I have added functions to my theme.
 * I am hiding the “Admin Bar” for logged in users with this function:
 * > add_filter( ‘show_admin_bar’, ‘__return_false’ );
 * I am also showing several additional fields with user meta, with the following:
 * >  add_action( ‘show_user_profile’, ‘my_show_extra_profile_fields’ );
   >  add_action(‘
   > edit_user_profile’, ‘my_show_extra_profile_fields’ ); function my_show_extra_profile_fields(
   > $user ) { ?>
 * For each additional field being displayed on the profile, I am using the following:
 * > <?php echo esc_attr( get_the_author_meta( ‘cell_phone’, $user->ID ) ); ?>
 * I’ve also added a few custom navigation menus.
 * I haven’t added anything to the theme-my-login-custom.php file.
 * Another plugin that affects the profile is “Simple Local Avatar” which adds the
   ability for users to upload an avatar. I deactivated it to see if that was the
   problem, but nothing happened.
 * One thing I noticed is when I remove the following code:
 * > <?php do_action( ‘show_user_profile’, $profileuser ); ?>
 * …the **call_user_func_array** error goes away.
    However the **Warning: Cannot
   modify header information** error is still there after submitting.
 * Thanks Jeff,
    Charles
 *  Plugin Author [Jeff Farthing](https://wordpress.org/support/users/jfarthing84/)
 * (@jfarthing84)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-theme-my-login-call_user_func_array-error/#post-2545859)
 * So, it sounds like it has something to do with the functions you added. If you
   remove your actions:
 *     ```
       add_action( 'show_user_profile', 'my_show_extra_profile_fields' );
       add_action( 'edit_user_profile', 'my_show_extra_profile_fields' );
       ```
   
 * Does it go away?
 *  Thread Starter [ctruelson](https://wordpress.org/support/users/ctruelson/)
 * (@ctruelson)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-theme-my-login-call_user_func_array-error/#post-2545861)
 * It does! Thank you. What do you think I should do to keep those custom fields
   in there?
 * Also, the form submission error is still there. Here’s the submission error:
 * > Warning: call_user_func_array() [function.call-user-func-array]: First argument
   > is expected to be a valid callback, ‘Array’ was given in /html/wp-includes/
   > plugin.php on line 405
   > Warning: Cannot modify header information – headers already sent by (output
   > started at /html/wp-includes/plugin.php:405) in /html/wp-includes/pluggable.
   > php on line 866
 * I really appreciate your help, thanks Jeff.
    Charles
 *  Thread Starter [ctruelson](https://wordpress.org/support/users/ctruelson/)
 * (@ctruelson)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-theme-my-login-call_user_func_array-error/#post-2545862)
 * Sorry Jeff, I lied — I had `<?php do_action( 'show_user_profile', $profileuser);?
   >` commented out. Removing those actions didn’t do anything besides remove the
   custom fields I had on the profile.
 *  Plugin Author [Jeff Farthing](https://wordpress.org/support/users/jfarthing84/)
 * (@jfarthing84)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-theme-my-login-call_user_func_array-error/#post-2545903)
 * Something, somewhere is improperly passing an array instead of a function to 
   one of the action hooks.
 *  [codex73](https://wordpress.org/support/users/codex73/)
 * (@codex73)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-theme-my-login-call_user_func_array-error/#post-2545918)
 * Jeff, After searching for a solution, I stumbled on your comment “improperly 
   passing an array”. Well, that was it!
 * I going through some old tutorial where it’s using a class and referencing the
   hook like this:
 * `
    add_action('admin_menu', array(&$objectname,'pluginname_admin_actions'), 1);
 * I’ve broken the class into inline procedural functions and passed only a string
   and it works great.
 * How could I use a class instead?
 * Any particular way to reference the function?
 * I tried `$objectname->functionaname()`
 * but no good…. 🙁
 *  [codex73](https://wordpress.org/support/users/codex73/)
 * (@codex73)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-theme-my-login-call_user_func_array-error/#post-2545919)
 * Found this good article. [Writing a WordPress Plugin Using Classes](http://w3prodigy.com/web-production/behind-wordpress/php-classes-wordpress-plugin/)
 * Haven’t tried the code, but it looks good.
 *  Thread Starter [ctruelson](https://wordpress.org/support/users/ctruelson/)
 * (@ctruelson)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/plugin-theme-my-login-call_user_func_array-error/#post-2545922)
 * Any idea of what I can search for in my files to try and find the culprit? Or
   should I just try deactivating plugins with trial and error?
 *  [codex73](https://wordpress.org/support/users/codex73/)
 * (@codex73)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/plugin-theme-my-login-call_user_func_array-error/#post-2545923)
 * Hey Guys, sorry I wasn’t referring to Jeff’s plugin with my comment, but to my
   own plugin. I looked to the repo, but it has lots of files to go through. [@ctruelson](https://wordpress.org/support/users/ctruelson/)
   If you leave only this plugin enabled and disable the others, will it still break?

Viewing 15 replies - 1 through 15 (of 17 total)

1 [2](https://wordpress.org/support/topic/plugin-theme-my-login-call_user_func_array-error/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/plugin-theme-my-login-call_user_func_array-error/page/2/?output_format=md)

The topic ‘[Plugin: Theme My Login] call_user_func_array Error’ is closed to new
replies.

 * ![](https://ps.w.org/theme-my-login/assets/icon-256x256.png?rev=1891232)
 * [Theme My Login](https://wordpress.org/plugins/theme-my-login/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/theme-my-login/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/theme-my-login/)
 * [Active Topics](https://wordpress.org/support/plugin/theme-my-login/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/theme-my-login/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/theme-my-login/reviews/)

 * 17 replies
 * 4 participants
 * Last reply from: [snavon](https://wordpress.org/support/users/snavon/)
 * Last activity: [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-theme-my-login-call_user_func_array-error/page/2/#post-2546021)
 * Status: resolved