Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

My website allows users to upload events via an upload process incorporated into a customised front end page.

As an event uploader, I also want users to have access to the dashboard where they can view the events they have posted.

I ideally want to remove access to edit.php - I don't want users to be able to edit / or reach post.php, at all through their dashboard. I only want them to upload events through the customized front end upload.

SOLUTION POSSIBILITY 1

I could disable edit for the contributor role completely and still have a way to show posts to the event listers from their dashboard, if I could just learn how to add this info to the menu in the admin side bar in the form of a button in the dashboard (for all users). This code came from a link I found in a widget:

<a href="<?php echo get_author_link( $echo = false, $current_user->data->ID; ?>LINKED TEXT HERE</a>

I tried to add it using AG Custom admin add menu button funtion, but it didn't work.

The above would be the ideal solution for me as there'd be no access to edit.php through url link for this role.

One set back is that showing the posts in the fron end, shows an edit button when the post is still a draft. I would like to remove the EDIT button from the front end page they view, I think it only appears in draft status as this role can't edit published posts (I will have to double check that). Even if it's the users post I don't want them to be able to edit it once it has been submitted, as I only want what I originally approve to be published.

I reckon I could work that out myself (In single probably?)bugt if anyone can help whilst I think of it that would be great!

SOLUTION POSSIBILITY 2

So - if I use role manager to completely prevent editing, that removes all access to the edit.php. which is fine in the instance above (if I can add that link to show all authors posts into the admin sidebar). But I really do want event uploaders to be able to view a list of their events and view each one. Edit.php seems a good second best place for that to happen if I can't link to a list in the front end as in the exp above, as the events are already listed at edit.php, as is the view facility. I just don't want to allow a link through to edit, and there is that link in the title of the post until I have approved it!!

I thought if I could disable the link through to edit a post. (through to post.php) which is incorporated into the title of each row in the table of posts (or events in my case) then that would stop people from accessing that screen. BUT I would then, though, have to solve that the screen would still be accessible if they pasted in '/edit.php' to the url. I have removed quickedit and edit, and edit from the bulk filter at the top of edit.php.

SOLUTION POSSIILITY 3

Another possible fix takes advantage of the fact that once a post is published (approved by me) by a contributor, this link on the post title in edit.php screen actually disappears!

So alternatively, if someone knew a code I could paste into functions within the theme or even the core files, (i don't mind, either way, I'm desp!) to make it possible for only admins to posts of draft status in their post list in edit.php, so once a contributor posts an event in the front end, it doesn't appear in their own post screen until it becomes published (when I have approved it), then that would also solve my problem!

Thank you so much for your time! I utterly am stuck, I can't find a solution to any of these options, this as far as I can get with each! I would be so SO grateful if there was anyone out there who could help me with this challenge, I am truly stumped.

I'm not a php expert, but I'm handy and have a reasonable grasp, and am good at finding solutions and amending ones from others to match my unusual needs, etc. I have spend ages on this one and just had to wave the white flag! I'll eagerly look out for any tips from our there in the big wide world !

Thanks again Kaye

.......................................................................................

Other notes:

  • I'm using wordpress v3.1.1
  • I use manage readers own posts
  • I have hidden the media library so contributors see only their own piccies.
  • I use role manager to deal with role limits
  • I also use rolescoper to deal with category limits
  • I use adminize and global screen options to tailor screen
  • I use AG custom admin to help tailor admin screen
  • Along with a heap off other functions and plugins.

I would very much like to allow event uploaders access to a dashboard, so I don't want to hide the whole dashboard as a solution to this problem of hiding access to editing (or POST.php) in the back end.

share|improve this question
1  
Have you found a solution for this? Although you go into great lengths to explain your issue, it's being kind of hard to understand you final goal... Wouldn't a custom Dashboard widget solve the problem? (listing all the user's posts/events) –  brasofilo Jun 20 '12 at 19:41
add comment

1 Answer

As far as I understood this right, you want to disable the possibility to reach any other side aside from the dashboard.

Well, then here's a short plugin for you:

<?php
! defined( 'ABSPATH' ) AND exit;
/* Plugin Name: (#45989) »kaiser« Allow Dashboard only access */

function wpse45989_access_dashboard_only()
{
    if (
        ! isset( get_current_screen()->id )
        OR 'dashboard' !== get_current_screen()->id
        )
    {
        // Lets limit this to only specific user roles
        if ( current_user_can( 'ROLE_NAME_HERE' ) )
            exit( wp_redirect( admin_url() ) );
    }
}
add_action( 'current_screen', 'wpse45989_access_dashboard_only', 100 );
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.