Need to allow "Edit Location Listing" without showing packages

This topic contains 4 replies, has 3 voices, and was last updated by  Kenneth 4 years, 8 months ago.

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

Open Support Ticket

Tagged: 

  • Author
    Posts
  • #507497

    Kenneth
    Full Member
    Post count: 66

    In GD V2 how can I allow subscribers to edit a location listing without giving them access to create a new listing in the directory? If the “Disable Front End Add” is checked subscribers cannot edit their listing (see attached). When unchecked they can edit but the edit page now shows the listing packages & the dashboard shows “Add Listing: PLACES”.

    In GD V1 we were able to block users from creating directory listings while allowing them access to edit. How can we do this in GD V2?

    Thanks

    #507515

    Alex Rollin
    Moderator
    Post count: 27815

    I will ask the developers to comment if they are aware of a way to achieve that.

    #507535

    Kenneth
    Full Member
    Post count: 66

    Thanks

    #507800

    Kiran
    Moderator
    Post count: 7069

    Hi Kenneth,

    Try following PHP snippet to allow users to edit their listing from front end even add feature is disabled.

    
    
    /**
     * Allow user to edit listing from frontend when add listing feature is disabled.
     */
    function gd_snippet_20190912_add_listing_check_post_type( $return, $post_type ) {
    	if ( $return == false && ! empty( $_GET['pid'] ) && is_user_logged_in() && geodir_listing_belong_to_current_user( absint( $_GET['pid'] ) ) ) {
    		$return = true;
    	}
    	return $return;
    }
    add_filter( 'geodir_add_listing_check_post_type', 'gd_snippet_20190912_add_listing_check_post_type', 10, 2 );

    Kiran

    #508205

    Kenneth
    Full Member
    Post count: 66

    Thanks Kiran!!! That did it.

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