Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Add coral comment count threshold setting #355

Merged
merged 2 commits into from
Sep 27, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions inc/integrations/class-coral.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,14 @@ public function register_settings_fields() {
'irving_integrations_settings'
);

add_settings_field(
'wp_irving_coral_comment_count_display_threshold',
esc_html__( 'Minimum number of comments required to display the comment count', 'wp-irving' ),
[ $this, 'render_coral_comment_count_display_threshold_input' ],
'wp_irving_integrations',
'irving_integrations_settings'
);

add_settings_field(
'wp_irving_coral_banned_names',
esc_html__( 'Coral Banned Username Values', 'wp-irving' ),
Expand Down Expand Up @@ -220,6 +228,18 @@ public function render_coral_use_cron_input() {
<?php
}

/**
* Render a number input which determines when comment count icons appear.
*/
public function render_coral_comment_count_display_threshold_input() {
// Check to see if there is an existing value.
$comment_count_display_threshold = $this->options[ $this->option_key ]['comment_count_display_threshold'] ?? 0;

?>
<input type="number" step="1" min="0" name="irving_integrations[<?php echo esc_attr( 'coral_comment_count_display_threshold' ); ?>]" value="<?php echo esc_attr( $comment_count_display_threshold ); ?>" />
<?php
}

/**
* Render a textarea for strings banned from being included in Coral usernames.
*/
Expand Down