Skip to content

Commit 3bbffe0

Browse files
committed
Reformat code
1 parent 925991e commit 3bbffe0

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

content-image.php

+9-6
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111

1212
<?php // only show edit button if user has permission to edit posts
1313
global $user_level;
14-
if ($user_level > 0) $edit_link = '<a href="' . get_edit_post_link(get_the_ID()) . '" class="btn btn-success edit-post pull-right"><i class="glyphicon glyphicon-pencil"></i> ' . __("Edit", "stormbringer") . '</a>';
14+
if ( ($user_level > 0 && !is_singular()) || ( !is_admin_bar_showing() && $user_level > 0 && is_singular() ) ) {
15+
$edit_link = '<a href="' . get_edit_post_link( get_the_ID() ) . '" class="btn btn-success edit-post pull-right"><span class="glyphicon glyphicon-pencil"></span> ' . __( 'Edit', 'stormbringer' ) . '</a>';
16+
}
1517
?>
1618
<?php if (is_single() || is_page() || is_singular()) { ?>
1719
<header class="page-header">
@@ -21,9 +23,11 @@
2123
<?php } else { ?>
2224
<header class="entry-header">
2325
<?php echo $edit_link; ?>
24-
<h2 class="entry-title"><a class="entry-title"
25-
title="<?php printf(esc_attr__('Link to %s', 'stormbringer'), the_title_attribute('echo=0')); ?>"
26-
rel="bookmark" href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
26+
<h2 class="entry-title">
27+
<a class="entry-title" title="<?php printf(esc_attr__('Link to %s', 'stormbringer'), the_title_attribute('echo=0')); ?>" rel="bookmark" href="<?php the_permalink(); ?>">
28+
<?php the_title(); ?>
29+
</a>
30+
</h2>
2731
</header>
2832
<?php } ?>
2933
<!-- /.entry-header -->
@@ -32,8 +36,7 @@
3236

3337
<p class="entry-date">
3438
<i class="glyphicon glyphicon-calendar"></i>
35-
<time datetime="<?php echo the_time('c'); ?>"
36-
class="updated"><?php echo get_the_date(esc_attr__('F j, Y', 'stormbringer')); ?></time>
39+
<time datetime="<?php echo the_time('c'); ?>" class="updated"><?php echo get_the_date(esc_attr__('F j, Y', 'stormbringer')); ?></time>
3740
</p>
3841

3942
<p class="entry-author">

content.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
<?php // Only show edit button if user has permission to edit posts
2626
global $user_level;
27-
if ( $user_level > 0 ) {
27+
if ( ($user_level > 0 && !is_singular()) || ( !is_admin_bar_showing() && $user_level > 0 && is_singular() ) ) {
2828
$edit_link = '<a href="' . get_edit_post_link( get_the_ID() ) . '" class="btn btn-success edit-post pull-right"><span class="glyphicon glyphicon-pencil"></span> ' . __( 'Edit', 'stormbringer' ) . '</a>';
2929
}
3030
?>

0 commit comments

Comments
 (0)