WordPress.org

Forums

increase/decrease user meta field (3 posts)

  1. emazero
    Member
    Posted 2 years ago #

    Let's say I have a custom user meta field for ex.
    my_meta_field = X where value X is a number

    I need to increase/decrease thet value after a form submission by the user. I wonder something like my_meta_field++ / my_meta_field--

    Ok forget about the form... this is just an input just to know if should I spend time on it..

    thanks
    ema

  2. Drew Jaynes
    4.2 Release Lead
    Posted 2 years ago #

    I suggest looking at update_post_meta and Post_Status_Transitions for the appropriate hooks.

  3. emazero
    Member
    Posted 2 years ago #

    thanks drew
    that's a good start..
    I didn't consider update_post_meta function and it sounds good.. but update_user_meta is better, isn't it?

    I run in this: http://wordpress.org/support/topic/update_post_meta-updates-2-posts?replies=9 and may help me much in increasing my var

    I'll try soon...
    thanks

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.