Documentation

Settings extends Engine
in package

Class to initialise all defined page layouts.

Tags
since
1.5.0
see
Engine

Table of Contents

$plugin_name  : string
The ID of this plugin.
$sections  : array<string|int, mixed>
Stores all Sections for the child sub-page.
$sub_page_hook  : string|null
Stores the Hook connection string for the child sub-page.
__construct()  : mixed
Initialize the class and set its properties.
amp_compat()  : void
Displays the AMP compatibility mode option.
custom_css()  : mixed
Displays the Custom CSS box.
custom_css_migration()  : void
Displays transitional legacy Custom CSS box.
custom_css_new()  : void
Displays the new Custom CSS box.
description()  : void
Output the description of a section. May be overwritten in any section.
display_content()  : void
Displays the content of specific sub-page.
donate()  : void
Displays all Donate button to support the developers.
excerpts()  : void
Displays the footnotes in excerpt setting.
get_priority()  : int
Returns a priority index.
hard_links()  : void
Displays all options for the fragment identifier configuration.
help()  : void
Displays a short introduction to the plugin.
hyperlink_arrow()  : void
Displays all settings for the backlink symbol.
label_solution()  : void
Displays the setting for the input label issue solution.
lookup_hooks()  : void
Displays available Hooks to look for Footnote short codes.
love()  : void
Displays all settings for ‘I love Footnotes’ note.
mouseover_box()  : void
Displays enabled status for the footnotes mouse-over box.
mouseover_box_appearance()  : void
Displays style settings for the footnotes mouse-over box.
mouseover_box_dimensions()  : void
Displays dimensions setting for the footnotes mouse-over box.
mouseover_box_position()  : void
Displays position settings for the footnotes mouse-over box.
mouseover_box_text()  : void
Displays dedicated tooltip text settings for the footnotes mouse-over box.
mouseover_box_timing()  : void
Displays timing settings for the footnotes mouse-over box.
mouseover_box_truncation()  : void
Displays truncation settings for the footnotes mouse-over box.
numbering()  : void
Displays all options for the footnotes numbering.
reference_container()  : void
Displays all settings for the reference container.
register_sections()  : void
Registers all sections for a sub-page.
register_sub_page()  : void
Registers a sub-page.
scrolling()  : void
Displays all options for the scrolling behavior.
start_end()  : void
Displays all options for the footnotes start and end tag short codes.
superscript()  : void
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 a 'label' element.
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 a '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()  : void
Append JavaScript and CSS files for specific sub-page.
register_meta_boxes()  : void
Registers all Meta boxes for a sub-page.
save_settings()  : bool
Save all plugin settings.

Properties

$plugin_name

The ID of this plugin.

protected string $plugin_name

The ID of this plugin.

Tags
access

protected

since
2.8.0

$sections

Stores all Sections for the child sub-page.

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

protected

since
1.5.0

$sub_page_hook

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

protected string|null $sub_page_hook = null
Tags
access

protected

since
1.5.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() : void
Tags
since
2.6.0

(release)

Return values
void

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() : void
Tags
since
2.2.2
deprecated
Return values
void

custom_css_new()

Displays the new Custom CSS box.

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

description()

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

public description() : void
Tags
since
1.5.0
todo

Required? Should be abstract?

Return values
void

display_content()

Displays the content of specific sub-page.

public display_content() : void
Tags
since
1.5.0
todo

Review nonce verification.

Return values
void

donate()

Displays all Donate button to support the developers.

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

excerpts()

Displays the footnotes in excerpt setting.

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

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() : void
Tags
since
2.2.0
Return values
void

help()

Displays a short introduction to the plugin.

public help() : void
Tags
since
1.5.0
todo

Review in light of admin/public split.

Return values
void

Displays all settings for the backlink symbol.

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

label_solution()

Displays the setting for the input label issue solution.

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

lookup_hooks()

Displays available Hooks to look for Footnote short codes.

public lookup_hooks() : void

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
void

love()

Displays all settings for ‘I love Footnotes’ note.

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

mouseover_box()

Displays enabled status for the footnotes mouse-over box.

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

mouseover_box_appearance()

Displays style settings for the footnotes mouse-over box.

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

mouseover_box_dimensions()

Displays dimensions setting for the footnotes mouse-over box.

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

mouseover_box_position()

Displays position settings for the footnotes mouse-over box.

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

mouseover_box_text()

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

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

mouseover_box_timing()

Displays timing settings for the footnotes mouse-over box.

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

mouseover_box_truncation()

Displays truncation settings for the footnotes mouse-over box.

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

numbering()

Displays all options for the footnotes numbering.

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

reference_container()

Displays all settings for the reference container.

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

register_sections()

Registers all sections for a sub-page.

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

register_sub_page()

Registers a sub-page.

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

scrolling()

Displays all options for the scrolling behavior.

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

start_end()

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

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

superscript()

Displays all settings for the footnote referrers.

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

add_checkbox()

Constructs the HTML for a checkbox 'input' element.

protected add_checkbox(string $setting_name) : string
Parameters
$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 $setting_name) : string
Parameters
$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 a 'label' element.

protected add_label(string $setting_name, string $caption) : string
Parameters
$setting_name : string

Settings key.

$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 $section_id, string $id, string $title, string $callback_function_name) : array<string|int, mixed>
Parameters
$section_id : string

Parent section ID.

$id : string

Unique ID suffix.

$title : string

Title for the meta box.

$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 $setting_name, int $p_in_min, int $max[, bool $deci = false ]) : string
Parameters
$setting_name : string

Setting key.

$p_in_min : int

Minimum value.

$max : int

Maximum value.

$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 $id, string $title, int $settings_container_index[, bool $has_submit_button = true ]) : array<string|int, mixed>
Parameters
$id : string

Unique ID suffix.

$title : string

Title of the section.

$settings_container_index : int

Settings Container index.

$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 $setting_name, array<string|int, mixed> $options) : string
Parameters
$setting_name : string

Setting key.

$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 a 'span' element.

protected add_text(string $text) : string
Parameters
$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 $setting_name[, int $max_length = 999 ][, bool $readonly = false ][, bool $hidden = false ]) : string
Parameters
$setting_name : string

Setting key.

$max_length : int = 999

Maximum length of the input. Default length 999 chars.

$readonly : bool = false

Set the input to be read only. Default false.

$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 $setting_name) : string
Parameters
$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 $setting_key_name) : array<string|int, mixed>
Parameters
$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() : void
Tags
access

private

since
1.5.0
todo

Move to Admin.

Return values
void

register_meta_boxes()

Registers all Meta boxes for a sub-page.

private register_meta_boxes(string $parent_id) : void
Parameters
$parent_id : string

Parent section unique ID.

Tags
access

private

since
1.5.0
Return values
void

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