achille-press/template-parts/content-page.php
David A. Kennedy c60811bf94 Add post title to edit_post_link
This improves the accessibility of these links, and gives more context for screen reader users. Now, they know exactly where the link goes.

Escaped output with `esc_html_x` and `wp_kses`.

Resolves: #774
2015-06-26 14:22:38 -04:00

38 lines
910 B
PHP

<?php
/**
* The template used for displaying page content in page.php
*
* @package _s
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
</header><!-- .entry-header -->
<div class="entry-content">
<?php the_content(); ?>
<?php
wp_link_pages( array(
'before' => '<div class="page-links">' . esc_html__( 'Pages:', '_s' ),
'after' => '</div>',
) );
?>
</div><!-- .entry-content -->
<footer class="entry-footer">
<?php
edit_post_link(
sprintf(
esc_html_x( 'Edit %s', 'name of current post', '_s' ),
wp_kses( the_title( '<span class="screen-reader-text">"', '"</span>', false ), array( 'span' => array( 'class' => array() ) ) )
),
'<span class="edit-link">',
'</span>'
);
?>
</footer><!-- .entry-footer -->
</article><!-- #post-## -->