Documentation

Settings extends Engine

Class to initialise all defined page layouts.

Tags
since
1.5.0
see
Engine

Table of Contents

$a_arr_sections  : array<string|int, mixed>
Stores all Sections for the child sub-page.
$a_str_sub_page_hook  : null|string
Stores the Hook connection string for the child sub-page.
$plugin_name  : string
The ID of this plugin.
__construct()  : mixed
Initialize the class and set its properties.
amp_compat()  : mixed
Displays the AMP compatibility mode option.
custom_css()  : mixed
Displays the Custom CSS box.
custom_css_migration()  : mixed
Displays transitional legacy Custom CSS box.
custom_css_new()  : mixed
Displays the new Custom CSS box.
description()  : mixed
Output the description of a section. May be overwritten in any section.
display_content()  : mixed
Displays the content of specific sub-page.
donate()  : mixed
Displays all Donate button to support the developers.
excerpts()  : mixed
Displays the footnotes in excerpt setting.
get_priority()  : int
Returns a priority index.
hard_links()  : mixed
Displays all options for the fragment identifier configuration.
Help()  : mixed
Displays a short introduction to the plugin.
hyperlink_arrow()  : mixed
Displays all settings for the backlink symbol.
label_solution()  : mixed
Displays the setting for the input label issue solution.
lookup_hooks()  : mixed
Displays available Hooks to look for Footnote short codes.
love()  : mixed
Displays all settings for ‘I love Footnotes’ note.
mouseover_box()  : mixed
Displays enabled status for the footnotes mouse-over box.
mouseover_box_appearance()  : mixed
Displays style settings for the footnotes mouse-over box.
mouseover_box_dimensions()  : mixed
Displays dimensions setting for the footnotes mouse-over box.
mouseover_box_position()  : mixed
Displays position settings for the footnotes mouse-over box.
mouseover_box_text()  : mixed
Displays dedicated tooltip text settings for the footnotes mouse-over box.
mouseover_box_timing()  : mixed
Displays timing settings for the footnotes mouse-over box.
mouseover_box_truncation()  : mixed
Displays truncation settings for the footnotes mouse-over box.
numbering()  : mixed
Displays all options for the footnotes numbering.
reference_container()  : mixed
Displays all settings for the reference container.
register_sections()  : mixed
Registers all sections for a sub-page.
register_sub_page()  : mixed
Registers a sub-page.
scrolling()  : mixed
Displays all options for the scrolling behavior.
start_end()  : mixed
Displays all options for the footnotes start and end tag short codes.
superscript()  : mixed
Displays all settings for the footnote referrers.
add_checkbox()  : string
Constructs the HTML for a checkbox `<input>` element.
add_color_selection()  : string
Constructs the HTML for a text `<input>` element with the colour selection class.
add_label()  : string
Returns the HTML tag for an `<input>`/`<select>` label.
add_meta_box()  : array<string|int, mixed>
Returns an array describing a meta box.
add_num_box()  : string
Constructs the HTML for numeric `<input>` element.
add_section()  : array<string|int, mixed>
Returns an array describing a sub-page section.
add_select_box()  : string
Constructs the HTML for a `<select>` element.
add_text()  : string
Returns a simple text inside HTML `<span>` element.
add_text_box()  : string
Constructs the HTML for a text `<input>` element.
add_textarea()  : string
Constructs the HTML for a `<textarea>` element.
get_meta_boxes()  : array<string|int, array<string|int, mixed>>
Returns an array of all registered meta boxes for each section of the sub-page.
get_sections()  : array<string|int, array<string|int, mixed>>
Returns an array of all registered sections for the sub-page.
get_sub_page_slug()  : string
Returns the unique slug of the sub-page.
get_sub_page_title()  : string
Returns the title of the sub-page.
load_setting()  : array<string|int, mixed>
Loads a specified setting.
append_scripts()  : mixed
Append JavaScript and CSS files for specific sub-page.
register_meta_boxes()  : mixed
Registers all Meta boxes for a sub-page.
save_settings()  : bool
Save all plugin settings.

