Replace get_the_category() with get_the_categories(). Props filosofo. Fixes #15407
git-svn-id: http://svn.automattic.com/wordpress/trunk@16332 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -119,7 +119,7 @@ function get_permalink($id = 0, $leavename = false) {
|
||||
|
||||
$category = '';
|
||||
if ( strpos($permalink, '%category%') !== false ) {
|
||||
$cats = get_the_category($post->ID);
|
||||
$cats = get_the_categories($post->ID);
|
||||
if ( $cats ) {
|
||||
usort($cats, '_usort_terms_by_ID'); // order by ID
|
||||
$category = $cats[0]->slug;
|
||||
|
||||
Reference in New Issue
Block a user