Home Forums Plugin Support WP User Frontend Pro Registration Form Hook

This topic is: not resolved

This topic contains 11 replies, has 2 voices, and was last updated by  towhid 4 years, 1 month ago.

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #39399

    Randall
    Member
    Post count: 5

    Hello!

    I will try and make this as brief and quick as possible. First off, GREAT plugin! Really enjoy it.

    Second, I have a custom image upload field title “header_image” in my registration form. Here is the code I have listed after searching around on the forums and using the documentation.

    <?php
    $curauth = (get_query_var(‘author_name’)) ? get_user_by(‘slug’, get_query_var(‘author_name’)) : get_userdata(get_query_var(‘author’));
    ?>
    
    <?php $images = get_user_meta( $curauth->ID, 'header_image' );
     
    if ( $images ) {
        foreach ( $images as $attachment_id ) {
            $thumb = wp_get_attachment_image( $attachment_id, 'thumbnail' );
            $full_size = wp_get_attachment_url( $attachment_id );
    		
    		printf( '<a href="%s">%s</a>', $full_size, $thumb );
        }
    } 
    ?>
    <?php echo get_user_meta( $curauth->ID, ‘header_image’, true ); ?>

    But it is not displaying the image. Really all I am looking for is to get the url of the image that the user uploaded during registration. I realize this is not the exact code to get that, but I am working through that. Any help in that direction would be great.

    What am I missing in the code above to get the url of the image uploaded during the registration process?

    Thank you,

    Randall

    #39511

    towhid
    Participant
    Post count: 4505

    Hello Randall,

    Send me the forum link and documentation link about the code you had mentioned.

    Thank You 🙂

    #39547

    Randall
    Member
    Post count: 5

    Of course!

    For the standard image hook I used this post:
    http://docs.wedevs.com/showing-meta-fields-in-frontend/

    For the author template, I pulled that from wordpress.

    http://codex.wordpress.org/Author_Templates

    I hope these help.

    Thanks!

    Randall

    #39630

    towhid
    Participant
    Post count: 4505

    Hello Randall,

    I need time to reproduce this issue the way you are trying. Please allow me some time. Hope I will come back with a right solution.

    Thank You 🙂

    #40028

    Randall
    Member
    Post count: 5

    Great!

    Thank you!

    #40702

    towhid
    Participant
    Post count: 4505

    In which file you have worked-out the above code in your theme? author.php file? Can you send me the file? I have to check.

    Thank you 🙂

    #40757

    Randall
    Member
    Post count: 5

    I am currently using WC vendors plugin and it is placed within their vendor-main-header.php file. How can I send you the file?

    #40806

    towhid
    Participant
    Post count: 4505

    Hello,

    I am not sure WP User Frontend code will work in WC vendor plugin and what is the integration process you had taken. Would you please paste the above code in site's content file for the theme and let me know the result.

    Thank you 🙂

    #40948

    Randall
    Member
    Post count: 5

    Hello!

    I posted the code into the wc vendors file and I cannot seem to find the image anywhere. Let alone hook it. How would you hook custom images in registration forms if it were something else?

    For reference on WC Vendors and WP User FrontEnd Pro (http://www.wcvendors.com/knowledgebase/using-front-end-new-product-submissions/)

    Thank you!

    #40987

    towhid
    Participant
    Post count: 4505

    Hello,

    It is depend of theme structure. I am always test something in WordPress default template named “Twenty Fourteen”. There are a file named author.php and in there get_template_part( 'content', get_post_format() ); indicate to content.php page. Can you check that template please? If you are able to hook any meta field in content.php file. If yes, you can also do that “url of the image uploaded during the registration process” because that value are populate into the post meta table. I will first tell you to hook a meta field value into content.php file and after then paste your above code and see what happen.

    Thank you 🙂

    #41032

    Randall
    Member
    Post count: 5

    Excellent! I did as you asked and placed it in the twenty fourteen template content.php file. After changing the meta tag name to pv_header_image I was able to link the url with the code above.

    Thank you very much for your help!

    Randall

    #41082

    towhid
    Participant
    Post count: 4505
    This reply has been marked as private.
Viewing 12 posts - 1 through 12 (of 12 total)

The topic ‘Registration Form Hook’ is closed to new replies.