WPLib::get_callable PHP Method

get_callable() static public method

Given an object/class name and method name return a callable or null if can't be called.
static public get_callable ( string | object $object, string $method_name ) : callable | null
$object string | object
$method_name string
return callable | null
    static function get_callable($object, $method_name)
    {
        $callable = array($object, $method_name);
        return is_callable($callable) && method_exists($object, $method_name) ? $callable : null;
    }