• Resolved mickna

    (@mickna)


    Hi there,

    is there the possibility to set the visibility to public instead to private by default? Maybe a filter, hook?

    Thank you,

    Michael

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor nwjames

    (@nwjames)

    There is a filter available for this. It is call document_to_private.

    If you wish to revert to standard processing, then create a file called wpdr_revert_private.php in the directory wp-content/mu-plugins.

    You may need to create this sub-directory. Then copy this code into it:

    <?php
    add_filter( 'document_to_private', 'revert_private', 10, 2 );
    
    if ( ! function_exists('revert_private') ) {
    	/**
    	 * Reverts the document status from private.
    	 *
    	 * @since 0.5
    	 *
    	 * @param WP_Post $post     link to (new) global post.
    	 * @param WP_Post $post_pre link to clone of global post.
    	 */
    	function revert_private( $post, $post_pre ) {
    		return $post_pre;
    	}
    }
    

    The doc-comments are essentially those from the filter itself showing its parameters. The result will be that you get a draft post displayed that you can publish after you have uploaded a document file.

    Hope this is of use,

    Neil James

    Thread Starter mickna

    (@mickna)

    Hi Neil,

    sorry for my late replay.

    Thank you 🙂

    Plugin Contributor nwjames

    (@nwjames)

    I’ll mark it resolved.

    Neil James

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘set visibility to public by default?’ is closed to new replies.