Properties

$a_arr_sections

Stores all Sections for the child sub-page.

protected array<string|int, mixed> $a_arr_sections = array()
Tags
access

protected

since
1.5.0

$a_str_sub_page_hook

Stores the Hook connection string for the child sub-page.

protected null|string $a_str_sub_page_hook = null
Tags
access

protected

since
1.5.0

$plugin_name

The ID of this plugin.

protected string $plugin_name
Tags
access

protected

since
2.8.0

Methods

__construct()

Initialize the class and set its properties.

public __construct(string $plugin_name) : mixed
Parameters
$plugin_name : string

The name of this plugin.

Tags
since
2.8.0
Return values
mixed

amp_compat()

Displays the AMP compatibility mode option.

public amp_compat() : mixed
Tags
since
2.6.0

(release)

Return values
mixed

custom_css()

Displays the Custom CSS box.

public custom_css() : mixed
Tags
since
1.5.0
Return values
mixed

custom_css_migration()

Displays transitional legacy Custom CSS box.

public custom_css_migration() : mixed
Tags
since
2.2.2
deprecated
Return values
mixed

custom_css_new()

Displays the new Custom CSS box.

public custom_css_new() : mixed
Tags
since
2.2.2
Return values
mixed

description()

Output the description of a section. May be overwritten in any section.

public description() : mixed
Tags
since
1.5.0
todo

Required? Should be abstract?

Return values
mixed

display_content()

Displays the content of specific sub-page.

public display_content() : mixed
Tags
since
1.5.0
todo

Review nonce verification.

Return values
mixed

donate()

Displays all Donate button to support the developers.

public donate() : mixed
Tags
since
1.5.0
Return values
mixed

excerpts()

Displays the footnotes in excerpt setting.

public excerpts() : mixed
Tags
since
1.5.0
Return values
mixed

get_priority()

Returns a priority index.

public get_priority() : int

Lower numbers have a higher priority.

Tags
since
1.5.0
Return values
int

Displays all options for the fragment identifier configuration.

public hard_links() : mixed
Tags
since
2.2.0
Return values
mixed

Help()

Displays a short introduction to the plugin.

public Help() : mixed
Tags
since
1.5.0
Return values
mixed

Displays all settings for the backlink symbol.

public hyperlink_arrow() : mixed
Tags
since
1.5.0
Return values
mixed

label_solution()

Displays the setting for the input label issue solution.

public label_solution() : mixed
Tags
since
2.5.12
Return values
mixed

lookup_hooks()

Displays available Hooks to look for Footnote short codes.

public lookup_hooks() : mixed

Priority level was initially a hard-coded default shows ‘9223372036854775807’ in the numbox empty should be interpreted as PHP_INT_MAX, but a numbox cannot be set to empty, see here define -1 as PHP_INT_MAX instead

Tags
since
1.5.5
Return values
mixed

love()

Displays all settings for ‘I love Footnotes’ note.

public love() : mixed
Tags
since
1.5.0
Return values
mixed

mouseover_box()

Displays enabled status for the footnotes mouse-over box.

public mouseover_box() : mixed
Tags
since
1.5.2
Return values
mixed

mouseover_box_appearance()

Displays style settings for the footnotes mouse-over box.

public mouseover_box_appearance() : mixed
Tags
since
2.2.0
Return values
mixed

mouseover_box_dimensions()

Displays dimensions setting for the footnotes mouse-over box.

public mouseover_box_dimensions() : mixed
Tags
since
2.2.0
Return values
mixed

mouseover_box_position()

Displays position settings for the footnotes mouse-over box.

public mouseover_box_position() : mixed
Tags
since
2.2.0
Return values
mixed

mouseover_box_text()

Displays dedicated tooltip text settings for the footnotes mouse-over box.

public mouseover_box_text() : mixed
Tags
since
2.2.0
Return values
mixed

mouseover_box_timing()

Displays timing settings for the footnotes mouse-over box.

