Edit Place button for "non admin – users"

This topic contains 18 replies, has 3 voices, and was last updated by  Paolo 7 years, 3 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #348167

    Paolo
    Site Admin
    Post count: 31206

    Using the filter: geodir_detail_page_sidebar_content

    There are plenty of examples in the forum: https://wpgeodirectory.com/support/search/?bbp_search=geodir_detail_page_sidebar_content

    Thanks

    #348416

    alphavader
    Buyer
    Post count: 75

    THanks –

    this Code helped me with that

    
    
    // Custom Info Sidebar Order
    function gd_custom_change_sidebar_content_order() {
        return array(
           
            'geodir_detail_page_more_info',
    	  'geodir_edit_post_link'
        );
    }
    add_filter('geodir_detail_page_sidebar_content', 'gd_custom_change_sidebar_content_order');

    I also would provide alot of snippets from this project – do you have a wiki or interest in that ?

    #348462

    alphavader
    Buyer
    Post count: 75

    Here the Code for Hiding the Box, when user is not logged in.
    (worked for me – maybe for other users aswell)

    
    
    // Add and Remove class when user is logged in - hide loginbox
    if ( is_user_logged_in() ) {
    // if logged in - remove the class
    function remove_body_class($wp_classes)
     {
     foreach($wp_classes as $key => $value)
     {
     if ($value == 'hide_edit_button_logged') unset($wp_classes[$key]); //  Replace "has-right-sidebar" by Your Class that yoU Want to Remove
     }
     
     return $wp_classes;
     }
    } else {
    //if not logged in - add class to the body
    function my_custom_body_class($classes) {
        // add 'my-class' to the default autogenerated classes, for this we need to modify the $classes array. 
        $classes[] = 'hide_edit_button_logged';
        // return the modified $classes array
        return $classes;
    }
     
    // add my custom class via body_class filter
    add_filter('body_class','my_custom_body_class');
    }
    

    And CSS:

    
    
    .hide_edit_button_logged .geodir-details-sidebar-user-links {
      display:none;
    }

    Thanks

    #348677

    Paolo
    Site Admin
    Post count: 31206

    Thanks for sharing, snippet can be found in the forum if users search for them.

    🙂

Viewing 4 posts - 16 through 19 (of 19 total)

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

Open Support Ticket