Skip to content

Commit 1982f67

Browse files
resolves conflicts
2 parents eddcd1c + 7c81c02 commit 1982f67

File tree

5 files changed

+24
-26
lines changed

5 files changed

+24
-26
lines changed

bootstrap.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
use Underpin\Abstracts\Underpin;
4+
use Underpin\Factories\Observers\Loader;
5+
6+
if ( ! defined( 'ABSPATH' ) ) {
7+
exit;
8+
}
9+
10+
// Add this loader.
11+
Underpin::attach( 'setup', new Loader('admin_bar_menus', [
12+
'instance' => 'Underpin\Admin_Bar_Menu\Abstracts\Admin_Bar_Menu',
13+
'default' => 'Underpin\Admin_Bar_Menu\Factories\Admin_Bar_Menu_Instance',
14+
] ) );

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@
1010
}
1111
],
1212
"require": {
13-
"underpin/logger-loader": "^2.0"
13+
"underpin/underpin": "^2.0"
1414
},
1515
"autoload": {
16+
"psr-4": {"Underpin\\Admin_Bar_Menu\\": "lib/"},
1617
"files": [
17-
"underpin-admin-bar-menus.php"
18+
"bootstrap.php"
1819
]
1920
}
2021
}

Admin_Bar_Menu.php renamed to lib/Abstracts/Admin_Bar_Menu.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
*/
88

99

10-
namespace Underpin_Admin_Bar_Menu\Abstracts;
10+
namespace Underpin\Admin_Bar_Menu\Abstracts;
1111

1212

13+
use Underpin\Loaders\Logger;
1314
use Underpin\Traits\Feature_Extension;
1415
use WP_Admin_Bar;
1516
use WP_User;
16-
use function Underpin\underpin;
1717

1818
if ( ! defined( 'ABSPATH' ) ) {
1919
exit;
@@ -128,7 +128,7 @@ public function add_admin_bar( WP_Admin_Bar $admin_bar ) {
128128
$args = $this->args;
129129
$args['id'] = $this->id;
130130

131-
underpin()->logger()->log(
131+
Logger::log(
132132
'notice',
133133
'child_menu_added',
134134
'An admin bar menu item, ' . $this->id . ' was added'
@@ -142,14 +142,14 @@ public function add_admin_bar( WP_Admin_Bar $admin_bar ) {
142142

143143
$admin_bar->add_menu( $child );
144144

145-
underpin()->logger()->log(
145+
Logger::log(
146146
'notice',
147147
'child_menu_added',
148148
'A child menu item, ' . $id . ' was added to the ' . $this->name . ' admin bar menu.'
149149
);
150150
}
151151
} else {
152-
underpin()->logger()->log(
152+
Logger::log(
153153
'warning',
154154
'user_cannot_view_menu',
155155
'The specified user cannot view the ' . $this->name . ' menu. It will not be displayed.',

Admin_Bar_Menu_Instance.php renamed to lib/Factories/Admin_Bar_Menu_Instance.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,11 @@
77
*/
88

99

10-
namespace Underpin_Admin_Bar_Menu\Factories;
10+
namespace Underpin\Admin_Bar_Menu\Factories;
1111

1212

1313
use Underpin\Traits\Instance_Setter;
14-
use Underpin_Admin_Bar_Menu\Abstracts\Admin_Bar_Menu;
15-
use WP_Admin_Bar;
16-
use WP_User;
17-
use function Underpin\underpin;
14+
use Underpin\Admin_Bar_Menu\Abstracts\Admin_Bar_Menu;
1815

1916
if ( ! defined( 'ABSPATH' ) ) {
2017
exit;

underpin-admin-bar-menus.php

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)