| 1 |
<?php |
| 2 |
|
| 3 |
declare(strict_types=1); |
| 4 |
|
| 5 |
/** |
| 6 |
* BeyondWords Post ErrorNotice. |
| 7 |
* |
| 8 |
* @package Beyondwords\Wordpress |
| 9 |
* @author Stuart McAlpine <stu@beyondwords.io> |
| 10 |
* @since 3.0.0 |
| 11 |
*/ |
| 12 |
|
| 13 |
namespace Beyondwords\Wordpress\Component\Post\ErrorNotice; |
| 14 |
|
| 15 |
use Beyondwords\Wordpress\Core\CoreUtils; |
| 16 |
|
| 17 |
/** |
| 18 |
* ErrorNotice setup |
| 19 |
* |
| 20 |
* @since 3.0.0 |
| 21 |
*/ |
| 22 |
class ErrorNotice |
| 23 |
{ |
| 24 |
/** |
| 25 |
* Constructor |
| 26 |
*/ |
| 27 |
public function __construct() |
| 28 |
{ |
| 29 |
add_action('enqueue_block_assets', array($this, 'enqueueBlockAssets')); |
| 30 |
} |
| 31 |
|
| 32 |
public function enqueueBlockAssets() |
| 33 |
{ |
| 34 |
// Only enqueue for Gutenberg screens |
| 35 |
if (CoreUtils::isGutenbergPage()) { |
| 36 |
// Register the Block Editor "Error Notice" CSS |
| 37 |
wp_enqueue_style( |
| 38 |
'beyondwords-ErrorNotice', |
| 39 |
BEYONDWORDS__PLUGIN_URI . 'src/Component/Post/ErrorNotice/error-notice.css', |
| 40 |
array(), |
| 41 |
BEYONDWORDS__PLUGIN_VERSION |
| 42 |
); |
| 43 |
} |
| 44 |
} |
| 45 |
} |
| 46 |
|