public mouseover_box_timing() : mixed
Tags
since
2.2.0
Return values
mixed

mouseover_box_truncation()

Displays truncation settings for the footnotes mouse-over box.

public mouseover_box_truncation() : mixed
Tags
since
2.2.0
Return values
mixed

numbering()

Displays all options for the footnotes numbering.

public numbering() : mixed
Tags
since
2.2.0
Return values
mixed

reference_container()

Displays all settings for the reference container.

public reference_container() : mixed
Tags
since
1.5.0
Return values
mixed

register_sections()

Registers all sections for a sub-page.

public register_sections() : mixed
Tags
since
1.5.0
Return values
mixed

register_sub_page()

Registers a sub-page.

public register_sub_page() : mixed
Tags
since
1.5.0
Return values
mixed

scrolling()

Displays all options for the scrolling behavior.

public scrolling() : mixed
Tags
since
2.2.0
Return values
mixed

start_end()

Displays all options for the footnotes start and end tag short codes.

public start_end() : mixed
Tags
since
1.5.0
Return values
mixed

superscript()

Displays all settings for the footnote referrers.

public superscript() : mixed
Tags
since
1.5.0
Return values
mixed

add_checkbox()

Constructs the HTML for a checkbox `<input>` element.

protected add_checkbox(string $p_str_setting_name) : string
Parameters
$p_str_setting_name : string

Setting key.

Tags
access

protected

since
1.5.0
todo

Refactor HTML generation.

Return values
string

add_color_selection()

Constructs the HTML for a text `<input>` element with the colour selection class.

protected add_color_selection(string $p_str_setting_name) : string
Parameters
$p_str_setting_name : string

Setting key.

Tags
access

protected

since
1.5.6
todo

Refactor HTML generation.

todo

Use proper colorpicker element.

Return values
string

add_label()

Returns the HTML tag for an `<input>`/`<select>` label.

protected add_label(string $p_str_setting_name, string $p_str_caption) : string
Parameters
$p_str_setting_name : string

Settings key.

$p_str_caption : string

Label caption.

Tags
access

protected

since
1.5.0
todo

Refactor HTML generation.

Return values
string

add_meta_box()

Returns an array describing a meta box.

protected add_meta_box(string $p_str_section_id, string $p_str_id, string $p_str_title, string $p_str_callback_function_name) : array<string|int, mixed>
Parameters
$p_str_section_id : string

Parent section ID.

$p_str_id : string

Unique ID suffix.

$p_str_title : string

Title for the meta box.

$p_str_callback_function_name : string

Class method name for callback.

Tags
access

protected

since
1.5.0
todo

Refactor meta boxes into their own class?

todo

Pass actual functions rather than strings?

Return values
array<string|int, mixed>

{ A dashboard meta box.

@type  string  $parent  Parent section ID.
@type  string  $id  Meta box ID.
@type  string  $title  Meta box title.
@type  string  $callback  Meta box callback function.

}

add_num_box()

Constructs the HTML for numeric `<input>` element.

protected add_num_box(string $p_str_setting_name, int $p_in_min, int $p_int_max[, bool $p_bool_deci = false ]) : string
Parameters
$p_str_setting_name : string

Setting key.

$p_in_min : int

Minimum value.

$p_int_max : int

Maximum value.

$p_bool_deci : bool = false

true if float, false if integer. Default false.

Tags
access

protected

since
1.5.0
todo

Refactor HTML generation.

Return values
string

add_section()

Returns an array describing a sub-page section.

protected add_section(string $p_str_id, string $p_str_title, int $p_int_settings_container_index[, bool $p_bool_has_submit_button = true ]) : array<string|int, mixed>
Parameters
$p_str_id : string

Unique ID suffix.

$p_str_title : string

Title of the section.

$p_int_settings_container_index : int

Settings Container index.

$p_bool_has_submit_button : bool = true

Whether a ‘Submit’ button should be displayed for this section. Default true.

Tags
access

protected

since
1.5.0
todo

Refactor sections into their own class?

