PHP Class Pressbooks\CustomCss

Afficher le fichier Open project: pressbooks/pressbooks Class Usage Examples

Méthodes publiques

Свойство Type Description
$supported array All keys must match an *existing* WP post where post_name = __key__ and post_type = 'custom-css' If the key is not 'web' then it must map to: themes-book/__SOME_THEME__/export/__key__/style.css

Méthodes publiques

Méthode Description
__construct ( )
formSubmit ( ) Save custom CSS to database (and filesystem)
getBaseTheme ( $slug ) : string Determine base theme that was used for the selected Custom CSS.
getCss ( $slug ) : string Get CSS from database
getCustomCssFolder ( ) : string Get the fullpath to the Custom CSS folder Create if not there.
getPost ( string $slug ) : WP_Post | boolean Returns the latest "custom-css" post
isCustomCss ( ) : boolean Is the current theme the custom css theme?
isFormSubmission ( ) : boolean Check if a user submitted something to themes.php?page=pb_custom_css
isRomanized ( ) : boolean Is the romanize parts option true?

Méthodes protégées

Méthode Description
cleanupCss ( $css ) : string Clean up CSS.

Method Details

__construct() public méthode

public __construct ( )

cleanupCss() protected static méthode

Minimal intervention, but prevent users from injecting garbage.
protected static cleanupCss ( $css ) : string
$css
Résultat string

formSubmit() static public méthode

Save custom CSS to database (and filesystem)
static public formSubmit ( )

getBaseTheme() static public méthode

Determine base theme that was used for the selected Custom CSS.
static public getBaseTheme ( $slug ) : string
$slug string
Résultat string

getCss() public méthode

Get CSS from database
public getCss ( $slug ) : string
$slug
Résultat string

getCustomCssFolder() static public méthode

Get the fullpath to the Custom CSS folder Create if not there.
static public getCustomCssFolder ( ) : string
Résultat string fullpath

getPost() public méthode

Returns the latest "custom-css" post
See also: Pressbooks\Activation::wpmuActivate
See also: Pressbooks\Metadata::upgradeCustomCss
public getPost ( string $slug ) : WP_Post | boolean
$slug string post_name
Résultat WP_Post | boolean

isCustomCss() static public méthode

Is the current theme the custom css theme?
static public isCustomCss ( ) : boolean
Résultat boolean

isFormSubmission() static public méthode

Check if a user submitted something to themes.php?page=pb_custom_css
static public isFormSubmission ( ) : boolean
Résultat boolean

isRomanized() static public méthode

Is the romanize parts option true?
static public isRomanized ( ) : boolean
Résultat boolean

Property Details

$supported public_oe property

All keys must match an *existing* WP post where post_name = __key__ and post_type = 'custom-css' If the key is not 'web' then it must map to: themes-book/__SOME_THEME__/export/__key__/style.css
public array $supported
Résultat array