WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

wp_xmlrpc_server::wp_getProfile() WP 1.0

Retrieve information about the requesting user.

Это метод класса: wp_xmlrpc_server

Хуки из метода
Возвращает

Массив/IXR_Error. (@see wp_getUser)

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

$wp_xmlrpc_server = new wp_xmlrpc_server();
$var = $wp_xmlrpc_server->wp_getProfile( $args );
$args(массив) (обязательный)

Method arguments. Note: arguments must be ordered as documented.

  • $blog_id (число)
    (unused)

  • $username (строка)

  • $password (строка)

  • $fields (массив)
    (optional)

Код wp xmlrpc server::wp getProfile: wp-includes/class-wp-xmlrpc-server.php WP 5.4.2

<?php
public function wp_getProfile( $args ) {
	if ( ! $this->minimum_args( $args, 3 ) ) {
		return $this->error;
	}

	$this->escape( $args );

	$username = $args[1];
	$password = $args[2];

	if ( isset( $args[3] ) ) {
		$fields = $args[3];
	} else {
		/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
		$fields = apply_filters( 'xmlrpc_default_user_fields', array( 'all' ), 'wp.getProfile' );
	}

	$user = $this->login( $username, $password );
	if ( ! $user ) {
		return $this->error;
	}

	/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
	do_action( 'xmlrpc_call', 'wp.getProfile' );

	if ( ! current_user_can( 'edit_user', $user->ID ) ) {
		return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit your profile.' ) );
	}

	$user_data = get_userdata( $user->ID );

	return $this->_prepare_user( $user_data, $fields );
}