*** # Courier Courier Class * Full name: `\CourierNotices\Controller\Courier` ## Methods ### register_actions Register the hooks and filters ```php public register_actions(): mixed ``` *** ### remove_editor_styles Remove editor styles when viewing a Courier Notice in the admin ```php public remove_editor_styles(): mixed ``` This is needed for BOTH the classic editor as well as when utilizing the Block editor. *** ### add_expired_status Adds a custom post status for expired notices ```php public add_expired_status(): mixed ``` *** ### post_updated_messages Post updated messages ```php public post_updated_messages(array $messages): mixed ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$messages` | **array** | Array of messages. | *** ### views_addition Add a links for global and expired notices in the admin table view. ```php public views_addition(array $views): array ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$views` | **array** | Array of views. | *** ### get_scope_options Get a list of available post types to select from. ```php private get_scope_options(): array|mixed|void ``` **Return Value:** List of public/visible post types. *** ### get_notice_selected_type Get the currently selected type of notice. ```php public get_notice_selected_type(mixed $post_id): string ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$post_id` | **mixed** | | *** ### save_post_courier_notice Save our notice data ```php 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. | *** ### wp_insert_post When creating new notice for a specific user, log who created it. ```php 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. | *** ### query_vars Add some custom query vars ```php public query_vars(array $vars): array ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$vars` | **array** | Array of vars. | *** ### request Force a login when trying to visit the notifications page ```php public request(array $vars): mixed ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$vars` | **array** | Array of vars. | *** ### pre_get_posts Use custom query vars to include specific scopes of notices ```php public pre_get_posts(object $query): mixed ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$query` | **object** | Query object. | *** ### template_include If a custom template exists in the current theme for notifications, use that one instead. ```php public template_include(string $template): string ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$template` | **string** | The template to include. | *** ### document_title_parts When viewing the notification page, filter the title. ```php public document_title_parts(mixed $title): mixed ``` **Parameters:** | Parameter | Type | Description | |-----------|------|-------------| | `$title` | **mixed** | The title. | *** ### post_class Add classes for dismissed and global notice for notices. ```php 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