Return values
array<string|int, mixed>

{ A dashboard section.

@type  string  $id  Section ID.
@type  string  $title  Section title.
@type  bool  $submit  Whether the section has a submit button or not.
@type  int  $container  Settings Container index.

}

add_select_box()

Constructs the HTML for a `<select>` element.

protected add_select_box(string $p_str_setting_name, array<string|int, mixed> $p_arr_options) : string
Parameters
$p_str_setting_name : string

Setting key.

$p_arr_options : array<string|int, mixed>

Possible options.

Tags
access

protected

since
1.5.0
todo

Refactor HTML generation.

Return values
string

add_text()

Returns a simple text inside HTML `<span>` element.

protected add_text(string $p_str_text) : string
Parameters
$p_str_text : string

Message to be surrounded with <span> tags.

Tags
access

protected

since
1.5.0
todo

Refactor HTML generation.

Return values
string

add_text_box()

Constructs the HTML for a text `<input>` element.

protected add_text_box(string $p_str_setting_name[, int $p_str_max_length = 999 ][, bool $p_bool_readonly = false ][, bool $p_bool_hidden = false ]) : string
Parameters
$p_str_setting_name : string

Setting key.

$p_str_max_length : int = 999

Maximum length of the input. Default length 999 chars.

$p_bool_readonly : bool = false

Set the input to be read only. Default false.

$p_bool_hidden : bool = false

Set the input to be hidden. Default false.

Tags
access

protected

since
1.5.0
todo

Refactor HTML generation.

Return values
string

add_textarea()

Constructs the HTML for a `<textarea>` element.

protected add_textarea(string $p_str_setting_name) : string
Parameters
$p_str_setting_name : string

Setting key.

Tags
access

protected

since
1.5.0
todo

Refactor HTML generation.

Return values
string

get_meta_boxes()

Returns an array of all registered meta boxes for each section of the sub-page.

protected get_meta_boxes() : array<string|int, array<string|int, mixed>>
Tags
see
Engine::add_meta_box()

For more information on the meta box array format.

since
1.5.0
since
2.2.0

Re-order and rename tabs.

Return values
array<string|int, array<string|int, mixed>>

All of the registered meta boxes.

get_sections()

Returns an array of all registered sections for the sub-page.

protected get_sections() : array<string|int, array<string|int, mixed>>
Tags
see
Engine::add_section()

For more information on the section array format.

since
1.5.0
since
2.1.6

Remove conditional rendering of ‘Expert’ tab.

Return values
array<string|int, array<string|int, mixed>>

All of the registered sections.

get_sub_page_slug()

Returns the unique slug of the sub-page.

protected get_sub_page_slug() : string
Tags
since
1.5.0
Return values
string

get_sub_page_title()

Returns the title of the sub-page.

protected get_sub_page_title() : string
Tags
since
1.5.0
Return values
string

load_setting()

Loads a specified setting.

protected load_setting(string $p_str_setting_key_name) : array<string|int, mixed>
Parameters
$p_str_setting_key_name : string

Setting key.

Tags
access

protected

since
1.5.0
since
2.5.11

Broken due to accidental removal of esc_attr() call.

since
2.6.1

Restore esc_attr() call.

Return values
array<string|int, mixed>

{ A configurable setting.

@type  string  $id  Setting key.
@type  string  $name  Setting name.
@type  string  $value  Setting value.

}

append_scripts()

Append JavaScript and CSS files for specific sub-page.

private append_scripts() : mixed
Tags
access

private

since
1.5.0
todo

Move to Admin.

Return values
mixed

register_meta_boxes()

Registers all Meta boxes for a sub-page.

private register_meta_boxes(string $p_str_parent_id) : mixed
Parameters
$p_str_parent_id : string

Parent section unique ID.

Tags
access

private

since
1.5.0
Return values
mixed

save_settings()

Save all plugin settings.

private save_settings() : bool
Tags
access

private

since
1.5.0
todo

Review nonce verification.

Return values
bool

true on save success, else false.

Search results