PHP Класс Pressbooks\CustomCss

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$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

Открытые методы

Метод Описание
__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?

Защищенные методы

Метод Описание
cleanupCss ( $css ) : string Clean up CSS.

Описание методов

__construct() публичный Метод

public __construct ( )

cleanupCss() защищенный статический Метод

Minimal intervention, but prevent users from injecting garbage.
protected static cleanupCss ( $css ) : string
$css
Результат string

formSubmit() статический публичный Метод

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

getBaseTheme() статический публичный Метод

Determine base theme that was used for the selected Custom CSS.
static public getBaseTheme ( $slug ) : string
$slug string
Результат string

getCss() публичный Метод

Get CSS from database
public getCss ( $slug ) : string
$slug
Результат string

getCustomCssFolder() статический публичный Метод

Get the fullpath to the Custom CSS folder Create if not there.
static public getCustomCssFolder ( ) : string
Результат string fullpath

getPost() публичный Метод

Returns the latest "custom-css" post
См. также: Pressbooks\Activation::wpmuActivate
См. также: Pressbooks\Metadata::upgradeCustomCss
public getPost ( string $slug ) : WP_Post | boolean
$slug string post_name
Результат WP_Post | boolean

isCustomCss() статический публичный Метод

Is the current theme the custom css theme?
static public isCustomCss ( ) : boolean
Результат boolean

isFormSubmission() статический публичный Метод

Check if a user submitted something to themes.php?page=pb_custom_css
static public isFormSubmission ( ) : boolean
Результат boolean

isRomanized() статический публичный Метод

Is the romanize parts option true?
static public isRomanized ( ) : boolean
Результат boolean

Описание свойств

$supported публичное свойство

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
Результат array