WordPress.org

Make WordPress Core

Ticket #4904: wp-app-cat.patch

File wp-app-cat.patch, 1.4 KB (added by rubys, 7 years ago)
  • wp-app.php

     
    195195                $categories = ""; 
    196196                $cats = get_categories("hierarchical=0&hide_empty=0"); 
    197197                foreach ((array) $cats as $cat) { 
    198                         $categories .= "    <category term=\"" . attribute_escape($cat->cat_name) .  "\" />\n"; 
     198                        $categories .= "    <category term=\"" . attribute_escape($cat->name) .  "\" />\n"; 
    199199} 
    200200                $output = <<<EOD 
    201201<app:categories xmlns:app="$this->ATOMPUB_NS" 
     
    232232                $post_category = array(); 
    233233 
    234234                foreach($wp_cats as $cat) { 
    235                         if(in_array($cat->cat_name, $catnames)) 
    236                                 array_push($post_category, $cat->cat_ID); 
     235                        if(in_array($cat->name, $catnames)) 
     236                                array_push($post_category, $cat->term_id); 
    237237                } 
    238238 
    239239                $publish = (isset($entry->draft) && trim($entry->draft) == 'yes') ? false : true; 
     
    810810<?php } ?> 
    811811        <link rel="edit" href="<?php $this->the_entry_url() ?>" /> 
    812812<?php foreach(get_the_category() as $category) { ?> 
    813         <category scheme="<?php bloginfo_rss('home') ?>" term="<?php echo $category->cat_name?>" /> 
     813        <category scheme="<?php bloginfo_rss('home') ?>" term="<?php echo $category->name?>" /> 
    814814<?php } ?> 
    815815<?php list($content_type, $content) = $this->prep_content(get_the_excerpt()); ?> 
    816816        <summary type="<?php echo $content_type ?>"><?php echo $content ?></summary>