ThemeSupport
in package
This class handles the registration of Theme Styles.
Table of Contents
Properties
- $colors : array<string|int, mixed>
- Stores the custom colors to be registered.
- $font_sizes : array<string|int, mixed>
- Stores the custom font sizes to be registered.
- $gradients : array<string|int, mixed>
- Stores the custom gradient to be registered.
Methods
- generate_css() : string
- Generate CSS
- output_css_backend() : void
- Output CSS for backend
- output_css_frontend() : void
- Output CSS for frontend
- register() : void
- Function to register options.
- set_colors() : void
- Function to set colors.
- set_font_sizes() : void
- Function to set font sizes.
- set_gradients() : void
- Function to set gradients.
- add_colors() : void
- Add defined colors to the editor color palette.
- add_font_sizes() : void
- Add defined font sizes to the editor font sizes.
- add_gradients() : void
- Add defined gradients to the editor gradient presets.
Properties
$colors
Stores the custom colors to be registered.
protected
array<string|int, mixed>
$colors
$font_sizes
Stores the custom font sizes to be registered.
protected
array<string|int, mixed>
$font_sizes
$gradients
Stores the custom gradient to be registered.
protected
array<string|int, mixed>
$gradients
Methods
generate_css()
Generate CSS
public
generate_css([string $prefix = '' ]) : string
Parameters
- $prefix : string = ''
-
The prefix to be added for each CSS class.
Return values
stringoutput_css_backend()
Output CSS for backend
public
output_css_backend() : void
output_css_frontend()
Output CSS for frontend
public
output_css_frontend() : void
register()
Function to register options.
public
register() : void
set_colors()
Function to set colors.
public
set_colors([array<string|int, mixed> $colors = array() ]) : void
Parameters
- $colors : array<string|int, mixed> = array()
-
Array of colors.
set_font_sizes()
Function to set font sizes.
public
set_font_sizes([array<string|int, mixed> $font_sizes = array() ]) : void
Parameters
- $font_sizes : array<string|int, mixed> = array()
-
Array of font sizes.
set_gradients()
Function to set gradients.
public
set_gradients([array<string|int, mixed> $gradients = array() ]) : void
Parameters
- $gradients : array<string|int, mixed> = array()
-
Array of gradients.
add_colors()
Add defined colors to the editor color palette.
protected
add_colors() : void
add_font_sizes()
Add defined font sizes to the editor font sizes.
protected
add_font_sizes() : void
add_gradients()
Add defined gradients to the editor gradient presets.
protected
add_gradients() : void