Calls wp_write_post() and handles the errors.

Return Return

(int|void) Post ID on success, void on failure.

Top ↑

Source Source

File: wp-admin/includes/post.php

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

Top ↑

Changelog Changelog

Version Description
2.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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