Directory won't let user add listing

Even though I have set the permissions for a subscriber to add, view, edit listings..they cannot.

Thanks!

  • Joe

    Hi Vinod,
    Yes cool but issue is really that subscriber can't get to view listing page. I'm sorry if I was unclear. No issues with adding a listing once you get to /listings/add-listing but in my admin all the add listing links go here: /wp-admin/edit.php?post_type=directory_listing

    Which then prompts: You do not have sufficient permissions to access this page.

    I set the permissions so subscriber can view listings. If you can figure out how user can see the listings in the dashboard (not front end) then things will probably work.

    Thanks!

  • Vinod Dalvi

    Hi Joe,

    Thank you for your reply.

    I could confirm the issue on my test site using latest version of Directory plugin that the subscriber user is not allowed to create listing from admin area.

    This is because in the plugin code it is checked whether the user has unfiltered_html capability and if it has then only the user is allowed to create listing in admin area. By default unfiltered_html capability is only assigned to the Super Admin, Administrator and Editor user roles so it's not allowed to create listing in admin area for subscriber users even when we add "Add listings." capability to it in the Directory plugin settings.

    I have notified this issue to the plugin developer so that it can be fixed.

    In the meanwhile you can resolve this issue by editing the following Directory plugin file on line number 57 as displayed below.

    Directory plugin file :
    directory/core/admin.php

    Before Editing :

    function admin_menu() {
    	$opts = get_option( $this->options_name );
    
    if ( ! current_user_can('unfiltered_html') ) {
    remove_submenu_page('edit.php?post_type=directory_listing', 'post-new.php?post_type=directory_listing' );

    After Editing :

    function admin_menu() {
    	$opts = get_option( $this->options_name );
    
    if ( ! current_user_can('unfiltered_html') ) {
    //remove_submenu_page('edit.php?post_type=directory_listing', 'post-new.php?post_type=directory_listing' );

    Thanks,
    Vinod Dalvi

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.