WP_Query::__call() WordPress Method

The WP_Query::__call() method is used to call a specific method on the $wp_query object. This is useful for customizing the behavior of the query without having to modify the core code.

WP_Query::__call( string $name, array $arguments ) #

Make private/protected methods readable for backward compatibility.


Parameters

$name

(string)(Required)Method to call.

$arguments

(array)(Required)Arguments to pass when calling.


Top ↑

Return

(mixed|false) Return value of the callback, false otherwise.


Top ↑

Source

File: wp-includes/class-wp-query.php

	public function __call( $name, $arguments ) {
		if ( in_array( $name, $this->compat_methods, true ) ) {
			return $this->$name( ...$arguments );
		}
		return false;
	}

Top ↑

Changelog

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