write_post() │ WP 2.0.0

Calls wp_write_post() and handles the errors.

Хуков нет.

Возвращает

int. Post ID on success. Dies on failure.

Использование

write_post();

Список изменений

С версии 2.0.0 Введена.

Код write_post() WP 7.1.3

function write_post() {
	$result = wp_write_post();
	if ( is_wp_error( $result ) ) {
		wp_die( $result->get_error_message() );
	}

	return $result;
}