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

Commit

Permalink
Merge pull request #355 from alleyinteractive/feature/LEDE-1915/allow…
Browse files Browse the repository at this point in the history
…-comment-count-threshold

Add coral comment count threshold setting
  • Loading branch information
jameswburke authored Sep 27, 2021
2 parents 8266278 + def87c2 commit 3edb883
Showing 1 changed file with 20 additions and 0 deletions.
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

0 comments on commit 3edb883

Please sign in to comment.