WordPress.org

Ready to get started?Download WordPress

Forums

Call to undefined function __update_post_meta() (3 posts)

  1. ktsixit
    Member
    Posted 2 years ago #

    Hi all,
    I have placed the following code in a template file

    __update_post_meta( $the_post_id, 'user_id', $user_id );

    but each time the code executes there's an error occuring:

    Fatal error: Call to undefined function __update_post_meta() in /home/public_html/wp-content/themes/mytheme/register.php on line 133

    I suppose that I have to import some kind of wordpress file here, but I don't know what that should be. Any suggestions?

  2. alchymyth
    Forum Moderator
    Posted 2 years ago #

    try to use the function name without the two underline characters;

    update_post_meta()

    http://codex.wordpress.org/Function_Reference/update_post_meta

  3. ktsixit
    Member
    Posted 2 years ago #

    That's the way I've been using this function since now, and it's been working fine.... But I was silly enough not thing to test the function after removing the underline. Thanks a lot!

Topic Closed

This topic has been closed to new replies.

About this Topic