-
Notifications
You must be signed in to change notification settings - Fork 0
Courier
Courier Class
- Full name:
\CourierNotices\Controller\Courier
Register the hooks and filters
public register_actions(): mixed
Remove editor styles when viewing a Courier Notice in the admin
public remove_editor_styles(): mixed
This is needed for BOTH the classic editor as well as when utilizing the Block editor.
Adds a custom post status for expired notices
public add_expired_status(): mixed
Post updated messages
public post_updated_messages(array $messages): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$messages |
array | Array of messages. |
Add a links for global and expired notices in the admin table view.
public views_addition(array $views): array
Parameters:
Parameter | Type | Description |
---|---|---|
$views |
array | Array of views. |
Get a list of available post types to select from.
private get_scope_options(): array|mixed|void
Return Value:
List of public/visible post types.
Get the currently selected type of notice.
public get_notice_selected_type(mixed $post_id): string
Parameters:
Parameter | Type | Description |
---|---|---|
$post_id |
mixed |
Save our notice data
public save_post_courier_notice(int $post_id, object|array $post): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$post_id |
int | The post ID. |
$post |
object|array | The post object. |
When creating new notice for a specific user, log who created it.
public wp_insert_post(int $post_id, array|\WP_Post $post, bool $update): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$post_id |
int | The post ID. |
$post |
array|\WP_Post | The post object. |
$update |
bool | Insert or Update flag. |
Add some custom query vars
public query_vars(array $vars): array
Parameters:
Parameter | Type | Description |
---|---|---|
$vars |
array | Array of vars. |
Force a login when trying to visit the notifications page
public request(array $vars): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$vars |
array | Array of vars. |
Use custom query vars to include specific scopes of notices
public pre_get_posts(object $query): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$query |
object | Query object. |
If a custom template exists in the current theme for notifications, use that one instead.
public template_include(string $template): string
Parameters:
Parameter | Type | Description |
---|---|---|
$template |
string | The template to include. |
When viewing the notification page, filter the title.
public document_title_parts(mixed $title): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$title |
mixed | The title. |
Add classes for dismissed and global notice for notices.
public post_class(array $classes, string $class, int $post_id): array
Parameters:
Parameter | Type | Description |
---|---|---|
$classes |
array | Array of classes. |
$class |
string | The class. |
$post_id |
int | The post ID. |
Automatically generated on 2024-08-26