Admin_Notices_API
Class to handle admin notices.
Namespace: WebberZone\Contextual_Related_Posts\Admin
Source: includes/admin/class-admin-notices-api.php line 20
Methods
__construct()
Constructor class.
Line: 41
public function __construct( string $prefix = ... );
| Type | Name | Description |
|---|---|---|
string |
$prefix |
Plugin prefix for AJAX actions, nonces, and storage keys. Default ‘crp’. |
enqueue_scripts()
Register and enqueue the dismiss script, pushing this instance’s config into the shared window.adminNoticesConfigs array.
Line: 53
public function enqueue_scripts( );
register_notice()
Register a new notice.
Line: 98
public function register_notice( array $notice );
| Type | Name | Description |
|---|---|---|
array |
$notice |
{ |
display_notices()
Display registered notices.
Line: 122
public function display_notices( );
handle_notice_dismissal()
Handle notice dismissal via AJAX.
Line: 170
public function handle_notice_dismissal( );