did some sniff sniff

This commit is contained in:
2025-07-14 21:47:29 -07:00
parent c6bb1b7c7b
commit 0e9321b01a
44 changed files with 2557 additions and 2259 deletions

View File

@@ -21,16 +21,16 @@ if ( post_password_required() ) {
}
// Remove URL field from comment form
function sophia_after_dark_remove_url_comments($fields) {
unset($fields['url']);
function sophia_after_dark_remove_url_comments( $fields ) {
unset( $fields['url'] );
return $fields;
}
add_filter('comment_form_default_fields', 'sophia_after_dark_remove_url_comments');
add_filter( 'comment_form_default_fields', 'sophia_after_dark_remove_url_comments' );
// Modify cookie consent field
function sophia_after_dark_comment_form_change_cookies($fields) {
function sophia_after_dark_comment_form_change_cookies( $fields ) {
$commenter = wp_get_current_commenter();
$consent = ! empty( $commenter['comment_author_email'] );
$consent = ! empty( $commenter['comment_author_email'] );
$fields['cookies'] = sprintf(
'<p class="comment-form-cookies-consent"><input id="wp-comment-cookies-consent" name="wp-comment-cookies-consent" type="checkbox" value="yes" %s /> <label for="wp-comment-cookies-consent">%s</label></p>',
@@ -40,23 +40,23 @@ function sophia_after_dark_comment_form_change_cookies($fields) {
return $fields;
}
add_filter('comment_form_default_fields', 'sophia_after_dark_comment_form_change_cookies');
add_filter( 'comment_form_default_fields', 'sophia_after_dark_comment_form_change_cookies' );
// Add comment notes above form
function sophia_after_dark_modify_text_before_comment_form($arg) {
function sophia_after_dark_modify_text_before_comment_form( $arg ) {
$arg['comment_notes_before'] = wp_kses_post(
'<p class="comment-notes">' .
esc_html__('All comments are manually reviewed and moderated.', 'sophia-after-dark') .
'<br><span class="required-field-message">' .
esc_html__('Required fields are marked ', 'sophia-after-dark') .
'<p class="comment-notes">' .
esc_html__( 'All comments are manually reviewed and moderated.', 'sophia-after-dark' ) .
'<br><span class="required-field-message">' .
esc_html__( 'Required fields are marked ', 'sophia-after-dark' ) .
'<span class="required">*</span></span></p>'
);
return $arg;
}
add_filter('comment_form_defaults', 'sophia_after_dark_modify_text_before_comment_form');
add_filter( 'comment_form_defaults', 'sophia_after_dark_modify_text_before_comment_form' );
// Add privacy policy consent note below form
function sophia_after_dark_modify_text_comment_form($post_id) {
function sophia_after_dark_modify_text_comment_form( $post_id ) {
$link = '<a href="/privacy-policy">' . esc_html__( 'Privacy Policy', 'sophia-after-dark' ) . '</a>';
printf(
'<span class="submit-comment-note">%s</span>',
@@ -69,7 +69,7 @@ function sophia_after_dark_modify_text_comment_form($post_id) {
)
);
}
add_action('comment_form', 'sophia_after_dark_modify_text_comment_form');
add_action( 'comment_form', 'sophia_after_dark_modify_text_comment_form' );
?>
@@ -99,11 +99,13 @@ add_action('comment_form', 'sophia_after_dark_modify_text_comment_form');
<ol class="comment-list">
<?php
wp_list_comments( array(
'style' => 'ol',
'short_ping' => true,
'reply_text' => __( 'Reply', 'sophia-after-dark' ),
) );
wp_list_comments(
array(
'style' => 'ol',
'short_ping' => true,
'reply_text' => __( 'Reply', 'sophia-after-dark' ),
)
);
?>
</ol>