Returns:
-
Mixed
An object of the given class, if the class exists.
-
WOOF_Silent
An object for silent failure, if there is no class by the name given.
Attempts to instantiate a class representing this post for the given class name and arguments, and if successful returns that class. If not arguments are provided, this method assumes the post ID as a single argument.
This method is useful for third party plugins that contain classes you can instantiate.
Parameters:
-
The name of a class to instantiate
-
Array $arguments
An array of arguments to pass through to the class constructor. If this is not provided, it will be assumed to be a single item array containing the post ID.