Skip to content

Instantly share code, notes, and snippets.

@joedolson
Created May 23, 2015 17:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joedolson/0b2ac3b2d778a599d81d to your computer and use it in GitHub Desktop.
Save joedolson/0b2ac3b2d778a599d81d to your computer and use it in GitHub Desktop.
These links will be impossible to find if they're just links; we'll wrap them in an aria landmark element and add a heading.
/*
* Fetch HTML for links and wrap in a container. Add heading and ARIA landmark role.
*
* @param integer $post_ID of current post.
*
* @return full HTML block.
*/
function id24_social_block( $post_ID ) {
$links = id24_create_links( $post_ID );
$html = "
<nav aria-labelledby='id24-social-sharing'>
<h3 id='id24-social-sharing'>" . __( 'Share This Post', 'id24-social-sharing' ) . "</h3>
<div class='id24-social-share'>
$links
</div>
</nav>";
return $html;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment