wp_xmlrpc_server::minimum_args()protectedWP 3.4.0

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

Метод класса: wp_xmlrpc_server{}

Хуков нет.

Возвращает

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

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->minimum_args( $args, $count );
$args(массив) (обязательный)
An array of arguments to check.
$count(int) (обязательный)
Minimum number of arguments.

Список изменений

С версии 3.4.0 Введена.

Код wp_xmlrpc_server::minimum_args() WP 6.5.2

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