Add option to hide categories on posts
This commit is contained in:
parent
b13e4ddfa9
commit
f73aa30537
@ -1627,7 +1627,7 @@ if ( ! function_exists( 'fictioneer_get_post_meta_items' ) ) {
|
||||
}
|
||||
|
||||
// Category node
|
||||
if ( ! ( $args['no_cat'] ?? 0 ) ) {
|
||||
if ( ! ( $args['no_cat'] ?? 0 ) && ! get_option( 'fictioneer_hide_categories' ) ) {
|
||||
$output['category'] = sprintf(
|
||||
'<div class="post__categories"><i class="fa-solid fa-tags"></i> %s</div>',
|
||||
get_the_category_list(', ')
|
||||
|
@ -671,6 +671,12 @@ define( 'FICTIONEER_OPTIONS', array(
|
||||
'group' => 'fictioneer-settings-general-group',
|
||||
'sanitize_callback' => 'fictioneer_sanitize_checkbox',
|
||||
'default' => 0
|
||||
),
|
||||
'fictioneer_hide_categories' => array(
|
||||
'name' => 'fictioneer_hide_categories',
|
||||
'group' => 'fictioneer-settings-general-group',
|
||||
'sanitize_callback' => 'fictioneer_sanitize_checkbox',
|
||||
'default' => 0
|
||||
)
|
||||
),
|
||||
'integers' => array(
|
||||
@ -1134,6 +1140,7 @@ function fictioneer_get_option_label( $option ) {
|
||||
'fictioneer_override_chapter_status_icons' => __( 'Override chapter status icons', 'fictioneer' ),
|
||||
'fictioneer_enable_custom_fields' => __( 'Enable custom fields', 'fictioneer' ),
|
||||
'fictioneer_disable_anti_flicker' => __( 'Disable anti-flicker script', 'fictioneer' ),
|
||||
'fictioneer_hide_categories' => __( 'Hide categories on posts', 'fictioneer' ),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -76,6 +76,16 @@
|
||||
?>
|
||||
</div>
|
||||
|
||||
<div class="fictioneer-card__row">
|
||||
<?php
|
||||
fictioneer_settings_label_checkbox(
|
||||
'fictioneer_hide_categories',
|
||||
__( 'Hide categories on posts', 'fictioneer' ),
|
||||
__( 'If you do not need them anyway.', 'fictioneer' )
|
||||
);
|
||||
?>
|
||||
</div>
|
||||
|
||||
<div class="fictioneer-card__row">
|
||||
<?php
|
||||
fictioneer_settings_label_checkbox(
|
||||
|
Loading…
x
Reference in New Issue
Block a user