Listings with editing options included

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

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

Open Support Ticket
  • Author
    Posts
  • #425141

    Diego
    Buyer
    Post count: 15

    Is there a shortcode that allows me to show the lists created as they appear on the author page? that is, with the options for upgrade listing, edit, delete, expire date, etc.

    I tried:
    [gd_listings post_author = “current_user” post_type = “gd_place” layout = “5”]
    [gd_listings post_author = “current_author” post_type = “gd_place” layout = “5”]

    and both options show me the listings (filtered by author or user) ok. But without the editing options that appear on the author page that allow me to manage my created lists (mentioned above).

    Thank you very much!!

    #425276

    Alex Rollin
    Moderator
    Post count: 27815

    Unfortunately no, there is not a shortcode that will do that.

    In V1 those action links are displayed via hook, requiring a customization. This is the code that shows the edit link on listings: https://github.com/GeoDirectory/geodirectory/blob/master/geodirectory-templates/listing-listview.php#L336

    This is the codex entry: https://wpgeodirectory.com/codex/codex/geodirectory_functions/geodir_user_show_listings/

    There are some examples in the FAQ.
    https://wpgeodirectory.com/docs/faqs/detail-page/
    Search on that page for: My Account Area – Add favorites and listings inside the My Account area

    #425350

    Diego
    Buyer
    Post count: 15

    Thank you very much for all the information, it has been very helpful 🙂

    I have managed to implement 2 functions. One for each CPT. Each one returns a URL of its corresponding listings, called “gd_place” and “gd_cursos” (with the particularity of being deleted, editable, etc. – This is great).

    The separate URLs work fine, but now I’m trying to generate a third function that returns a URL that shows me the 2 CPT listings on the same page. I have obtained the concatenated URL that allows me:
    “https://xxxxxx.com/author/xxxxx/?geodir_dashbord=true&stype[]=gd_place&stype[]=gd_cursos”, however, it appears that “no ads have been found that match your selection”, without any results.

    The question is: Is there any way to display both CPT listings (“gd_places” and “gd_cursos”) in editable, removable, etc. mode on the same page? I can not think of any way..

    Here I leave the third function, which allows me to obtain the concatenated link of the 2 CPT, but without any results.

    
    
    function gd_add_my_listings_sc($atts) {
        $defaults = array(
            'stype' => array('gd_place','gd_cursos')
        );
    
        $params = shortcode_atts($defaults, $atts);
        if (is_user_logged_in()) {
            global $current_user;
    
            $author_link = get_author_posts_url($current_user->data->ID);
            $author_link = geodir_getlink($author_link, array('geodir_dashbord' => 'true'), false);
            $listing_link = geodir_getlink($author_link, array('stype' => $params['stype']), false);
            $listing_link = apply_filters('geodir_dashboard_link_my_listing', $listing_link, $params['stype'], $current_user->ID);
            return '<a title="Mis Centros" href="'.$listing_link.'">Mis Centros</a>';
        }
        return "";
    }
    add_shortcode('mis_centros', 'gd_add_my_listings_sc' );
    #425417

    Alex Rollin
    Moderator
    Post count: 27815

    Hi!
    Thanks for sharing!
    I will flag your question for the developers in case they have a fix.

Viewing 4 posts - 1 through 4 (of 4 total)

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

Open Support Ticket