WordPress.org

Ready to get started?Download WordPress

Forums

WP Document Revisions
[resolved] Not private by default (3 posts)

  1. marv51
    Member
    Posted 2 years ago #

    Hi,
    I want to undo the make_private by default part of the plugin.
    There is a filter document_to_private that should enable this. It passes $post and $post_pre to the filter.
    My filter looks like this:

    add_filter( 'document_to_private', 'dont_make_private', 10, 2);
    function dont_make_private($post, $post_pre ){
    	return $post_pre;
    }

    This doesn't work.
    die($post->post_status); and die($post_pre->post_status); both result in private.
    My PHP version is 5.3.2-1ubuntu4.17 (?).
    Is that a bug?
    Thank you

    Marvin

    http://wordpress.org/extend/plugins/wp-document-revisions/

  2. Ben Balter
    Member
    Plugin Author

    Posted 2 years ago #

    It looks like $post_pre = $post is actually just assigning a reference, not cloning the post object. I've opened an issue on GitHub, and will be sure to get a fix out in the next version.

    In the mean time there are two options:

    1) In your function, set post_status back to draft manually

    2) remove document revisions make_private filter after the plugin adds it

  3. marv51
    Member
    Posted 2 years ago #

    Thanks, that works for me.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.