Detail page: return user ID of listing creator

This topic contains 4 replies, has 3 voices, and was last updated by  Kiran 5 years, 7 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket

Tagged: 

  • Author
    Posts
  • #474272

    oldmankit
    Buyer
    Post count: 116

    I would like to add a shortcode to the detail page of a listing. The shortcodes will display a Form View (created by Formidable Pro plugin). In this shortcode I need to provide the user ID of the listing creator. With the user ID, Formidable will be able to show a form view with data from the correct user.

    Is there any way I could do this? I’m attaching a screenshot of what I would like to achieve.

    Objective:

    By doing this, I can add form data for the listing creator. For example, if I can follow up listing creators one month after they have created their listing with an ‘optional extra details’ Formidable form. This allows them to create a more complete profile, without forcing them to do so when they initially fill in the form.

    I know that Ninja forms is already integrated into GD. However I am already a paying user of Formidable.

    #474330

    Kiran
    Moderator
    Post count: 7069

    Hello,

    1) Add following shortcode in tab

    [gd_custom_shortcode]

    2) Use following code snippet to render that shortcode

    
    
    function gd_custom_shortcode( $args = array(), $content = '' ) {
    	global $gd_post;
    	if ( empty( $gd_post ) ) {
    		return;
    	}
    
    	return do_shortcode( '[display-frm-data id=2051 filter=limited param=' . (int) $gd_post->post_author . ']' );
    }
    add_shortcode( 'gd_custom_shortcode', 'gd_custom_shortcode' );

    Kiran

    #474416

    Alex Rollin
    Moderator
    Post count: 27815

    Thanks for the example Kiran

    You can read more about customizing here:

    https://wpgeodirectory.com/docs-v2/faq/customizing/

    If you need more developer help with your customization you can contact a GD expert here:

    https://geodirectoryexperts.com/

    #474447

    oldmankit
    Buyer
    Post count: 116

    Thank you Kiran! That’s so useful, it enables me to do so much.

    And thank you too, Alex. I note this solution has found its way into the docs, which is great. Just for the purposes of any future reference for that doc, the returned shortcode should look like this (the shortcode I posted in the original question was actually a bit inaccurate, and the following is simpler and is in line with Formidable’s own documentation syntax):

    [display-frm-data id=x filter=limited user_id=' . (int) $gd_post->post_author . ']

    Anyway, once again, I’m so grateful for this and am thrilled about what it’s going to make possible for me.

    #474451

    Kiran
    Moderator
    Post count: 7069
    This reply has been marked as private.
Viewing 5 posts - 1 through 5 (of 5 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount