Home Forums Plugin Support WP User Frontend (Free Version) Save a custom field reading value from another

This topic is: resolved

This topic contains 18 replies, has 4 voices, and was last updated by  Tareq Hasan 5 years, 6 months ago.

Viewing 4 posts - 16 through 19 (of 19 total)
  • Author
    Posts
  • #13401

    Danilo
    Participant
    Post count: 43

    Sorry, but I can't make this code to work!
    Why so difficult?

    See latest version of my code here:
    http://pastebin.com/EktsAiQD

    How is wrong?

    #13403

    Denis
    Participant
    Post count: 165
    
    function yourFunction( $post_id ) {
    
        $yourTitle = get_post_field( post_title, $post_id, display );
     
        update_post_meta( $post_id, 'yourCustomField', $yourTitle );
    }
     
    add_action( 'wpuf_add_post_after_insert', 'yourFunction' );
    add_action( 'wpuf_edit_post_after_update', 'yourFunction' );
    #13417

    Danilo
    Participant
    Post count: 43

    Finally!
    Thank you, DenisCGN, your code works for me!

    Just a more little question:
    – How can I update a field from another, if the original field is a date with YY/MM/DD HH:MM format and I need to update with only YYMMDD format?

    #13436

    Tareq Hasan
    Keymaster
    Post count: 2831

    [php]
    $prev_date = ‘2013/12/07 12:12';
    $new_format = date(‘Ymd', strtotime($prev_date) );
    [/php]

Viewing 4 posts - 16 through 19 (of 19 total)

The topic ‘Save a custom field reading value from another’ is closed to new replies.