directory - in profile all listings available to directory users

i have bypassed the payment and sign up page and redirected to registration - but now when i have a registered user at the default directory member login - when you hit submit post it goes to the right page for adding a post, however on the left side there is a dropdown for listings and if the user hits "listings" instead of staying in the "add new" they have access to edit or change any previously posted listings by other users. any way to fix this?

  • DavidM

    Hello vlslusher,

    I believe I spoke with you in the previous thread regarding the Directory plugin not having a free user account. And I gave a possible, yet not elegant, method of working around that. What you're seeing is the non-elegance behind the workaround.

    Ultimately, the best thing to do is to wait until a free user account is integrated into the plugin.

    However, if you need to have a free user account as it currently is, you can choose to edit the plugin code itself to provide for that, or use the method you've used so far along with the following user role editor, where you can exclude the "edit listing" and any "delete" capabilities from the "Directory Member" user role.

    Basically, this involves editing the Directory Member user role capabilities in order to disallow users from editing or deleting existing listings. One problem with this, however, is that users won't be able to edit their own listings once posted. You could provide a way for users to contact the admin for editing purposes but basically, as I mentioned previously, this isn't the most elegant solution.


  • vlslusher

    and not to beat a dead horse on this one - but in the install directions it says:

    * If you are creating a community based Directory you don't need to charge to people to add listing (i.w don't need to set up payment gateways).
    * You can add them as users to the site (or network). All Super admins, admin users and directory members are able to create new listings,

    But the only way to do this is the default user redirect?

  • DavidM

    Hi vlslusher,

    You're right about that "you don't need to charge" text from the installation instructions. My apologies for not having noticed that. According to that text, we should have a free user account. And I'm looking into that now.

    Regarding the role editor, I tried several different configurations of capabilities and unfortunately, they all have their shortcomings. So I installed the beta version of the Membership plugin, set it up and it worked much more elegantly, having its own registration form and custom roles and access rules.

    I can post the information on the setup of Membership if you'd like, but I do agree it is best to have the free user capability built in as it should be per the instructions. And as I said, I am looking into that.


  • DavidM

    Alright vlslusher,

    I used the Membership beta version at the following:

    Under Membership > Edit Levels, I created "Stranger" and "Directory Member" membership levels.

    For "Stranger" rules I've left everything blank. I setup "Directory Member" rules as follows.
    Negative rules - I placed the "Main Menus" rule with everything checked except for Listings and Users.
    Positive rules - I placed the "Sub Menus" rules with nothing checked except for Listings > Add New and Users > Your Profile.

    Under Edit Subscriptions, I created "Stranger" and a "Directory Member" subscription levels and dragged the above Membership Levels into each respectively with an indefinite mode setting.

    I then created a Page named "Register" and pasted the Membership registration page shortcode (subscriptionform) in it.
    Under Membership > Edit Options I set the following:
    Stranger > Use membership level - set to "Stranger"
    User registration > Use subscription - set to "Directory Member"
    Registration page > Registration page - set to "Register"

    Lastly, at Settings > General, I set New User Default Role to Administrator. This is not advised, but for some reason the Directory Member user role couldn't edit listings in my tests so I just used Membership to restrict access to these new admin members.

    You can see the above in action at

    There's a login widget in the lower left corner to help keep it simple. You can test the site as a free member by creating an account or using the following.

    username: directorymember
    password: directorymember

    The site is currently used only for the purpose of testing the Directory plugin and hopefully will help to showcase the plugin soon. So feedback is definitely welcome!

    Also, I can post screenshots of the setup if you prefer.


  • vlslusher

    i must be screwing something up because when i log into a dummy account i can still access the dashboard?

    and i like the login widget . . . any pointers on where to find it :slight_smile:

    and any possibility to add some questions to registration? using the wp registration (which was clearly not working) i was adding some other information to the basic registration using register plus redux

  • DavidM

    Hello vlslusher,

    So sorry for the delayed response on this one. I was trying to keep a keen eye on this one but seemed to have lost track of it.

    Even on the demo site I listed, the dummy accounts will still be able to access the back-end for the two relevant functions allowed to them. But that should be it. On the site, I bypassed the need for the standard wp-login so you shouldn't need to login there, nor should you need that if you use the method I brought up here.

    In fact, using Membership in the above way actually paves way for more than just a Directory. It's basically setup to allow for other features to be rather easily integrated from here. This is basically just a framework setup of sorts.

    The login widget is called "Login with Ajax" and I believe it's rather easy to find using either "login with ajax" or even just "login widget" since it's listed well on the WordPress search.

    The Membership plugin ought to tie into the typical registration, allowing for registration/profile field manipulation/addition. I'll double check that, but have you tried other plugins to that effect?


  • wdywft

    I may have found another workaround, but I still have to test it (no guarantees)... What I did:


    In the user role editor, the only boxes I checked are
    edit listing
    edit listings
    edit posts (this is necessary or else the directory member will not be able to post the listing)
    Read listing
    Read private listings

    Now when a directory member logs in, he/she can submit a new listing and submit a new blog post 'for review'. But that is not good enough because the member still has the power to edit other people's listings.

    So I deleted the three links next to the 'Mine' link in the ADD NEW listing page. The links I deleted are 'all', 'published', and 'trash'. The member can now only click on 'mine'.

    I went into wp-admin/includes/class-wp-posts list table.php and deleted this:

    $status_links['all'] = "" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_posts, 'posts' ), number_format_i18n( $total_posts ) ) . '';

    then deleted this:

    $status_links = array();
    $num_posts = wp_count_posts( $post_type, 'readable' );
    $class = '';
    $allposts = '';

    So far it seems to work quite nicely... (and I didn't have to buy the full membership...).

  • wdywft

    I also had to delete the two 'edit' links from the frontend (visible to directory members when logged in).

    From from .single. php (plugins, directory, default), I deleted:
    <?php edit_post_link( __( 'Edit', THEME_TEXT_DOMAIN ), '<span class="edit-link">', '</span>' ); ?>

    From loop-functions.php (themes, default, includes, function), I deleted:
    <?php edit_post_link( __( 'Edit', THEME_TEXT_DOMAIN ), '<span class="edit-link">', '</span>' ); ?>

    I also activated the Ajax login widget and redirect directory members to 'listings>>add new'; and voila!

    (There's probably an easier way to doing all this)

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.