write_post(): int

In this article

Calls wp_write_post() and handles the errors.

Return

int Post ID on success. Dies on failure.

Source

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

	return $result;
}

Changelog

VersionDescription
2.0.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.