PHP Class TitanFrameworkOptionFont

Since: 1.4
Inheritance: extends TitanFrameworkOption
Mostra file Open project: gambitph/titan-framework Class Usage Examples

Public Properties

Property Type Description
$defaultSecondarySettings Default settings specific to this option
$defaultStyling Default style options
$webSafeFonts The list of web safe fonts

Public Methods

Method Description
__construct ( $settings, $owner ) : void Constructor
cleanValueForGetting ( string $value ) : string Cleans the raw value for getting
cleanValueForSaving ( string $value ) : string Cleans up the serialized value before saving
createFontScript ( ) : void Creates the Javascript for running the font option
display ( ) : void Displays the option in admin panels and meta boxes
enqueueGooglefonts ( ) : void Enqueues all the Google fonts, used in wp_enqueue_scripts
generateCSS ( string $css, TitanFrameworkOption $option ) : string Generates CSS for the font, this is used in TitanFrameworkCSS
generateCustomizerPreviewCSS ( array $generated ) : array Adds the list of all Google fonts into the customizer live preview
generateCustomizerPreviewJS ( ) : void Adds the Javascript code that adds Google fonts straight into the customizer preview.
getGoogleFontURLs ( ) : array Gets all the Google font URLs for enqueuing. This was previously inside $this->enqueueGooglefonts() but was split off so it can be used by other functions.
loadAdminScripts ( ) : void Enqueues the needed scripts for the admin
registerCustomizerControl ( $wp_customize, TitanFrameworkCustomizerSection $section, integer $priority = 1 ) : void Registers the theme customizer control, for displaying the option

Method Details

__construct() public method

Constructor
Since: 1.4
public __construct ( $settings, $owner ) : void
return void

cleanValueForGetting() public method

Cleans the raw value for getting
Since: 1.4
public cleanValueForGetting ( string $value ) : string
$value string The raw value
return string The cleaned value

cleanValueForSaving() public method

Cleans up the serialized value before saving
Since: 1.4
public cleanValueForSaving ( string $value ) : string
$value string The serialized value
return string The cleaned value

createFontScript() public static method

Creates the Javascript for running the font option
Since: 1.4
public static createFontScript ( ) : void
return void

display() public method

Displays the option in admin panels and meta boxes
Since: 1.4
public display ( ) : void
return void

enqueueGooglefonts() public method

Enqueues all the Google fonts, used in wp_enqueue_scripts
Since: 1.4
public enqueueGooglefonts ( ) : void
return void

generateCSS() public method

Generates CSS for the font, this is used in TitanFrameworkCSS
Since: 1.4
public generateCSS ( string $css, TitanFrameworkOption $option ) : string
$css string The CSS generated
$option TitanFrameworkOption The current option being processed
return string The CSS generated

generateCustomizerPreviewCSS() public method

Adds the list of all Google fonts into the customizer live preview
Since: 1.9.2
public generateCustomizerPreviewCSS ( array $generated ) : array
$generated array The parameters to pass to the ajax handler during customizer live previews.
return array An array containing modified ajax values to pass

generateCustomizerPreviewJS() public method

Adds the Javascript code that adds Google fonts straight into the customizer preview.
Since: 1.9.2
public generateCustomizerPreviewJS ( ) : void
return void

getGoogleFontURLs() public method

Gets all the Google font URLs for enqueuing. This was previously inside $this->enqueueGooglefonts() but was split off so it can be used by other functions.
Since: 1.9.2
public getGoogleFontURLs ( ) : array
return array An array containing the font names as keys and the font URLs as values.

loadAdminScripts() public method

Enqueues the needed scripts for the admin
Since: 1.4
public loadAdminScripts ( ) : void
return void

registerCustomizerControl() public method

Registers the theme customizer control, for displaying the option
Since: 1.4
public registerCustomizerControl ( $wp_customize, TitanFrameworkCustomizerSection $section, integer $priority = 1 ) : void
$section TitanFrameworkCustomizerSection The section where this option will be placed
$priority integer The order of this control in the section
return void

Property Details

$defaultSecondarySettings public_oe property

Default settings specific to this option
public $defaultSecondarySettings

$defaultStyling public_oe static_oe property

Default style options
public static $defaultStyling

$webSafeFonts public_oe static_oe property

The list of web safe fonts
public static $webSafeFonts