Documentation ¶
Index ¶
- func GetLang() string
- func GetOption(k string) string
- func GetPHPArrayVal[T any](optionName string, defaults T, key ...any) T
- func GetTerm(termId uint64) (models.Terms, bool)
- func GetTermMy(termId uint64) (models.TermsMy, bool)
- func GetTermTaxonomy(termId uint64) (models.TermTaxonomy, bool)
- func GetThemeModsVal[T any](theme, k string, defaults T) (r T)
- func InitOptions() error
- func InitTerms() (err error)
- func IsCustomBackground(theme string) bool
- func SetTemplateFs(fs embed.FS)
- func SetThemeSupport(theme string, support ThemeSupport)
- func Thumbnail(metadata models.WpAttachmentMetadata, Type, host string, except ...string) (r models.PostThumbnail)
- type ColorScheme
- type CustomHeader
- type CustomLogo
- type ImageData
- type Sidebars
- type SidebarsData
- type ThemeMods
- type ThemeSupport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPHPArrayVal ¶
func GetTermTaxonomy ¶
func GetTermTaxonomy(termId uint64) (models.TermTaxonomy, bool)
func GetThemeModsVal ¶
func InitOptions ¶
func InitOptions() error
func IsCustomBackground ¶
func SetTemplateFs ¶
func SetThemeSupport ¶
func SetThemeSupport(theme string, support ThemeSupport)
func Thumbnail ¶
func Thumbnail(metadata models.WpAttachmentMetadata, Type, host string, except ...string) (r models.PostThumbnail)
Types ¶
type ColorScheme ¶
type CustomHeader ¶
type CustomHeader struct { DefaultImage string `json:"default-image"` RandomDefault bool `json:"random-default"` Width int `json:"width"` Height int `json:"height"` FlexHeight bool `json:"flex-height"` FlexWidth bool `json:"flex-width"` DefaultTextColor string `json:"default-text-color"` HeaderText bool `json:"header-text"` Uploads bool `json:"uploads"` WpHeadCallback string `json:"wp-head-callback"` AdminHeadCallback string `json:"admin-head-callback"` AdminPreviewCallback string `json:"admin-preview-callback"` Video bool `json:"video"` VideoActiveCallback string `json:"video-active-callback"` }
type CustomLogo ¶
type Sidebars ¶
type Sidebars struct { Time int `json:"time,omitempty"` Data SidebarsData `json:"data,omitempty"` }
type SidebarsData ¶
type ThemeMods ¶
type ThemeMods struct { CustomCssPostId int `json:"custom_css_post_id,omitempty"` CustomLogo int `json:"custom_logo,omitempty"` HeaderImage string `json:"header_image,omitempty"` BackgroundImage string `json:"background_image,omitempty"` BackgroundSize string `json:"background_size,omitempty"` BackgroundRepeat string `json:"background_repeat,omitempty"` BackgroundColor string `json:"background_color,omitempty"` BackgroundPreset string `json:"background_preset"` BackgroundPositionX string `json:"background_position_x,omitempty"` BackgroundPositionY string `json:"background_position_y"` BackgroundAttachment string `json:"background_attachment"` ColorScheme string `json:"color_scheme"` SidebarTextcolor string `json:"sidebar_textcolor,omitempty"` HeaderBackgroundColor string `json:"header_background_color,omitempty"` HeaderTextcolor string `json:"header_textcolor,omitempty"` HeaderVideo int `json:"header_video,omitempty"` ExternalHeaderVideo string `json:"external_header_video,omitempty"` HeaderImagData ImageData `json:"header_image_data,omitempty"` SidebarsWidgets Sidebars `json:"sidebars_widgets,omitempty"` ThemeSupport ThemeSupport }
ThemeMods 只有部分公共的参数,其它的参数调用 GetThemeModsVal 函数获取
func GetThemeMods ¶
type ThemeSupport ¶
type ThemeSupport struct { CoreBlockPatterns bool `json:"core-block-patterns"` WidgetsBlockEditor bool `json:"widgets-block-editor"` AutomaticFeedLinks bool `json:"automatic-feed-links"` TitleTag bool `json:"title-tag"` PostThumbnails bool `json:"post-thumbnails"` Menus bool `json:"menus"` HTML5 []string `json:"html5"` PostFormats []string `json:"post-formats"` CustomLogo CustomLogo `json:"custom-logo"` CustomizeSelectiveRefreshWidgets bool `json:"customize-selective-refresh-widgets"` EditorStyle bool `json:"editor-style"` EditorStyles bool `json:"editor-styles"` WpBlockStyles bool `json:"wp-block-styles"` ResponsiveEmbeds bool `json:"responsive-embeds"` CustomHeader CustomHeader `json:"custom-header"` Widgets bool `json:"widgets"` }
Click to show internal directories.
Click to hide internal directories.