Ticket #9466: 9466.diff
| File 9466.diff, 869 bytes (added by , 17 years ago) |
|---|
-
wp-includes/link-template.php
88 88 $leavename? '' : '%postname%', 89 89 '%post_id%', 90 90 '%category%', 91 '%tag%', 91 92 '%author%', 92 93 $leavename? '' : '%pagename%', 93 94 ); … … 129 130 } 130 131 } 131 132 133 $tag = ''; 134 if ( strpos($permalink, '%tag%') !== false ) { 135 $tags = get_the_tags($post->ID); 136 if ( !empty( $tags ) ) { 137 usort($tags, '_usort_terms_by_ID'); // order by ID 138 $tag = $tags[0]->slug; 139 } 140 } 141 132 142 $author = ''; 133 143 if ( strpos($permalink, '%author%') !== false ) { 134 144 $authordata = get_userdata($post->post_author); … … 147 157 $post->post_name, 148 158 $post->ID, 149 159 $category, 160 $tag, 150 161 $author, 151 162 $post->post_name, 152 163 );