lib/customizer.php
Theme Customization
Sets up what you see under Appearance->Customize
- Package
- ncp\wp\themes\planet_foundation
- Since
- Planet Foundation 1.0
Functions

pf_sanitize_checkbox_cb(int $input) : int
Callback to sanitize checkboxes
Parameters
Returns
Details
Name | Type | Description |
---|---|---|
$input | int | Should be 1 or 0 for a checkbox |
Type | Description |
---|---|
int | 1 or 0 |
- Link
- Tutorial on Customization and Sanitation
- Since
- Planet Foundation 1.0.0

pf_sanitize_radio_cb(array $input) : array | null
Callback to sanitize all radio button settings before entry into the database
Parameters
Returns
Details
Name | Type | Description |
---|---|---|
$input | array | An array representing a radio control setting |
Type | Description |
---|---|
array | null | If valid array is found, $input is returned |
- Link
- Tutorial on Customization and Sanitation
- Since
- Planet Foundation 1.0.0

pf_sanitize_text_cb(string $input) : string
Callback to use to ensure a field is purely text with no html or evil scripts.
Parameters
Returns
Details
Name | Type | Description |
---|---|---|
$input | string | String in a text field of the customizer |
Type | Description |
---|---|
string | Text field stripped of html and evil things |
- Since
- Planet Foundation 1.0.0

pf_sanitize_url_cb(string $url) : void
Callback to that sanitizes a field containing a URL
Filters out any evil scripts
ParametersName | Type | Description |
---|---|---|
$url | string | The url to santize |
- Since
- Planet Foundation 1.0.0

pf_theme_customizer(\WP_Customize_Manager $wp_customize) : void
A big honk'n function to add new menu items to Appearance->Customize
Child themes can add more customization options using the pf_extend_customizer hook, which
is called at the end of this function
ParametersName | Type | Description |
---|---|---|
$wp_customize | \WP_Customize_Manager | Instance of WP_Customize_Manager |