WP_REST_Request::parse_body_params

Advertisement

Summery Summery

Parses the request body parameters.

Syntax Syntax

WP_REST_Request::parse_body_params()

Description Description

Parses out URL-encoded bodies for request methods that aren’t supported natively by PHP. In PHP 5.x, only POST has these parsed automatically.

Source Source

File: wp-includes/rest-api/class-wp-rest-request.php

		$this->params['JSON'] = $params;

		return true;
	}

	/**
	 * Parses the request body parameters.
	 *
	 * Parses out URL-encoded bodies for request methods that aren't supported
	 * natively by PHP. In PHP 5.x, only POST has these parsed automatically.
	 *
	 * @since 4.4.0
	 */
	protected function parse_body_params() {
		if ( $this->parsed_body ) {
			return;
		}

		$this->parsed_body = true;

		/*
		 * Check that we got URL-encoded. Treat a missing content-type as
		 * URL-encoded for maximum compatibility.
		 */

Advertisement

Changelog Changelog

Changelog
Version Description
4.4.0 Introduced.

Advertisement

Leave a Reply