Add filters to Customizer style choices
This commit is contained in:
parent
2986f52195
commit
1781330837
@ -404,6 +404,13 @@ Filters the form fields of the `fictioneer_contact_form` shortcode.
|
||||
|
||||
---
|
||||
|
||||
### `apply_filters( 'fictioneer_filter_customizer_{theme_option}', $choices )`
|
||||
Filters the choices arrays of select theme options. Combined with the `fictioneer_filter_pre_build_customize_css` filter, you can append own options and the requires styles. Available options: `header_image_style`, `header_style`, `page_style`, `card_style`, `content_list_style`, and `footer_style`.
|
||||
|
||||
Refer to `/includes/functions/_customizer-settings.php` to see the default choices.
|
||||
|
||||
---
|
||||
|
||||
### `apply_filters( 'fictioneer_filter_falsy_meta_allow_list', $allowed )`
|
||||
Filters the array of meta keys allowed to be saved as "falsy" ("", 0, null, false, []) instead of being deleted when updated via theme functions. Applies to post, comment, and user meta fields. This does not affect the core update functions. See `fictioneer_update_user_meta(…)`, `fictioneer_update_comment_meta(…)`, and `fictioneer_update_post_meta(…)`.
|
||||
|
||||
|
@ -2462,6 +2462,15 @@ function fictioneer_add_header_customizer_settings( $manager ) {
|
||||
)
|
||||
);
|
||||
|
||||
$header_image_styles = array(
|
||||
'default' => _x( 'Plain (Default)', 'Customizer header image style option.', 'fictioneer' ),
|
||||
'polygon-battered' => _x( 'Battered', 'Customizer header image style option.', 'fictioneer' ),
|
||||
'polygon-chamfered' => _x( 'Chamfered', 'Customizer header image style option.', 'fictioneer' ),
|
||||
'mask-grunge-frame-a-small' => _x( 'Grunge Frame (Small)', 'Customizer header image style option.', 'fictioneer' ),
|
||||
'mask-grunge-frame-a-large' => _x( 'Grunge Frame (Large)', 'Customizer header image style option.', 'fictioneer' ),
|
||||
'polygon-mask-image-custom-css' => _x( 'Custom CSS', 'Customizer header image style option.', 'fictioneer' )
|
||||
);
|
||||
|
||||
$manager->add_control(
|
||||
'header_image_style',
|
||||
array(
|
||||
@ -2470,14 +2479,7 @@ function fictioneer_add_header_customizer_settings( $manager ) {
|
||||
'section' => 'header_image',
|
||||
'label' => __( 'Header Image Style', 'fictioneer' ),
|
||||
'description' => __( 'Choose the style for your header image.', 'fictioneer' ),
|
||||
'choices' => array(
|
||||
'default' => _x( 'Plain (Default)', 'Customizer header image style option.', 'fictioneer' ),
|
||||
'polygon-battered' => _x( 'Battered', 'Customizer header image style option.', 'fictioneer' ),
|
||||
'polygon-chamfered' => _x( 'Chamfered', 'Customizer header image style option.', 'fictioneer' ),
|
||||
'mask-grunge-frame-a-small' => _x( 'Grunge Frame (Small)', 'Customizer header image style option.', 'fictioneer' ),
|
||||
'mask-grunge-frame-a-large' => _x( 'Grunge Frame (Large)', 'Customizer header image style option.', 'fictioneer' ),
|
||||
'polygon-mask-image-custom-css' => _x( 'Custom CSS', 'Customizer header image style option.', 'fictioneer' )
|
||||
)
|
||||
'choices' => apply_filters( 'fictioneer_filter_customizer_header_image_style', $header_image_styles )
|
||||
)
|
||||
);
|
||||
|
||||
@ -2691,6 +2693,14 @@ function fictioneer_add_layout_customizer_settings( $manager ) {
|
||||
)
|
||||
);
|
||||
|
||||
$header_styles = array(
|
||||
'default' => _x( 'Default', 'Customizer header style option.', 'fictioneer' ),
|
||||
'top' => _x( 'Top', 'Customizer header style option.', 'fictioneer' ),
|
||||
'split' => _x( 'Split', 'Customizer header style option.', 'fictioneer' ),
|
||||
'overlay' => _x( 'Overlay', 'Customizer header style option.', 'fictioneer' ),
|
||||
'none' => _x( 'None', 'Customizer header style option.', 'fictioneer' )
|
||||
);
|
||||
|
||||
$manager->add_control(
|
||||
'header_style',
|
||||
array(
|
||||
@ -2699,13 +2709,7 @@ function fictioneer_add_layout_customizer_settings( $manager ) {
|
||||
'section' => 'layout',
|
||||
'label' => __( 'Header Style', 'fictioneer' ),
|
||||
'description' => __( 'Choose the style for your header. This may affect or disable other settings.', 'fictioneer' ),
|
||||
'choices' => array(
|
||||
'default' => _x( 'Default', 'Customizer header style option.', 'fictioneer' ),
|
||||
'top' => _x( 'Top', 'Customizer header style option.', 'fictioneer' ),
|
||||
'split' => _x( 'Split', 'Customizer header style option.', 'fictioneer' ),
|
||||
'overlay' => _x( 'Overlay', 'Customizer header style option.', 'fictioneer' ),
|
||||
'none' => _x( 'None', 'Customizer header style option.', 'fictioneer' )
|
||||
),
|
||||
'choices' => apply_filters( 'fictioneer_filter_customizer_header_style', $header_styles )
|
||||
)
|
||||
);
|
||||
|
||||
@ -2821,15 +2825,7 @@ function fictioneer_add_layout_customizer_settings( $manager ) {
|
||||
)
|
||||
);
|
||||
|
||||
$manager->add_control(
|
||||
'page_style',
|
||||
array(
|
||||
'type' => 'select',
|
||||
'priority' => 10,
|
||||
'section' => 'layout',
|
||||
'label' => __( 'Page Style', 'fictioneer' ),
|
||||
'description' => __( 'Choose the general style for your pages.', 'fictioneer' ),
|
||||
'choices' => array(
|
||||
$page_styles = array(
|
||||
'default' => _x( 'Plain (Default)', 'Customizer page style option.', 'fictioneer' ),
|
||||
'polygon-battered' => _x( 'Battered', 'Customizer page style option.', 'fictioneer' ),
|
||||
'mask-image-ringbook' => _x( 'Ringbook', 'Customizer page style option.', 'fictioneer' ),
|
||||
@ -2841,7 +2837,17 @@ function fictioneer_add_layout_customizer_settings( $manager ) {
|
||||
'mask-image-layered-peaks-a' => _x( 'Layered Peaks', 'Customizer page style option.', 'fictioneer' ),
|
||||
'mask-image-grunge-a' => _x( 'Grunge', 'Customizer page style option.', 'fictioneer' ),
|
||||
'polygon-mask-image-custom-css' => _x( 'Custom CSS', 'Customizer page style option.', 'fictioneer' )
|
||||
)
|
||||
);
|
||||
|
||||
$manager->add_control(
|
||||
'page_style',
|
||||
array(
|
||||
'type' => 'select',
|
||||
'priority' => 10,
|
||||
'section' => 'layout',
|
||||
'label' => __( 'Page Style', 'fictioneer' ),
|
||||
'description' => __( 'Choose the general style for your pages.', 'fictioneer' ),
|
||||
'choices' => apply_filters( 'fictioneer_filter_customizer_page_style', $page_styles )
|
||||
)
|
||||
);
|
||||
|
||||
@ -2878,6 +2884,12 @@ function fictioneer_add_layout_customizer_settings( $manager ) {
|
||||
)
|
||||
);
|
||||
|
||||
$card_styles = array(
|
||||
'default' => _x( 'Embedded (Default)', 'Customizer card style option.', 'fictioneer' ),
|
||||
'unfolded' => _x( 'Unfolded', 'Customizer card style option.', 'fictioneer' ),
|
||||
'combined' => _x( 'Combined', 'Customizer card style option.', 'fictioneer' )
|
||||
);
|
||||
|
||||
$manager->add_control(
|
||||
'card_style',
|
||||
array(
|
||||
@ -2886,11 +2898,7 @@ function fictioneer_add_layout_customizer_settings( $manager ) {
|
||||
'section' => 'layout',
|
||||
'label' => __( 'Card Style', 'fictioneer' ),
|
||||
'description' => __( 'Choose the style for your cards.', 'fictioneer' ),
|
||||
'choices' => array(
|
||||
'default' => _x( 'Embedded (Default)', 'Customizer card style option.', 'fictioneer' ),
|
||||
'unfolded' => _x( 'Unfolded', 'Customizer card style option.', 'fictioneer' ),
|
||||
'combined' => _x( 'Combined', 'Customizer card style option.', 'fictioneer' )
|
||||
)
|
||||
'choices' => apply_filters( 'fictioneer_filter_customizer_card_style', $card_styles )
|
||||
)
|
||||
);
|
||||
|
||||
@ -2955,6 +2963,13 @@ function fictioneer_add_layout_customizer_settings( $manager ) {
|
||||
)
|
||||
);
|
||||
|
||||
$content_list_styles = array(
|
||||
'default' => _x( 'Gradient (Default)', 'Customizer content list style option.', 'fictioneer' ),
|
||||
'full' => _x( 'Full', 'Customizer content list style option.', 'fictioneer' ),
|
||||
'lines' => _x( 'Lines', 'Customizer content list style option.', 'fictioneer' ),
|
||||
'free' => _x( 'Free', 'Customizer content list style option.', 'fictioneer' )
|
||||
);
|
||||
|
||||
$manager->add_control(
|
||||
'content_list_style',
|
||||
array(
|
||||
@ -2963,12 +2978,7 @@ function fictioneer_add_layout_customizer_settings( $manager ) {
|
||||
'section' => 'layout',
|
||||
'label' => __( 'Content List Style', 'fictioneer' ),
|
||||
'description' => __( 'Choose the style for your content lists.', 'fictioneer' ),
|
||||
'choices' => array(
|
||||
'default' => _x( 'Gradient (Default)', 'Customizer content list style option.', 'fictioneer' ),
|
||||
'full' => _x( 'Full', 'Customizer content list style option.', 'fictioneer' ),
|
||||
'lines' => _x( 'Lines', 'Customizer content list style option.', 'fictioneer' ),
|
||||
'free' => _x( 'Free', 'Customizer content list style option.', 'fictioneer' )
|
||||
)
|
||||
'choices' => apply_filters( 'fictioneer_filter_customizer_content_list_style', $content_list_styles )
|
||||
)
|
||||
);
|
||||
|
||||
@ -2982,6 +2992,11 @@ function fictioneer_add_layout_customizer_settings( $manager ) {
|
||||
)
|
||||
);
|
||||
|
||||
$footer_styles = array(
|
||||
'default' => _x( 'Floating (Default)', 'Customizer footer style option.', 'fictioneer' ),
|
||||
'isolated' => _x( 'Isolated', 'Customizer footer style option.', 'fictioneer' )
|
||||
);
|
||||
|
||||
$manager->add_control(
|
||||
'footer_style',
|
||||
array(
|
||||
@ -2990,10 +3005,8 @@ function fictioneer_add_layout_customizer_settings( $manager ) {
|
||||
'section' => 'layout',
|
||||
'label' => __( 'Footer Style', 'fictioneer' ),
|
||||
'description' => __( 'Choose the style for your footer.', 'fictioneer' ),
|
||||
'choices' => array(
|
||||
'default' => _x( 'Floating (Default)', 'Customizer footer style option.', 'fictioneer' ),
|
||||
'isolated' => _x( 'Isolated', 'Customizer footer style option.', 'fictioneer' )
|
||||
)
|
||||
'choices' =>
|
||||
apply_filters( 'fictioneer_filter_customizer_footer_style', $footer_styles )
|
||||
)
|
||||
);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user