Make WordPress Core

Ticket #5634: category-template.phpdoc.r6597.diff

File category-template.phpdoc.r6597.diff, 8.4 KB (added by darkdragon, 18 years ago)

Incomplete documentation for category-template.php based off of r6597

  • category-template.php

     
    11<?php
     2/**
     3 *
     4 *
     5 * @package WordPress
     6 * @subpackage Template
     7 */
    28
     9/**
     10 * get_category_children() - {@internal Missing Short Description}}
     11 *
     12 * {@internal Missing Long Description}}
     13 *
     14 * @since 1.2.0
     15 *
     16 * @param unknown_type $id
     17 * @param unknown_type $before
     18 * @param unknown_type $after
     19 * @return unknown
     20 */
    321function get_category_children($id, $before = '/', $after = '') {
    422        if ( 0 == $id )
    523                return '';
    624
    725        $chain = '';
    8         // TODO: consult hierarchy
     26        /** TODO: consult hierarchy */
    927        $cat_ids = get_all_category_ids();
    1028        foreach ( $cat_ids as $cat_id ) {
    1129                if ( $cat_id == $id )
     
    2139        }
    2240        return $chain;
    2341}
    24 
     42/**
     43 * get_category_link() - {@internal Missing Short Description}}
     44 *
     45 * {@internal Missing Long Description}}
     46 *
     47 * @since 1.0.0
     48 *
     49 * @param unknown_type $category_id
     50 * @return unknown
     51 */
    2552function get_category_link($category_id) {
    2653        global $wp_rewrite;
    2754        $catlink = $wp_rewrite->get_category_permastruct();
     
    4471        return apply_filters('category_link', $catlink, $category_id);
    4572}
    4673
     74/**
     75 * get_category_parents() - {@internal Missing Short Description}}
     76 *
     77 * {@internal Missing Long Description}}
     78 *
     79 * @since 1.2.0
     80 *
     81 * @param unknown_type $id
     82 * @param unknown_type $link
     83 * @param unknown_type $separator
     84 * @param unknown_type $nicename
     85 * @return unknown
     86 */
    4787function get_category_parents($id, $link = FALSE, $separator = '/', $nicename = FALSE){
    4888        $chain = '';
    4989        $parent = &get_category($id);
     
    65105        return $chain;
    66106}
    67107
     108/**
     109 * get_the_category() - {@internal Missing Short Description}}
     110 *
     111 * {@internal Missing Long Description}}
     112 *
     113 * @since 0.71
     114 * @uses $post
     115 * @global mixed $term_cache
     116 *
     117 * @param unknown_type $id
     118 * @return unknown
     119 */
    68120function get_the_category($id = false) {
    69121        global $post;
    70122
     
    88140        return $categories;
    89141}
    90142
     143/**
     144 * _usort_terms_by_name() - {@internal Missing Short Description}}
     145 *
     146 * {@internal Missing Long Description}}
     147 *
     148 * @since 2.3.0
     149 *
     150 * @param unknown_type $a
     151 * @param unknown_type $b
     152 * @return unknown
     153 */
    91154function _usort_terms_by_name($a, $b) {
    92155        return strcmp($a->name, $b->name);
    93156}
    94157
     158/**
     159 * _usort_terms_by_ID() - {@internal Missing Short Description}}
     160 *
     161 * {@internal Missing Long Description}}
     162 *
     163 * @since 2.3.0
     164 *
     165 * @param unknown_type $a
     166 * @param unknown_type $b
     167 * @return unknown
     168 */
    95169function _usort_terms_by_ID($a, $b) {
    96170        if ( $a->term_id > $b->term_id )
    97171                return 1;
     
    101175                return 0;
    102176}
    103177
     178/**
     179 * get_the_category_by_ID() - {@internal Missing Short Description}}
     180 *
     181 * {@internal Missing Long Description}}
     182 *
     183 * @since 0.71
     184 *
     185 * @param unknown_type $cat_ID
     186 * @return unknown
     187 */
    104188function get_the_category_by_ID($cat_ID) {
    105189        $cat_ID = (int) $cat_ID;
    106190        $category = &get_category($cat_ID);
     
    109193        return $category->name;
    110194}
    111195
     196/**
     197 * get_the_category_list() - {@internal Missing Short Description}}
     198 *
     199 * {@internal Missing Long Description}}
     200 *
     201 * @since 1.5.1
     202 *
     203 * @param unknown_type $separator
     204 * @param unknown_type $parents
     205 * @return unknown
     206 */
    112207function get_the_category_list($separator = '', $parents='') {
    113208        global $wp_rewrite;
    114209        $categories = get_the_category();
     
    167262        return apply_filters('the_category', $thelist, $separator, $parents);
    168263}
    169264
     265/**
     266 * in_category() - {@internal Missing Short Description}}
     267 *
     268 * {@internal Missing Long Description}}
     269 *
     270 * @since 1.2.0
     271 *
     272 * @param unknown_type $category
     273 * @return unknown
     274 */
    170275function in_category( $category ) { // Check if the current post is in the given category
    171276        global $post;
    172277
     
    179284                return false;
    180285}
    181286
     287/**
     288 * the_category() - {@internal Missing Short Description}}
     289 *
     290 * @since 0.71
     291 *
     292 * @param unknown_type $separator
     293 * @param unknown_type $parents
     294 */
    182295function the_category($separator = '', $parents='') {
    183296        echo get_the_category_list($separator, $parents);
    184297}
    185298
     299/**
     300 * category_description() - {@internal Missing Short Description}}
     301 *
     302 * {@internal Missing Long Description}}
     303 *
     304 * @since 2.1.0
     305 *
     306 * @param unknown_type $category
     307 * @return unknown
     308 */
    186309function category_description($category = 0) {
    187310        global $cat;
    188311        if ( !$category )
     
    191314        return get_term_field('description', $category, 'category');
    192315}
    193316
     317/**
     318 * wp_dropdown_categories() - {@internal Missing Short Description}}
     319 *
     320 * {@internal Missing Long Description}}
     321 *
     322 * @since 2.1.0
     323 *
     324 * @param unknown_type $args
     325 * @return unknown
     326 */
    194327function wp_dropdown_categories($args = '') {
    195328        $defaults = array(
    196329                'show_option_all' => '', 'show_option_none' => '',
     
    241374        return $output;
    242375}
    243376
     377/**
     378 * wp_list_categories() - {@internal Missing Short Description}}
     379 *
     380 * {@internal Missing Long Description}}
     381 *
     382 * @since 2.1.0
     383 *
     384 * @param unknown_type $args
     385 * @return unknown
     386 */
    244387function wp_list_categories($args = '') {
    245388        $defaults = array(
    246389                'show_option_all' => '', 'orderby' => 'name',
     
    307450                return $output;
    308451}
    309452
     453/**
     454 * wp_tag_cloud() - {@internal Missing Short Description}}
     455 *
     456 * {@internal Missing Long Description}}
     457 *
     458 * @since 2.3.0
     459 *
     460 * @param unknown_type $args
     461 * @return unknown
     462 */
    310463function wp_tag_cloud( $args = '' ) {
    311464        $defaults = array(
    312465                'smallest' => 8, 'largest' => 22, 'unit' => 'pt', 'number' => 45,
     
    327480                echo apply_filters( 'wp_tag_cloud', $return, $args );
    328481}
    329482
    330 // $tags = prefetched tag array ( get_tags() )
    331 // $args['format'] = 'flat' => whitespace separated, 'list' => UL, 'array' => array()
    332 // $args['orderby'] = 'name', 'count'
     483/**
     484 * wp_generate_tag_cloud() - {@internal Missing Short Description}}
     485 *
     486 * {@internal Missing Long Description}}
     487 * $tags = prefetched tag array ( get_tags() )
     488 * $args['format'] = 'flat' => whitespace separated, 'list' => UL, 'array' => array()
     489 * $args['orderby'] = 'name', 'count'
     490 *
     491 * @since 2.3.0
     492 *
     493 * @param unknown_type $tags
     494 * @param unknown_type $args
     495 * @return unknown
     496 */
    333497function wp_generate_tag_cloud( $tags, $args = '' ) {
    334498        global $wp_rewrite;
    335499        $defaults = array(
     
    402566// Helper functions
    403567//
    404568
     569/**
     570 * walk_category_tree() - {@internal Missing Short Description}}
     571 *
     572 * {@internal Missing Long Description}}
     573 *
     574 * @since 2.1.0
     575 *
     576 * @return unknown
     577 */
    405578function walk_category_tree() {
    406579        $walker = new Walker_Category;
    407580        $args = func_get_args();
    408581        return call_user_func_array(array(&$walker, 'walk'), $args);
    409582}
    410583
     584/**
     585 * walk_category_dropdown_tree() - {@internal Missing Short Description}}
     586 *
     587 * {@internal Missing Long Description}}
     588 *
     589 * @since 2.1.0
     590 *
     591 * @return unknown
     592 */
    411593function walk_category_dropdown_tree() {
    412594        $walker = new Walker_CategoryDropdown;
    413595        $args = func_get_args();
     
    418600// Tags
    419601//
    420602
     603/**
     604 * get_tag_link() - {@internal Missing Short Description}}
     605 *
     606 * {@internal Missing Long Description}}
     607 *
     608 * @since 2.3.0
     609 *
     610 * @param unknown_type $tag_id
     611 * @return unknown
     612 */
    421613function get_tag_link( $tag_id ) {
    422614        global $wp_rewrite;
    423615        $taglink = $wp_rewrite->get_tag_permastruct();
     
    437629        return apply_filters('tag_link', $taglink, $tag_id);
    438630}
    439631
     632/**
     633 * get_the_tags() - {@internal Missing Short Description}}
     634 *
     635 * {@internal Missing Long Description}}
     636 *
     637 * @since 2.3.0
     638 *
     639 * @param unknown_type $id
     640 * @return unknown
     641 */
    440642function get_the_tags( $id = 0 ) {
    441643        global $post;
    442644
     
    458660        return $tags;
    459661}
    460662
     663/**
     664 * get_the_tag_list() - {@internal Missing Short Description}}
     665 *
     666 * {@internal Missing Long Description}}
     667 *
     668 * @since 2.3.0
     669 *
     670 * @param unknown_type $before
     671 * @param unknown_type $sep
     672 * @param unknown_type $after
     673 * @return unknown
     674 */
    461675function get_the_tag_list( $before = '', $sep = '', $after = '' ) {
    462676        $tags = get_the_tags();
    463677
     
    481695        return $tag_list;
    482696}
    483697
     698/**
     699 * the_tags() - {@internal Missing Short Description}}
     700 *
     701 * {@internal Missing Long Description}}
     702 *
     703 * @since 2.3.0
     704 *
     705 * @param unknown_type $before
     706 * @param unknown_type $sep
     707 * @param unknown_type $after
     708 * @return unknown
     709 */
    484710function the_tags( $before = 'Tags: ', $sep = ', ', $after = '' ) {
    485711        $return = get_the_tag_list($before, $sep, $after);
    486712        if ( is_wp_error( $return ) )
     
    489715                echo $return;
    490716}
    491717
    492 ?>
     718?>
     719 No newline at end of file