Requests::patch() WordPress Method

The patch() method is used to update a WordPress post or page. This method takes two parameters: the post ID and an array of data to be updated. The post ID is the ID of the post or page you want to update. The array of data to be updated is an associative array of key => value pairs. The keys are the field names and the values are the new values you want to set for those fields. For example, to update the post title and content, you would use the following array: array( 'post_title' => 'My New Title', 'post_content' => 'My new content.' ); This would update the title and content of the post with the ID of 123.

Requests::patch( $url,  $headers,  $data = array(),  $options = array() ) #

Send a PATCH request


Description

Note: Unlike post and put, $headers is required, as the specification recommends that should send an ETag


Top ↑

Source

File: wp-includes/class-requests.php

	public static function patch($url, $headers, $data = array(), $options = array()) {
		return self::request($url, $headers, $data, self::PATCH, $options);
	}

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.