Added Global announcement to all chapter. #14
@ -110,6 +110,29 @@ function fictioneer_chapter_foreword( $args ) {
|
||||
}
|
||||
add_action( 'fictioneer_chapter_before_header', 'fictioneer_chapter_foreword', 10 );
|
||||
|
||||
// =============================================================================
|
||||
// CHAPTER Announcement
|
||||
// =============================================================================
|
||||
|
||||
/**
|
||||
* Outputs the HTML for the chapter announcement notice
|
||||
*
|
||||
* @since Fictioneer 5.8.5
|
||||
*/
|
||||
function fictioneer_chapter_announcement_notice() {
|
||||
// Get notice
|
||||
// Get notice
|
||||
$g_notices = trim( get_option( 'fictioneer_chapter_announcement_notice' ) );
|
||||
|
||||
// Show Notice
|
||||
if ( ! empty( $g_notices ) ) { ?>
|
||||
<div class="chapter__warning infobox polygon clearfix hideable">
|
||||
<?php echo force_balance_tags( $g_notices ); ?>
|
||||
</div>
|
||||
<?php };
|
||||
|
||||
}
|
||||
add_action( 'fictioneer_chapter_before_header', 'fictioneer_chapter_announcement_notice', 20 );
|
||||
|
||||
// =============================================================================
|
||||
// CHAPTER WARNINGS
|
||||
// =============================================================================
|
||||
|
@ -801,6 +801,14 @@ define( 'FICTIONEER_OPTIONS', array(
|
||||
'label' => __( 'Notice above comments. Leave empty to hide. HTML allowed.', 'fictioneer' ),
|
||||
'default' => '',
|
||||
'placeholder' => ''
|
||||
),
|
||||
'fictioneer_chapter_announcement_notice' => array(
|
||||
'name' => 'fictioneer_chapter_announcement_notice',
|
||||
'group' => 'fictioneer-settings-general-group',
|
||||
'sanitize_callback' => 'wp_kses_post',
|
||||
'label' => __( 'Notice above chapters. Leave empty to hide. HTML allowed.', 'fictioneer' ),
|
||||
'default' => '',
|
||||
'placeholder' => ''
|
||||
),
|
||||
'fictioneer_discord_client_id' => array(
|
||||
'name' => 'fictioneer_discord_client_id',
|
||||
|
@ -202,7 +202,9 @@
|
||||
);
|
||||
?>
|
||||
</div>
|
||||
|
||||
<div class="fictioneer-card__row">
|
||||
<?php fictioneer_settings_textarea( 'fictioneer_chapter_announcement_notice', '214px' ); ?>
|
||||
</div>
|
||||
<div class="fictioneer-card__row fictioneer-card__row--inline-input">
|
||||
![]() Please put this as the last row and mind the formatting, spacing, and indentation. Please put this as the last row and mind the formatting, spacing, and indentation.
![]() Okay Okay
|
||||
<p class="fictioneer-inline-text-input"><?php
|
||||
printf(
|
||||
|
Loading…
x
Reference in New Issue
Block a user
This should be in its own action hooked into
fictioneer_chapter_before_header
, because it is a different concern. Also without theinfobox--warning
modifier, that makes everything red. I newly changed how the script to hide info boxes works, just addhideable
as extra class so people can hide these things. These boxes are noise for most reader.force_balance_tags()
is a potentially expensive function and an admin should know what they are doing (otherwise they really shouldn't manage a website). See notes on the function. Reminds me that I wanted the remove the one instance where I used it and forgot (this has been amended now). Probably where you got that from.Please also adhere to the coding and formatting style of the theme.
oh I should force_balance_tags was created by you. I got it from comments notice.
Will makes changes