Before Description Field

This topic contains 7 replies, has 3 voices, and was last updated by  Alex Rollin 6 years, 10 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #416174

    jahusdtc
    Expired Member
    Post count: 162

    There are two places the description field is editable.

    1. Off WordPress Admin … Places > (listings) > the record.
    2. From the url that looks like http://mysite.com/add-listing/?pid=5742

    Within the second type of page, the geodir_before_description_field action will echo out information above the description field.

    Within the first, that same action will not.

    Is there another action that will echo out information in the first instance?

    Tried to search Codex, but didn’t see anything else applicable.

    Thanks for any help.

    #416200

    Alex Rollin
    Moderator
    Post count: 27815

    I don’t think there is an easy way to do that. I will flag the question for the developers who will let us know if there is.

    #416242

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    You can use this WP hook:

    
    
    /**
     * Fires after the title field.
     *
     * @since 3.5.0
     *
     * @param WP_Post $post Post object.
     */
    do_action( 'edit_form_after_title', $post );

    Thanks,

    Stiofan

    #416286

    jahusdtc
    Expired Member
    Post count: 162

    Perfect! Thanks much. I was searching for something with “description” in name of hook…duh! should have sought after_title, too!

    Thanks. Having that above description in editing makes lots more sense — to me, anyway!

    Appreciate your time.

    #416287

    jahusdtc
    Expired Member
    Post count: 162
    This reply has been marked as private.
    #416290

    Alex Rollin
    Moderator
    Post count: 27815

    why not? 🙂

    #416781

    jahusdtc
    Expired Member
    Post count: 162

    This is the code for functions.php that I ended up with…and what it looks like.

    Here’s hoping it will help someone out!

    
    
    /* 
     * ADMIN - ADD LISTING - put information ABOVE the Description field that will become the 
     * Profile/About Us Tab on the Detail Page
     * There are two places the description field is editable.
     * 1. Off WordPress Admin … Places > (listings) > the record.
     * 2. From the url that looks like http://mysite.com/add-listing/?pid=5742
     * #1 is geodir_before_description_field
     * #2 is do_action( 'edit_form_after_title', $post );
     * Decided to style with CSS to look like fieldset on the two places discussed above.
     */
    add_action('geodir_before_description_field', 'information_above_profile_field_when_editing');
    add_action('edit_form_after_title', 'information_above_profile_field_when_editing');
    function information_above_profile_field_when_editing(){
    	$title_to_show = 'About Us Info';
    	$info_to_show = 'Enter the narrative, ad-like information that will show on the Listing and Detail page.';
    
    	$combined_to_show  = '<h5 class="geodir-fieldset-row"' . '>' . $title_to_show .'<small> ( ' . $info_to_show . ' )</small></h5>';
    
    	echo $combined_to_show;
    }
    #416862

    Alex Rollin
    Moderator
    Post count: 27815

    Thanks for sharing! 🙂

Viewing 8 posts - 1 through 8 (of 8 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