wp_xmlrpc_server::escape( string|array $data )

Escape string or array of strings for database.


Description Description


Parameters Parameters

$data

(string|array) (Required) Escape single string or array of strings.


Top ↑

Return Return

(string|void) Returns with string is passed, alters by-reference when array is passed.


Top ↑

Source Source

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

	public function escape( &$data ) {
		if ( ! is_array( $data ) ) {
			return wp_slash( $data );
		}

		foreach ( $data as &$v ) {
			if ( is_array( $v ) ) {
				$this->escape( $v );
			} elseif ( ! is_object( $v ) ) {
				$v = wp_slash( $v );
			}
		}
	}

Top ↑

Changelog Changelog

Changelog
Version Description
1.5.2 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.