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

  1. marv51
    Posted 4 years ago #

    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



  2. Ben Balter
    Plugin Author

    Posted 4 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
    Posted 4 years ago #

    Thanks, that works for me.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Document Revisions
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.