Support » Plugin: WP Document Revisions » [Plugin: WP Document Revisions] Not private by default

  • Resolved marv51

    (@marv51)


    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/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Ben Balter

    (@benbalter)

    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

    Thanks, that works for me.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: WP Document Revisions] Not private by default’ is closed to new replies.