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
Contents
Description
Note: Unlike post and put, $headers
is required, as the specification recommends that should send an ETag
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); }
Expand full source codeCollapse full source codeView on TracView on GitHub