Skip to content

Commit

Permalink
Merge commit '5c98fde'
Browse files Browse the repository at this point in the history
  • Loading branch information
alexstandiford committed Nov 23, 2021
2 parents 2222ff2 + 5c98fde commit b7010de
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 25 deletions.
12 changes: 12 additions & 0 deletions bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

use Underpin\Abstracts\Underpin;

if ( ! defined( 'ABSPATH' ) ) {
exit;
}

// Add this loader.
Underpin::attach( 'setup', new \Underpin\Factories\Observers\Loader( 'meta', [
'class' => 'Underpin\Meta\Loaders\Meta',
] ) );
6 changes: 5 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@
"email": "[email protected]"
}
],
"require": {
"underpin/underpin": "^2.0"
},
"autoload": {
"psr-4": {"Underpin\\Meta\\": "lib/"},
"files": [
"meta.php"
"bootstrap.php"
]
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Underpin_Meta\Abstracts;
namespace Underpin\Meta\Abstracts;

use Underpin\Traits\Feature_Extension;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace Underpin_Meta\Factories;
namespace Underpin\Meta\Factories;

use Underpin\Traits\Instance_Setter;
use Underpin_Meta\Abstracts\Meta_Record_Type;
use Underpin\Meta\Abstracts\Meta_Record_Type;

if ( ! defined( 'ABSPATH' ) ) {
exit;
Expand Down
14 changes: 7 additions & 7 deletions lib/loaders/Meta.php → lib/Loaders/Meta.php
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
<?php

namespace Underpin_Meta\Loaders;
namespace Underpin\Meta\Loaders;

if ( ! defined( 'ABSPATH' ) ) {
exit;
}

use Underpin\Abstracts\Registries\Loader_Registry;
use Underpin\Abstracts\Registries\Object_Registry;

class Meta extends Loader_Registry {
class Meta extends Object_Registry {

protected $abstraction_class = 'Underpin_Meta\Abstracts\Meta_Record_Type';
protected $abstraction_class = 'Underpin\Meta\Abstracts\Meta_Record_Type';

protected $default_factory = 'Underpin_Meta\Factories\Meta_Record_Type_Instance';
protected $default_factory = 'Underpin\Meta\Factories\Meta_Record_Type_Instance';

protected function set_default_items() {
}

/**
* @param string $key
*
* @return \Underpin_Meta\Abstracts\Meta_Record_Type|\WP_Error Post Meta instance, if it exists. WP_Error, otherwise.
* @return \Underpin\Meta\Abstracts\Meta_Record_Type|\WP_Error Post Meta instance, if it exists. WP_Error, otherwise.
*/
public function get( $key ) {
return parent::get( $key );
Expand All @@ -34,7 +34,7 @@ public function get( $key ) {
* @param bool $single Optional. If true, return only the first value of the specified meta_key.
* This parameter has no effect if meta_key is not specified. Default false.
*
* @return mixed|\Underpin_Meta\Abstracts\Meta_Record_Type|void|\WP_Error
* @return mixed|\Underpin\Meta\Abstracts\Meta_Record_Type|void|\WP_Error
*/
public function get_meta( $key, $object_id, $single = false ) {
$value = $this->get( $key );
Expand Down
14 changes: 0 additions & 14 deletions meta.php

This file was deleted.

0 comments on commit b7010de

Please sign in to comment.