Theme My Login
[resolved] Fatal error: Call to undefined function wpcf_admin_add_js_settings (5 posts)

  1. neskiclaims
    Posted 3 years ago #

    I have (among other plugins):
- Types - Complete Solution for Custom Fields and Types v1.3
- Theme My Login v6.3.8

    I am getting the following error when accessing user Profile page.
    Fatal error: Call to undefined function wpcf_admin_add_js_settings() in /home3/neski/public_html/wp-content/plugins/types/embedded/includes/usermeta-post.php on line 20

    If I disable the Types plug-in the error disappears.

    Please advise.

    Thank you,


  2. Jeff Farthing
    Plugin Author

    Posted 3 years ago #

    More than likely, that plugin checks if is_admin before loading it's admin functions. With TML's Themed Profiles, the profile is no longer within /wp-admin.

    You can work around this by defining WP_ADMIN on the profile page:

    function tml_profile_page_is_admin() {
    	if ( 'profile' == Theme_My_Login::get_object()->request_action )
    		define( 'WP_ADMIN', true );
    add_action( 'init', 'tml_profile_page_is_admin' );
  3. yratof
    Posted 3 years ago #

    Hey Jeff,

    Having the same issue when displaying TYPES new USER FIELDS on the profile page made by TML.

    Fatal error: Call to undefined function wpcf_admin_add_js_settings() in /public_html/wp-content/plugins/types/embedded/functions.php on line 591

    I've thrown the function you've just provided into my themes functions.php, but there's nothing "admin" about the profile page still, and the error persists.

    Don't suppose you'd know why?

  4. Raul Illana
    Posted 2 years ago #

    Hi all.

    BTW, the function changed with plugins growth. I've been stuck some weeks on this...

    The actual patch working for me is:

    /** Types + TML frontend profile fix */
    add_action('init', 'types_tml_fix');
    function types_tml_fix(){ require WPCF_EMBEDDED_ABSPATH .'/admin.php'; }

    My setup:

    • WP 3.5.2
    • TML 6.3.8
    • Types 1.3.1


  5. Adam
    Posted 2 years ago #

    Actually, I think it should be:

    add_action('init', 'types_tml_fix');
    function types_tml_fix(){
        if (!is_admin()) {
        require WPCF_EMBEDDED_ABSPATH .'/admin.php';

    @Paul's solution works, except that you get a redefined error in the back-end.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Theme My Login
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic