added the hook to change the style of cancel comment reply

This commit is contained in:
Fabiano Alencar 2018-05-08 13:51:15 -03:00
parent f4f37d8f16
commit ab6b566023
3 changed files with 20 additions and 4 deletions

View File

@ -43,8 +43,8 @@
}
}
} */
button{
&#submit{
button, a{
&#submit, &#cancel-comment-reply-link{
@media screen {
@media (min-width: 768px){
height: 28px;
@ -52,6 +52,14 @@
}
}
}
&#cancel-comment-reply-link{
color: #150e38;
}
&#submit{
&:hover{
background-color: #25a189 !important;
}
}
}
}
}

View File

@ -54,7 +54,7 @@ if (post_password_required()) {
</div>
<button id="submit" class="btn btn-info bg-jungle-green align-self-center ml-auto mt-3 float-right" type="submit" name="submit"><?php _e('Send', 'tainacan-theme') ?></button>
<?php cancel_comment_reply_link('Cancel'); ?>
<?php cancel_comment_reply_link(__( 'Cancel', 'tainacan-theme' )); ?>
<?php do_action('comment_form', $post->ID); ?>
</form>
<?php endif; ?>

View File

@ -74,4 +74,12 @@ if ( ! function_exists( 'tainacan_post_date' ) ) {
echo $time_string;
}
}
}
}
// define the cancel_comment_reply_link callback
function filter_cancel_comment_reply_link( $formatted_link, $link, $text ) {
// make filter magic happen here...
$formatted_link = '<a rel="nofollow" class="btn btn-info bg-white border-oslo-gray align-self-center mt-3 ml-1" id="cancel-comment-reply-link" href="'.$link.'" style="display:none;">'.$text.'</a>';
return $formatted_link;
}
add_filter( 'cancel_comment_reply_link', 'filter_cancel_comment_reply_link', 10, 3 );