Automattic\WooCommerce\Internal\CLI\Migrator\Lib
ImportSession::by_id
Gets an existing import session by ID.
Method of the class: ImportSession{}
No Hooks.
Returns
WP_Import_Model|null. The import model instance or null if not found
Usage
$result = ImportSession::by_id( $post_id );
- $post_id(int) (required)
- The import session post ID.
ImportSession::by_id() ImportSession::by id code WC 10.7.0
public static function by_id( $post_id ) {
$post = get_post( $post_id );
if ( ! $post || $post->post_type !== self::POST_TYPE ) {
return false;
}
return new self( $post_id );
}