WordPress.org

Ready to get started?Download WordPress

Forums

WP User Frontend
Dashboard denies deletion of posts. "You are not the post author. Cheeting huh!" (9 posts)

  1. ViewsForMe
    Member
    Posted 1 year ago #

    I have a video website with a submission form that gives anyone who registers (subscriber role) the ability to embed any YouTube or Vimeo video they like as a post: http://ViewsFor.Me I'm in the process of trying to implement the WP User Frontend plug-in into my website to allow those users to go in and edit/delete the posts that they created if they like.

    I am testing it out now and it appears that the edit page accessible through the dashboard works just fine and allows them to edit their own posts, however on the dashboard page (http://ViewsFor.Me/dashboard) the delete function always fails with the "You are not the post author. Cheeting huh!" message even though the accounts I tested it on were clearly the post author.

    I also attempted this with the author role to see if the subscriber role was preventing users from deleting and got the same message.

    Any ideas?

    Thanks!

    http://wordpress.org/extend/plugins/wp-user-frontend/

  2. ViewsForMe
    Member
    Posted 1 year ago #

    Just did some more testing to find that the delete button only works with admin roles and I'm assuming editor would work as well. I obviously can't give everyone the editor role.

  3. professor99
    Member
    Posted 1 year ago #

    Without looking at the code one thing that may cause this is the "WP User Frontend:Settings" - "Others" -> "Users can delete post?" option being set to "No".

    Cheers
    TheProfessor

  4. professor99
    Member
    Posted 1 year ago #

    Then again I have that option set correctly and I get the same error too when logged in as an "author". Works when I am logged in as an editor.

    If WP User Frontend observed default WordPress role capabilities the only users besides non-logged in users that shouldn't be able to delete their own posts should be those with the WordPress role "Subscriber".

    So this is definitely a bug.

    Cheers
    The Professor

  5. ViewsForMe
    Member
    Posted 1 year ago #

    Yeah the setting is definitely set to "yes" right now. I just tried setting it to "no" in hopes that the form was backwards or something like that and the delete links on the dashboard are no longer there. Clearly it's doing something right, but the functionality just isn't there when it is on. If it displays itself as being set to "No" when looking at the code I assume this would be an easy fix.

  6. professor99
    Member
    Posted 1 year ago #

    This affects my application as my users are all "Authors". So if your not a coder and nobody else fixes it first I will end up fixing it next weekend.

    Cheers
    TheProfessor

  7. ViewsForMe
    Member
    Posted 1 year ago #

    Yeah, I'm not a coder at all, I'm just barely getting used to WordPress and how it works. That would be awesome! I still haven't officially launched my site to our community yet. I'm trying to get all of the functionality where I want it before a bunch of people are using it and I'm pretty sure this is the last thing to do on my list. Keep me updated!

    [ Please do not bump, that's not permitted here. ]

  8. professor99
    Member
    Posted 1 year ago #

    Simple bug due to omission of global $userdata declaration.

    Change the following lines in the file wpuf-dashboard.php

    /**
         * Delete a post
         *
         * Only post author and editors has the capability to delete a post
         */
        function delete_post() {
            $nonce = $_REQUEST['_wpnonce'];

    to

    /**
         * Delete a post
         *
         * Only post author and editors has the capability to delete a post
         */
        function delete_post() {
            global $userdata;
    
            $nonce = $_REQUEST['_wpnonce'];

    Cheers
    TheProfessor

  9. stickFinger
    Member
    Posted 1 year ago #

    @professor99
    Thank you

    Worked pretty well :-)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic