Skip to content

Commit

Permalink
Simplify and add context for 'Edit' links
Browse files Browse the repository at this point in the history
  • Loading branch information
mbeall committed Apr 11, 2016
1 parent 7ed7a64 commit 6c8b6ef
Show file tree
Hide file tree
Showing 14 changed files with 118 additions and 37 deletions.
2 changes: 1 addition & 1 deletion format-aside.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<div class="row">
<article id="post-<?php the_ID(); ?>" <?php post_class( 'col-xs-12' ); ?>>
<div class="entry-content">
<?php if ( current_user_can( 'edit_posts' ) ) { ?><a class="btn btn-default btn-sm btn-edit hidden-xs" href="<?php echo get_edit_post_link(); ?>">Edit Aside</a><?php } ?>
<?php edit_post_link( __( 'Edit Aside', 'flint' ), '', '', 0, 'btn btn-default btn-sm btn-edit hidden-xs' ); ?>
<blockquote><?php flint_the_content(); ?></blockquote>
</div><!-- .entry-content -->

Expand Down
10 changes: 7 additions & 3 deletions format-chat.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@
<?php echo flint_post_margin( true ); ?>
<article id="post-<?php the_ID(); ?>" <?php flint_post_class(); ?>>
<header class="entry-header">
<h1 class="entry-title"><?php if ( is_single() ) { echo the_title();
} else { echo '<a href="' . get_permalink() . '" rel="bookmark">' . get_the_title() . '</a>'; } ?></h1>
<?php if ( current_user_can( 'edit_posts' ) ) { ?><a class="btn btn-default btn-sm btn-edit hidden-xs" href="<?php echo get_edit_post_link(); ?>">Edit Chat</a><?php } ?>
<h1 class="entry-title"><?php
if ( is_single() ) {
echo the_title();
} else {
echo '<a href="' . get_permalink() . '" rel="bookmark">' . get_the_title() . '</a>';
} ?></h1>
<?php edit_post_link( __( 'Edit Chat', 'flint' ), '', '', 0, 'btn btn-default btn-sm btn-edit hidden-xs' ); ?>

<?php if ( 'post' === get_post_type() ) : ?>
<div class="entry-meta">
Expand Down
10 changes: 7 additions & 3 deletions format-gallery.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@
<?php echo flint_post_margin( true ); ?>
<article id="post-<?php the_ID(); ?>" <?php flint_post_class(); ?>>
<header class="entry-header">
<h1 class="entry-title"><?php if ( is_single() ) { echo the_title();
} else { echo '<a href="' . get_permalink() . '" rel="bookmark">' . get_the_title() . '</a>'; } ?></h1>
<?php if ( current_user_can( 'edit_posts' ) ) { ?><a class="btn btn-default btn-sm btn-edit hidden-xs" href="<?php echo get_edit_post_link(); ?>">Edit Gallery</a><?php } ?>
<h1 class="entry-title"><?php
if ( is_single() ) {
echo the_title();
} else {
echo '<a href="' . get_permalink() . '" rel="bookmark">' . get_the_title() . '</a>';
} ?></h1>
<?php edit_post_link( __( 'Edit Gallery', 'flint' ), '', '', 0, 'btn btn-default btn-sm btn-edit hidden-xs' ); ?>
<?php if ( ! is_single() ) { ?><a class="btn btn-info btn-block visible-xs-block" href="<?php echo get_permalink(); ?>">View gallery</a><?php } ?>
<div class="entry-meta">
<?php do_action( 'flint_entry_meta_above_post' ); ?>
Expand Down
2 changes: 1 addition & 1 deletion format-link.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<article id="post-<?php the_ID(); ?>" <?php flint_post_class(); ?>>
<div class="entry-content">
<h3><?php flint_the_content(); ?></h3>
<?php if ( current_user_can( 'edit_posts' ) ) { ?><a class="btn btn-default btn-sm btn-edit hidden-xs" href="<?php echo get_edit_post_link(); ?>">Edit Link</a><?php } ?>
<?php edit_post_link( __( 'Edit Link', 'flint' ), '', '', 0, 'btn btn-default btn-sm btn-edit hidden-xs' ); ?>
</div><!-- .entry-content -->

