Gets an instance of the store.
Parameters
$store_name
stringoptional- The name of the store.
Default:
'default'
Source
public static function get_store( $store_name = 'default' ) {
if ( ! is_string( $store_name ) || empty( $store_name ) ) {
return;
}
if ( ! isset( static::$stores[ $store_name ] ) ) {
static::$stores[ $store_name ] = new static();
// Set the store name.
static::$stores[ $store_name ]->set_name( $store_name );
}
return static::$stores[ $store_name ];
}
Changelog
Version | Description |
---|---|
6.1.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.