As @Rarst said, use PHP code inside a post content is bad habit. But you can use another workaround to show a section only for appropriate users.
Add the following code into your functions.php
file:
add_shortcode( 'if_user_can', 'wpse8170_show_content_if_user_can' );
function wpse8170_show_content_if_user_can( $atts, $content="" ) {
$atts = shortcode_atts( array( 'capability' => 'edit_posts' ), $atts );
return current_user_can( $atts['capability'] ) ? $content : '';
}
This snippet will allow you to use [if_user_can capability="..."]...[/if_user_can]
shortcode in your posts. You can pass a capability into shortcode by using capability="..."
attribute. If an user has required capability, then shortcode content will be shown, otherwise nothing will appea on a page.
Use it like this:
[if_user_can capability="edit_posts"]
<div class="action">
<div class="pe-container"><section class="row-fluid">
<div class="span12">
<h5>To edit this page <a href="https://wordpress.stackexchange.com/questions/114158/wp-admin/post.php?post=179&action=edit">CLICK HERE <i class="icon-right-open-mini"></i></a></h5>
</div>
</section></div>
</div>
[/if_user_can]