<footer class="entry-meta clearfix">
Expand Down
2 changes: 1 addition & 1 deletion format-status.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<article id="post-<?php the_ID(); ?>" <?php post_class( 'col-xs-12' ); ?>>
<div class="entry-content">
<h4><?php flint_the_content(); ?></h4>
<?php if ( current_user_can( 'edit_posts' ) ) { ?><a class="btn btn-default btn-sm btn-edit hidden-xs" href="<?php echo get_edit_post_link(); ?>">Edit Status</a><?php } ?>
<?php edit_post_link( __( 'Edit Status', 'flint' ), '', '', 0, 'btn btn-default btn-sm btn-edit hidden-xs' ); ?>
</div><!-- .entry-content -->

<footer class="entry-meta clearfix">
Expand Down
20 changes: 16 additions & 4 deletions format.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,30 @@
* @since 1.0.1
*/

global $wp_post_types;
$type = get_post_type();
$_type = $wp_post_types[ $type ];
?>

<div class="row">
<?php echo flint_post_margin( true ); ?>
<article id="post-<?php the_ID(); ?>" <?php flint_post_class(); ?>>
<header class="entry-header">
<?php $type = get_post_type(); ?>
<?php do_action( 'flint_open_entry_header_' . $type ); ?>

<h1 class="entry-title"><?php if ( is_single() ) { echo the_title();
} else { echo '<a href="' . get_permalink() . '" rel="bookmark">' . get_the_title() . '</a>'; } ?></h1>
<?php if ( current_user_can( 'edit_posts' ) ) { ?><a class="btn btn-default btn-sm btn-edit hidden-xs" href="<?php echo get_edit_post_link(); ?>">Edit</a><?php } ?>
<h1 class="entry-title"><?php
if ( is_single() ) {
echo the_title();
} else {
echo '<a href="' . get_permalink() . '" rel="bookmark">' . get_the_title() . '</a>';
} ?></h1>
<?php edit_post_link(
sprintf( __( 'Edit %s', 'flint' ), $_type->labels->singular_name ),
'',
'',
0,
'btn btn-default btn-sm btn-edit hidden-xs'
); ?>

<div class="entry-meta">
<?php do_action( 'flint_entry_meta_above_' . $type ); ?>
Expand Down
2 changes: 1 addition & 1 deletion image.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
get_the_title( $post->post_parent )
);
?>
<?php edit_post_link( __( 'Edit', 'flint' ), '<span class="sep"> | </span> <span class="edit-link">', '</span>' ); ?>
<?php edit_post_link( __( 'Edit Post', 'flint' ), '<span class="sep"> | </span> <span class="edit-link">', '</span>' ); ?>
</div><!-- .entry-meta -->

