Skip to content

General

linchpin edited this page Feb 22, 2023 · 10 revisions

General

Settings Class.

  • Full name: \CourierNotices\Controller\Admin\Settings\General

Properties

settings_page

Define our settings page

public static string $settings_page
  • This property is static.

plugin_name

Give our plugin a name

public static string $plugin_name
  • This property is static.

type_list_table

Instance of Type_List_Table

private static \CourierNotices\Helper\Type_List_Table $type_list_table
  • This property is static.

options

private array $options

Methods

__construct

General constructor.

public __construct(string $settings = 'courier_design'): mixed

Parameters:

Parameter Type Description
$settings string

register_actions

Initialize our plugin settings

public register_actions(): mixed

show_design_sub_settings

Show our license area to activate or deactivate our license key

public show_design_sub_settings(mixed $options): mixed

Parameters:

Parameter Type Description
$options mixed

add_admin_menu

Add the options page to our settings menu

public add_admin_menu(): mixed

add_settings_link

Add settings link

public add_settings_link(array $actions, string $plugin_file): array

Parameters:

Parameter Type Description
$actions array Actions.
$plugin_file string Plugin file.

create_section

Create our settings section

public create_section(array $args): mixed

Parameters:

Parameter Type Description
$args array Array of arguments.

settings_init

Add all of our settings from the API

public settings_init(): mixed

get_styles

Get available styles of Courier Notices

public static get_styles(): mixed|void

1.3.0

  • This method is static.

merge_options

Preserve options when using multiple pages

public merge_options( $data): array

Parameters:

Parameter Type Description
$data ****

setup_general_settings

Get our general settings registered

private setup_general_settings(): mixed

add_notice_title_display_options

Add option title display based on each "style" of notice

private add_notice_title_display_options( $tab_section): mixed

Parameters:

Parameter Type Description
$tab_section ****

setup_design_global_settings

Design Panel

private setup_design_global_settings(): mixed

setup_design_type_settings

Setup our different types of informational courier notices

private setup_design_type_settings(): mixed

add_settings_page

Add our options page wrapper Form

public static add_settings_page(): mixed
  • This method is static.

apply_tab_slug_filters

Allow filtering of the settings tabs

private static apply_tab_slug_filters(array $default_settings): array
  • This method is static.

Parameters:

Parameter Type Description
$default_settings array Default settings array.

get_default_tab_slug

Get the default tab slug

public static get_default_tab_slug(): mixed
  • This method is static.

get_tabs

Retrieve settings tabs

public static get_tabs(): array
  • This method is static.

Return Value:

$tabs Settings tabs


get_sub_tabs

Build out our submenu if we have one.

public static get_sub_tabs(string $parent_tab): mixed

Allow for this to be extended by addons.

  • This method is static.

Parameters:

Parameter Type Description
$parent_tab string The parent of the sub tab to retrieve.

get_request_param

Utility Method to get a request parameter within the admin Strip it of malicious things.

public static get_request_param(string $key, string $default = ''): string
  • This method is static.

Parameters:

Parameter Type Description
$key string The parameter key.
$default string The default value.


Automatically generated from source code comments on 2023-02-22 using phpDocumentor and saggre/phpdocumentor-markdown