Skip to content

Commit

Permalink
Use the "factory" function to get storage registry
Browse files Browse the repository at this point in the history
  • Loading branch information
rilwis committed May 25, 2017
1 parent 698800b commit 3beab10
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions inc/functions.php
Expand Up @@ -195,21 +195,6 @@ function rwmb_get_registry( $type ) {
}
}

/**
* Get storage registry.
*
* @return RWMB_Storage_Registry
*/
function rwmb_get_storage_registry() {
static $registry = null;

if ( is_null( $registry ) ) {
$registry = new RWMB_Storage_Registry();
}

return $registry;
}

/**
* Get storage class name.
*
Expand Down Expand Up @@ -237,5 +222,5 @@ function rwmb_get_storage_class_name( $object_type ) {
*/
function rwmb_get_storage( $object_type ) {
$class_name = rwmb_get_storage_class_name( $object_type );
return rwmb_get_storage_registry()->get( $class_name );
return rwmb_get_registry( 'storage' )->get( $class_name );
}

0 comments on commit 3beab10

Please sign in to comment.