Tribe__Utils__Callback::__call( string $method, $args )
Calls the Lambda function provided by Di52 to allow passing of Params without having to create more methods into classes for simple callbacks that will only have a pre-determined value.
Contents
Parameters
- $slug
-
(string) (Required) A class or interface fully qualified name or a string slug.
- $method
-
(string) (Required) The method that should be called on the resolved implementation with the specified array arguments.
Return
(mixed) The Return value used
Source
File: src/Tribe/Utils/Callback.php
public function __call( $method, $args ) {
$key = str_replace( $this->prefix, '', $method );
if ( ! isset( $this->items[ $key ] ) ) {
return false;
}
$item = $this->items[ $key ];
// Allow for previous compatibility with tribe_callback
if ( ! $item->is_empty ) {
$args = $item->arguments;
}
return call_user_func_array( $item->callback, $args );
}
Changelog
| Version | Description |
|---|---|
| 4.6.2 | Introduced. |