wp_xmlrpc_server::minimum_args() WordPress Method

The wp_xmlrpc_server::minimum_args() method is used to retrieve the minimum number of arguments that a specific XML-RPC method needs. This can be useful for methods that accept optional arguments, to ensure that the minimum required arguments are provided.

wp_xmlrpc_server::minimum_args( array $args, int $count ) #

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


Parameters

$args

(array)(Required)An array of arguments to check.

$count

(int)(Required)Minimum number of arguments.


Top ↑

Return

(bool) True if $args contains at least $count arguments, false otherwise.


Top ↑

Source

File: wp-includes/class-wp-xmlrpc-server.php

	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;
	}


Top ↑

Changelog

Changelog
VersionDescription
3.4.0Introduced.

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.

Show More
Show More