wp_xmlrpc_server::addTwoNumbers() WordPress Method

The wp_xmlrpc_server::addTwoNumbers() method is used to add two numbers together. This method is part of the XML-RPC API and is available in WordPress versions 4.4 and higher.

wp_xmlrpc_server::addTwoNumbers( array $args ) #

Test XMLRPC API by adding two numbers for client.


Parameters

$args

(array)(Required)Method arguments. Note: arguments must be ordered as documented.

  • 'number1'
    (int) A number to add.
  • 'number2'
    (int) A second number to add.


Top ↑

Return

(int) Sum of the two given numbers.


Top ↑

Source

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

	public function addTwoNumbers( $args ) {
		$number1 = $args[0];
		$number2 = $args[1];
		return $number1 + $number2;
	}

Top ↑

Changelog

Changelog
VersionDescription
1.5.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