Automattic\WooCommerce\Internal\CLI\Migrator\Lib
ImportSession::by_id
Gets an existing import session by ID.
Метод класса: ImportSession{}
Хуков нет.
Возвращает
WP_Import_Model|null. The import model instance or null if not found
Использование
$result = ImportSession::by_id( $post_id );
- $post_id(int) (обязательный)
- The import session post ID.
Код ImportSession::by_id() ImportSession::by id WC 10.9.4
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 );
}