WordPress.org

Ready to get started?Download WordPress

Forums

Front-end Editor
[resolved] Trouble with fee and Members Plugin (8 posts)

  1. TPH31
    Member
    Posted 3 years ago #

    Hi. I use the Members plugin to assign Content Permissions to only certain roles on some pages. This allows me to share only specific pages with other users, and they can use fee to edit some content on those pages. For this fee works perfectly.

    However I have noticed that if an Administrator (with all capabilities) edits one of those pages with fee, the Content Permissions assigned to the page are wiped (reset to none).

    I'm no expert, but comfortable tinkering with the code, sadly in this case I don't know where to look.

  2. scribu
    Member
    Plugin Author

    Posted 3 years ago #

    I'd wager the Members plugin hooks into 'save_post' or 'wp_insert_post' with the assumption that the post will always be edited using the normal edit screen.

    A simple if ( defined( 'DOING_AJAX' ) ) return; check should do the trick.

  3. Justin Tadlock
    Member
    Posted 3 years ago #

    Yes, Members is missing a check in the current public version if using the "Content Permissions" option. This is fixed in my dev copy, which I hope to release soon.

    If you add this at the top of the members_content_permissions_save_meta() function in the members/components/content-permissions/meta-box.php file, it should fix it:

    if ( !isset( $_POST['content_permissions_meta_nonce'] ) || !wp_verify_nonce( $_POST['content_permissions_meta_nonce'], basename( __FILE__ ) ) )
    	return false;

    Note that I haven't tested this with previous versions though.

  4. TPH31
    Member
    Posted 3 years ago #

    Awesome. Thanks allot gents. works perfectly.

    14 hours after I posted it, amazing!

  5. TPH31
    Member
    Posted 3 years ago #

    Greenshady, well I think I spoke too soon. Yes, fee does not wipe/alter the Content Permission settings anymore, but I also can't change the settings when creating or editing a page anymore.

  6. TPH31
    Member
    Posted 3 years ago #

    Greenshady, well I think I spoke too soon. Yes, fee does not wipe/alter the Content Permission settings anymore, but I also can't change the settings when creating or editing a page anymore.

  7. scribu
    Member
    Plugin Author

    Posted 3 years ago #

    TPH31: Please don't bump threads like that.

    Try the check I proposed instead or try upgrading to the development version of the Members plugin.

  8. TPH31
    Member
    Posted 3 years ago #

    Scribu, my appologies. I was not sure how to change the thread from Resolved.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic