acf_new_instance()
acf_new_instance
Creates a new instance of the given class and stores it in the instances data store.
No Hooks.
Returns
Object. The instance.
Usage
acf_new_instance( $class );
- $class(string)
- The class name.
Default:''
Changelog
| Since 5.7.10 | Introduced. |
acf_new_instance() acf new instance code ACF 6.0.4
function acf_new_instance( $class = '' ) {
global $acf_instances;
return $acf_instances[ $class ] = new $class();
}