- +
diff --git a/wp-includes/template-functions.php b/wp-includes/template-functions.php
index 30d0b8dc70..1bec9fe4e7 100644
--- a/wp-includes/template-functions.php
+++ b/wp-includes/template-functions.php
@@ -541,6 +541,24 @@ function get_day_link($year, $month, $day) {
}
}
+function edit_post_link($link = 'Edit This', $before = '', $after = '') {
+ global $user_level, $post, $siteurl;
+
+ get_currentuserinfo();
+
+ if ($user_level > 0) {
+ $authordata = get_userdata($post->post_author);
+ if ($user_level < $authordata->user_level) {
+ return;
+ }
+ } else {
+ return;
+ }
+
+ $location = "$siteurl/wp-admin/post.php?action=edit&post=$post->ID";
+ echo "$before $link $after";
+}
+
/***** Date/Time tags *****/
function the_date_xml() {
@@ -550,10 +568,9 @@ function the_date_xml() {
}
function the_date($d='', $before='', $after='', $echo = true) {
- global $id, $post, $dateday, $previousday, $dateformat, $newday;
+ global $id, $post, $day, $previousday, $dateformat, $newday;
$the_date = '';
- $dateday = mysql2date('Yd', $post->post_date);
- if ($dateday != $previousday) {
+ if ($day != $previousday) {
$the_date .= $before;
if ($d=='') {
$the_date .= mysql2date($dateformat, $post->post_date);
@@ -561,7 +578,7 @@ function the_date($d='', $before='', $after='', $echo = true) {
$the_date .= mysql2date($d, $post->post_date);
}
$the_date .= $after;
- $previousday = $dateday;
+ $previousday = $day;
}
$the_date = apply_filters('the_date', $the_date);
if ($echo) {
@@ -1688,10 +1705,10 @@ function comment_text() {
$comment_text = convert_chars($comment_text);
$comment_text = convert_bbcode($comment_text);
$comment_text = convert_gmcode($comment_text);
+ $comment_text = convert_smilies($comment_text);
$comment_text = make_clickable($comment_text);
$comment_text = balanceTags($comment_text,1);
$comment_text = apply_filters('comment_text', $comment_text);
- $comment_text = convert_smilies($comment_text);
echo $comment_text;
}
@@ -1837,4 +1854,4 @@ function permalink_single_rss($file = '') {
/***** // Permalink tags *****/
-?>
\ No newline at end of file
+?>