Hello,
I am currently building a BBPress forum with WordPress. I am also building a menu for BBPress to store all the admin links with the below code. The problem is I have marked the Create Topic and Reply buttons up as a link, but screen readers just say Create Topic or Reply and leave out that it is a link. If I put it in as a button, it no longer shows up in the links list. If I use
<code>href"#"</code>
It returns you to the top of the page after clicking the link.
Here is my full code.
<code>/*Add reply form slide out on BBPress*/
function show_form_on_click() {
$classes = get_body_class();
if ( is_user_logged_in() && !bbp_is_topic_closed() ) {
if (in_array('single-forum',$classes)) { ?>
<script type="text/javascript">
jQuery( document ).ready(function() {
jQuery( '<a class="custom-newtopic-button" alt="Click Here to create a new forum topic">Create Topic</a>' ).insertBefore( '#new-topic-0' );
jQuery('.custom-newtopic-button').click(function(){
jQuery('.custom-newtopic-button').hide();
});
jQuery('.custom-newtopic-button').click(function(){
jQuery('.bbp-topic-form').show();
});
});
</script>
<?php } elseif(in_array('single-topic',$classes)) { ?>
<script type="text/javascript">
jQuery( document ).ready(function() {
jQuery( '<a class="custom-reply-button">Reply</a>' ).insertAfter( '.bbp-pagination' );
jQuery('.custom-reply-button, .d4p-bbt-quote-link').click(function(){
jQuery('.custom-reply-button').hide();
});
jQuery('.custom-reply-button, .d4p-bbt-quote-link').click(function(){
jQuery('.bbp-reply-form').show();
});
});
</script>
<?php }
}
}
add_action( 'wp_footer', 'show_form_on_click' );</code>
Can you provide any suggestions on how I can make this link more accessible to the blind? I have to say, this is the first time I have ever had a problem designing something for my own disability.
Thanks.