Home Forums Plugin Support WP User Frontend Pro how can i integrate custom fields

This topic is: resolved

This topic contains 9 replies, has 3 voices, and was last updated by  sayyam 6 years, 2 months ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #3718

    sayyam
    Participant
    Post count: 6

    whith front end user pro how can we integerate custom fields like
    dp_video_file, dp_video_url and dp_video_code
    i am using detube wordpress theme
    and want to make a form which enable user to submit the videos front end
    but they haven't used any custom post, they used default post
    please help

    #3719

    Tareq Hasan
    Keymaster
    Post count: 2831

    What type of value stores in that meta field? Video url?

    This plugin usually saves the image/file's attachment ID in those custom fields. You can get the url's of those videos/files like this:
    [php]
    $video_id = get_post_meta( $post->ID, ‘db_video_file', true );
    $video_url = wp_get_attachment_url( $video_id );
    [/php]

    #3720

    sayyam
    Participant
    Post count: 6

    i have gravity forum, it give this option

    http://awesomescreenshot.com/0c31a7mu3f

    http://awesomescreenshot.com/0c91a7nb4d

    that means in Post options at your plugin we are not having such option where we can describe the custom fields of the post

    #3721

    Tareq Hasan
    Keymaster
    Post count: 2831

    It's not like gravity form here, you've to explicitly mention the meta key.

    #3722

    sayyam
    Participant
    Post count: 6

    means this plugin can't do.

    #3723

    Mahi
    Member
    Post count: 1555

    Please check this. Same theme same issue already been fixed.

    Thanks.

    #3724

    Tareq Hasan
    Keymaster
    Post count: 2831

    I think you are getting the wrong idea. The plugin can DO. The screenshots you provided, doesn't go with what you want. You want video URL on those custom fields, WP User Frontend puts those video ID's. Thats the problem, and there is two solutions. First, change your theme code, I've given you the code and may be you didn't understand.

    The Second solution is adding a hook. So the idea is, you'll add a custom field with meta key dp_video_url_id and this custom field will have the video ID. Upon submitting the form, the correct video url will be saved to dp_video_url custom field. Here's the code that does it, paste in your themes functions.php
    [php]
    function wpuf_dp_integration( $post_id ) {

    if ( isset( $_POST[‘dp_video_url_id'] ) ) {
    $video_url = wp_get_attachment_url( $_POST[‘dp_video_url_id'] );
    update_post_meta( $post_id, ‘dp_video_url', $video_url );
    }
    }

    add_action( ‘wpuf_add_post_after_insert', ‘wpuf_dp_integration' );
    add_action( ‘wpuf_edit_post_after_update', ‘wpuf_dp_integration' );
    [/php]

    #3725

    sayyam
    Participant
    Post count: 6

    i select the text box and captioned it as video url
    after then at meta field bix i wrote dp_video_url_id
    but it doesn't work

    same in case of embed code also

    #3730

    Tareq Hasan
    Keymaster
    Post count: 2831

    I am not sure if you understand what I said. This is a simple solution that will fix your url problem.

    #3835

    sayyam
    Participant
    Post count: 6

    and it worked
    hope that you also give in next version an option to do
    step wise data submmsions and themes also for the forum.

Viewing 10 posts - 1 through 10 (of 10 total)

The topic ‘how can i integrate custom fields’ is closed to new replies.