<nav role="navigation" id="image-navigation" class="navigation-image">
Expand Down
4 changes: 2 additions & 2 deletions inc/class-walker-comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ protected function ping( $comment, $depth, $args ) {
?>
<<?php echo $tag; ?> id="comment-<?php comment_ID(); ?>" <?php comment_class(); ?>>
<div class="comment-body">
<?php esc_html_e( 'Pingback:', 'flint' ); ?> <?php comment_author_link(); ?> <?php flint_edit_comment_link( __( 'Edit', 'flint' ), '<span class="edit-link">', '</span>' ); ?>
<?php esc_html_e( 'Pingback:', 'flint' ); ?> <?php comment_author_link(); ?> <?php flint_edit_comment_link( __( 'Edit Pingback', 'flint' ), '<span class="edit-link">', '</span>' ); ?>
</div>
<?php
}
Expand Down Expand Up @@ -79,7 +79,7 @@ protected function comment( $comment, $depth, $args ) {
<div class="comment-meta commentmetadata"><a href="<?php echo esc_url( get_comment_link( $comment->comment_ID, $args ) ); ?>">
<?php
/* translators: 1: date, 2: time */
printf( __( '%1$s at %2$s', 'flint' ), get_comment_date(), get_comment_time() ); ?></a><?php flint_edit_comment_link( __( 'Edit', 'flint' ), '&nbsp;&nbsp;', '' );
printf( __( '%1$s at %2$s', 'flint' ), get_comment_date(), get_comment_time() ); ?></a><?php flint_edit_comment_link( __( 'Edit Comment', 'flint' ), '&nbsp;&nbsp;', '' );
?>
</div>

Expand Down
2 changes: 1 addition & 1 deletion inc/template-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -1211,7 +1211,7 @@ function flint_edit_comment_link( $text = null, $before = '', $after = '' ) {
}

if ( null === $text ) {
$text = __( 'Edit This', 'flint' );
$text = __( 'Edit Comment', 'flint' );
}

$link = '<a class="comment-edit-link btn btn-default btn-sm" href="' . get_edit_comment_link( $comment->comment_ID ) . '">' . $text . '</a>';
Expand Down
20 changes: 16 additions & 4 deletions templates/full-content.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
* @since 1.1.0
*/

global $wp_post_types;
$type = get_post_type();
$_type = $wp_post_types[ $type ];
?>

<div class="row">
Expand All @@ -14,12 +17,21 @@
</div>
<article id="post-<?php the_ID(); ?>" <?php post_class( 'col-xs-12 col-sm-10 col-md-8' ); ?>>
<header class="entry-header">
<?php $type = get_post_type(); ?>
<?php do_action( 'flint_open_entry_header_' . $type ); ?>

<h1 class="entry-title"><?php if ( is_singular() ) { echo the_title();
} else { echo '<a href="' . get_permalink() . '" rel="bookmark">' . get_the_title() . '</a>'; } ?></h1>
<?php if ( current_user_can( 'edit_posts' ) ) { ?><a class="btn btn-default btn-sm btn-edit hidden-xs" href="<?php echo get_edit_post_link(); ?>">Edit</a><?php } ?>
<h1 class="entry-title"><?php
if ( is_singular() ) {
echo the_title();
} else {
echo '<a href="' . get_permalink() . '" rel="bookmark">' . get_the_title() . '</a>';
} ?></h1>
<?php edit_post_link(
sprintf( __( 'Edit %s', 'flint' ), $_type->labels->singular_name ),
'',
'',
0,
'btn btn-default btn-sm btn-edit hidden-xs'
); ?>

<div class="entry-meta">
<?php do_action( 'flint_entry_meta_above_' . $type ); ?>
Expand Down
20 changes: 16 additions & 4 deletions templates/narrow-content.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
* @since 1.1.0
*/

global $wp_post_types;
$type = get_post_type();
$_type = $wp_post_types[ $type ];
?>

<div class="row">
Expand All @@ -15,12 +18,21 @@
</div>
<article id="post-<?php the_ID(); ?>" <?php post_class( 'col-xs-12 col-sm-8 col-md-6' ); ?>>
<header class="entry-header">
<?php $type = get_post_type(); ?>
<?php do_action( 'flint_open_entry_header_' . $type ); ?>

<h1 class="entry-title"><?php if ( is_singular() ) { echo the_title();
} else { echo '<a href="' . get_permalink() . '" rel="bookmark">' . get_the_title() . '</a>'; } ?></h1>
<?php if ( current_user_can( 'edit_posts' ) ) { ?><a class="btn btn-default btn-sm btn-edit hidden-xs" href="<?php echo get_edit_post_link(); ?>">Edit</a><?php } ?>
<h1 class="entry-title"><?php
if ( is_singular() ) {
echo the_title();
} else {
echo '<a href="' . get_permalink() . '" rel="bookmark">' . get_the_title() . '</a>';
} ?></h1>
<?php edit_post_link(
sprintf( __( 'Edit %s', 'flint' ), $_type->labels->singular_name ),
'',
'',
0,
'btn btn-default btn-sm btn-edit hidden-xs'
); ?>

<div class="entry-meta">
<?php do_action( 'flint_entry_meta_above_' . $type ); ?>
Expand Down
20 changes: 16 additions & 4 deletions templates/slim-content.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
* @since 1.1.0
*/

global $wp_post_types;
$type = get_post_type();
$_type = $wp_post_types[ $type ];
?>

<div class="row">
Expand All @@ -15,12 +18,21 @@
</div>
<article id="post-<?php the_ID(); ?>" <?php post_class( 'col-xs-12 col-sm-8 col-md-4' ); ?>>
<header class="entry-header">
<?php $type = get_post_type(); ?>
<?php do_action( 'flint_open_entry_header_' . $type ); ?>

<h1 class="entry-title"><?php if ( is_singular() ) { echo the_title();
} else { echo '<a href="' . get_permalink() . '" rel="bookmark">' . get_the_title() . '</a>'; } ?></h1>
<?php if ( current_user_can( 'edit_posts' ) ) { ?><a class="btn btn-default btn-sm btn-edit hidden-xs" href="<?php echo get_edit_post_link(); ?>">Edit</a><?php } ?>
<h1 class="entry-title"><?php
if ( is_singular() ) {
echo the_title();
} else {
echo '<a href="' . get_permalink() . '" rel="bookmark">' . get_the_title() . '</a>';
} ?></h1>
<?php edit_post_link(
sprintf( __( 'Edit %s', 'flint' ), $_type->labels->singular_name ),
'',
'',
0,
'btn btn-default btn-sm btn-edit hidden-xs'
); ?>

<div class="entry-meta">
<?php do_action( 'flint_entry_meta_above_' . $type ); ?>
Expand Down
20 changes: 16 additions & 4 deletions templates/wide-content.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,29 @@
* @since 1.1.0
*/

global $wp_post_types;
$type = get_post_type();
$_type = $wp_post_types[ $type ];
?>

<div class="row">
<article id="post-<?php the_ID(); ?>" <?php post_class( 'col-xs-12' ); ?>>
<header class="entry-header">
<?php $type = get_post_type(); ?>
<?php do_action( 'flint_open_entry_header_' . $type ); ?>

<h1 class="entry-title"><?php if ( is_singular() ) { echo the_title();
} else { echo '<a href="' . get_permalink() . '" rel="bookmark">' . get_the_title() . '</a>'; } ?></h1>
<?php if ( current_user_can( 'edit_posts' ) ) { ?><a class="btn btn-default btn-sm btn-edit hidden-xs" href="<?php echo get_edit_post_link(); ?>">Edit</a><?php } ?>
<h1 class="entry-title"><?php
if ( is_singular() ) {
echo the_title();
} else {
echo '<a href="' . get_permalink() . '" rel="bookmark">' . get_the_title() . '</a>';
} ?></h1>
<?php edit_post_link(
sprintf( __( 'Edit %s', 'flint' ), $_type->labels->singular_name ),
'',
'',
0,
'btn btn-default btn-sm btn-edit hidden-xs'
); ?>

<div class="entry-meta">
<?php do_action( 'flint_entry_meta_above_' . $type ); ?>
Expand Down
21 changes: 17 additions & 4 deletions type.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,31 @@
* @since 1.0.1
*/

global $wp_post_types;
$type = get_post_type();
$_type = $wp_post_types[ $type ];

?>

<div class="row">
<?php echo flint_post_margin( true ); ?>
<article id="post-<?php the_ID(); ?>" <?php flint_post_class(); ?>>
<header class="entry-header">
<?php $type = get_post_type(); ?>
<?php do_action( 'flint_open_entry_header_' . $type ); ?>

<h1 class="entry-title"><?php if ( is_singular() ) { echo the_title();
} else { echo '<a href="' . get_permalink() . '" rel="bookmark">' . get_the_title() . '</a>'; } ?></h1>
<?php if ( current_user_can( 'edit_posts' ) ) { ?><a class="btn btn-default btn-sm btn-edit hidden-xs" href="<?php echo get_edit_post_link(); ?>">Edit</a><?php } ?>
<h1 class="entry-title"><?php
if ( is_singular() ) {
echo the_title();
} else {
echo '<a href="' . get_permalink() . '" rel="bookmark">' . get_the_title() . '</a>';
} ?></h1>
<?php edit_post_link(
sprintf( __( 'Edit %s', 'flint' ), $_type->labels->singular_name ),
'',
'',
0,
'btn btn-default btn-sm btn-edit hidden-xs'
); ?>

<div class="entry-meta">
<?php do_action( 'flint_entry_meta_above_' . $type ); ?>
Expand Down

0 comments on commit 6c8b6ef

Please sign in to comment.