Skip to content

Commit

Permalink
Merge commit 'f1d215a'
Browse files Browse the repository at this point in the history
  • Loading branch information
alexstandiford committed Nov 23, 2021
2 parents 0bbac7c + f1d215a commit 267e824
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 27 deletions.
17 changes: 0 additions & 17 deletions admin-notices.php

This file was deleted.

16 changes: 16 additions & 0 deletions bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

use Underpin\Abstracts\Underpin;
use Underpin\Factories\Observers\Loader;

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

define( 'UNDERPIN_ADMIN_NOTICES_ROOT_DIR', __DIR__ );

// Add this loader.
Underpin::attach( 'setup', new Loader( 'admin_notices', [
'instance' => 'Underpin\Admin_Notices\Abstracts\Admin_Notice',
'default' => 'Underpin\Admin_Notices\Factories\Admin_Notice_Instance',
] ) );
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@
}
],
"require": {
"underpin/logger-loader": "^2.0"
"underpin/underpin": "^2.0"
},
"autoload": {
"psr-4": {"Underpin\\Admin_Notices\\": "lib/"},
"files": [
"admin-notices.php"
"bootstrap.php"
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
*/


namespace Underpin_Admin_Notices\Abstracts;
namespace Underpin\Admin_Notices\Abstracts;

use Underpin\Loaders\Logger;
use Underpin\Traits\Feature_Extension;
use Underpin\Traits\Templates;
use function Underpin\underpin;

if ( ! defined( 'ABSPATH' ) ) {
exit;
Expand Down Expand Up @@ -60,7 +60,7 @@ public function render_callback() {
$should_display = $this->should_display();

if ( is_wp_error( $should_display ) ) {
underpin()->logger()->log_as_error(
Logger::log_as_error(
'notice',
'underpin_notice_did_not_display',
'A notice did not display.',
Expand All @@ -73,7 +73,7 @@ public function render_callback() {
$notice = $this->render_notice();

if ( is_wp_error( $notice ) ) {
underpin()->logger()->log_wp_error( 'warning', $notice );
Logger::log_wp_error( 'warning', $notice );

return;
}
Expand Down Expand Up @@ -145,7 +145,7 @@ protected function get_template_group() {
* @inheritDoc
*/
protected function get_template_root_path() {
return UNDERPIN_ADMIN_NOTICES_ROOT_DIR . 'templates';
return UNDERPIN_ADMIN_NOTICES_ROOT_DIR . '/templates';
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
*/


namespace Underpin_Admin_Notices\Factories;
namespace Underpin\Admin_Notices\Factories;


use Underpin\Traits\Instance_Setter;
use Underpin_Admin_Notices\Abstracts\Admin_Notice;
use Underpin\Admin_Notices\Abstracts\Admin_Notice;

if ( ! defined( 'ABSPATH' ) ) {
exit;
Expand Down
2 changes: 1 addition & 1 deletion templates/admin-notice/notice.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
exit;
}

if ( ! isset( $template ) || ! $template instanceof Underpin_Admin_Notices\Abstracts\Admin_Notice ) {
if ( ! isset( $template ) || ! $template instanceof Underpin\Admin_Notices\Abstracts\Admin_Notice ) {
return;
}

Expand Down

0 comments on commit 267e824

Please sign in to comment.