wp_xmlrpc_server::minimum_args()protectedWP 3.4.0

Checks if the method received at least the minimum number of arguments.

Method of the class: wp_xmlrpc_server{}

No Hooks.

Return

true|false. True if $args contains at least $count arguments, false otherwise.

Usage

// protected - for code of main (parent) or child class
$result = $this->minimum_args( $args, $count );
$args(array) (required)
An array of arguments to check.
$count(int) (required)
Minimum number of arguments.

Changelog

Since 3.4.0 Introduced.

wp_xmlrpc_server::minimum_args() code WP 6.4.3

protected function minimum_args( $args, $count ) {
	if ( ! is_array( $args ) || count( $args ) < $count ) {
		$this->error = new IXR_Error( 400, __( 'Insufficient arguments passed to this XML-RPC method.' ) );
		return false;
	}

	return true;
}