Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Takuro Hishikawa

    (@hissy)

    You will be able to change post status with filter hook.
    Eg: Save below php code as php file, and upload and activate it.

    <?php
    /*
    Plugin Name: Really Simple CSV Importer Publish Immediately add-on
    Version: 0.1
    */
    
    class rscsvi_publish_immediately {
    	// singleton instance
    	private static $instance;
    
    	public static function instance() {
    		if ( isset( self::$instance ) )
    			return self::$instance;
    
    		self::$instance = new rscsvi_publish_immediately;
    		self::$instance->run_init();
    		return self::$instance;
    	}
    
    	private function __construct() {
    		/** Do nothing **/
    	}
    
    	protected function run_init() {
    		add_action( 'init', array( $this, 'add_filter' ) );
    	}
    
    	public function add_filter() {
    		add_filter( 'really_simple_csv_importer_save_post', array( $this, 'filter_save_post'), 10, 2 );
    	}
    
    	public function filter_save_post($post, $is_update) {
    		if ( ! $is_update ) {
    			$post['post_status'] = 'publish';
    		}
    		return $post;
    	}
    
    }
    
    $rscsvi_publish_immediately = rscsvi_publish_immediately::instance();
    Thread Starter articlescholar

    (@articlescholar)

    Thanks for this. It worked for up to 3k posts only. Then it stops, redirects to an error page.

    I tested with several server configurations and even sent all to max, but unfortunately it didn’t improve the results.

    Plugin Author Takuro Hishikawa

    (@hissy)

    Several reasons can generate errors while importing. I have some questions.

    1. Could you check your error message? If you got white page, you should turn debug mode on.
    2. Every time stops when imported 3k posts even if you change server variables? If so, what is on line 3000 and 3001?

    Thread Starter articlescholar

    (@articlescholar)

    1. It’s a 404 page not found error… it just appears like it’s a timeout. This is the end URL:

    wp-admin/admin.php?import=csv&step=1&_wpnonce=779fc6969d

    2. Same as what’s on line 2-3000. The post details.

    Thread Starter articlescholar

    (@articlescholar)

    When not using Publish Immediately Add-on, the importer can accept as much as 40,000 posts.

    Plugin Author Takuro Hishikawa

    (@hissy)

    Sorry to late response. Would you try to increase max_input_vars value of php?

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Set yo publish as default’ is closed to new replies.