How do I output the Gravity Forms “embed url” of a post type post posted within a default post?

How do I output the Gravity Forms “embed url” of a post type posted within a default post, in php, within a shortcode?

Hi Ferenz. I’m afraid I don’t understand the question. What information are you trying to get, and where are you trying to use it? Can you share any screenshots or other information to help us understand your request?

Hi Chris,

yes, here is te screenshot:

I added a hidden field to my form, containing the embed url, and added a parameter.

And I want to output the url within the following shortcode:

function myprefix_custom_grid_shortcode( $atts, $post_id ) {

    // Parse your shortcode settings with it's defaults
    $atts = shortcode_atts( array(
    
        'posts_per_page' => '-1',
        'term'           => ''
    ), $atts, 'myprefix_custom_grid' );
$user_id = userpro_get_view_user( get_query_var('up_username') );
    // Extract shortcode atributes
    extract( $atts );

    // Define output var
    $output = '';



    

    // Define query
    $query_args = array(
    'author'=> $user_id,
        'post_type'      => 'items', // Change this to the type of post you want to show
        'posts_per_page' => $posts_per_page,
    );

    // Query by term if defined
    if ( $term ) {

        $query_args['tax_query'] = array(
            array(
                'taxonomy' => 'category',
                'field'    => 'ID',
                'terms'    => $term,
                
            ),
        );

    }

    // Query posts
    $custom_query = new WP_Query( $query_args );

    // Add content if we found posts via our query
    if ( $custom_query->have_posts() ) {

        // Open div wrapper around loop
        $output .= '<div>';

        // Loop through posts
        while ( $custom_query->have_posts() ) {

            // Sets up post data so you can use functions like get_the_title(), get_permalink(), etc
            $custom_query->the_post();

            // This is the output for your entry so what you want to do for each post.
           // This is the output for your entry so what you want to do for each post.

$output .= '<div>' . esc_html( get_the_title() ) . get_the_term_list( $post_id, 'itemscategories', 'Posted in: ', ', ' ) . '</div>';
        }
        // Close div wrapper around loop
        $output .= '</div>';

        // Restore data
        wp_reset_postdata();

    }

    // Return your shortcode output
    return $output;

}
add_shortcode( 'myprefix_custom_grid', 'myprefix_custom_grid_shortcode' );

These are the lines in question:

$output .= '<div>' . esc_html( get_the_title() ) . get_the_term_list( $post_id, 'itemscategories', 'Posted in: ', ', ' ) . '</div>';

This code outputs on a user profile the titles of the posts submitted by a user via Gravity Forms, and the taxonomy term of the post.
I want to replace the taxonomy term of the post with the embed url of the post.

How do I display the embed url on the user profile with this code?
The parameter would be: $gravity_embed_url as I defined it.

Where do I need to declare this parameter in the code and how do I echo the url (text with link)?

(and I could see in my backend that the embed url is already retrieved in the entry so that means that the embed url hidden field is already added by default and I don’t need to add it for frontend/post type use?)

© 2008 - 2019. Gravity Forms is a project by Rocketgenius Inc.