WordPress.org

Ready to get started?Download WordPress

Forums

Docs to WordPress
[resolved] Auto-Publish (2 posts)

  1. crazysurf123
    Member
    Posted 1 year ago #

    Hey,

    i've spent the night trying to add filter which will allow to publish directly and not set it as draft :)

    Can you please help me.

    Best regards.

    http://wordpress.org/extend/plugins/docs-to-wordpress/

  2. William P. Davis
    Member
    Plugin Author

    Posted 1 year ago #

    This is similar to the question posed at http://wordpress.org/support/topic/plugin-docs-to-wordpress-id-love-to-use-this-for-pages-rather-than-posts and the answer is the same, with a slight twist.

    You can extend the Docs to WordPress plugin using the pre_docs_to_wp_insert filter. The plugin would look like this:

    <?php
    /*
    Plugin Name: Docs to WP auto publish
    */
    
    add_filter( 'pre_docs_to_wp_insert', 'docs_to_wp_auto_publish' );
    function docs_to_wp_auto_publish( $post_array = array() ) {
         $post_array[ 'post_status' ] = 'publish';
         return $post_array;
    }

    I haven't tested this, but it should do the trick.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.