WordPress.org

Make WordPress Core

Ticket #7659: 7659.r9239.diff

File 7659.r9239.diff, 15.3 KB (added by jacobsantos, 6 years ago)

Complete post-template.php based off of r9239

  • post-template.php

     
    9292} 
    9393 
    9494/** 
    95  * {@internal Missing Short Description}} 
     95 * Retrieve post title. 
    9696 * 
    97  * {@internal Missing Long Description}} 
     97 * If the post is protected and the visitor is not an admin, then "Protected" 
     98 * will be displayed before the post title. If the post is private, then 
     99 * "Private" will be located before the post title. 
    98100 * 
    99101 * @since 0.71 
    100102 * 
    101  * @param int $id 
    102  * @return unknown 
     103 * @param int $id Optional. Post ID. 
     104 * @return string 
    103105 */ 
    104106function get_the_title( $id = 0 ) { 
    105107        $post = &get_post($id); 
     
    116118} 
    117119 
    118120/** 
    119  * {@internal Missing Short Description}} 
     121 * Display the Post Global Unique Identifier (guid). 
    120122 * 
    121  * {@internal Missing Long Description}} 
     123 * The guid will appear to be a link, but should not be used as an link to the 
     124 * post. The reason you should not use it as a link, is because of moving the 
     125 * blog across domains. 
    122126 * 
    123127 * @since 1.5.0 
    124128 * 
    125  * @param unknown_type $id 
     129 * @param int $id Optional. Post ID. 
    126130 */ 
    127131function the_guid( $id = 0 ) { 
    128132        echo get_the_guid($id); 
    129133} 
    130134 
    131135/** 
    132  * {@internal Missing Short Description}} 
     136 * Retrieve the Post Global Unique Identifier (guid). 
    133137 * 
    134  * {@internal Missing Long Description}} 
     138 * The guid will appear to be a link, but should not be used as an link to the 
     139 * post. The reason you should not use it as a link, is because of moving the 
     140 * blog across domains. 
    135141 * 
    136142 * @since 1.5.0 
    137143 * 
    138  * @param unknown_type $id 
    139  * @return unknown 
     144 * @param int $id Optional. Post ID. 
     145 * @return string 
    140146 */ 
    141147function get_the_guid( $id = 0 ) { 
    142148        $post = &get_post($id); 
     
    145151} 
    146152 
    147153/** 
    148  * {@internal Missing Short Description}} 
     154 * Display the post content. 
    149155 * 
    150  * {@internal Missing Long Description}} 
    151  * 
    152156 * @since 0.71 
    153157 * 
    154  * @param unknown_type $more_link_text 
    155  * @param unknown_type $stripteaser 
    156  * @param unknown_type $more_file 
     158 * @param string $more_link_text Optional. Content for when there is more text. 
     159 * @param string $stripteaser Optional. Teaser content before the more text. 
     160 * @param string $more_file Optional. Not used. 
    157161 */ 
    158162function the_content($more_link_text = null, $stripteaser = 0, $more_file = '') { 
    159163        $content = get_the_content($more_link_text, $stripteaser, $more_file); 
     
    163167} 
    164168 
    165169/** 
    166  * {@internal Missing Short Description}} 
     170 * Retrieve the post content. 
    167171 * 
    168  * {@internal Missing Long Description}} 
    169  * 
    170172 * @since 0.71 
    171173 * 
    172  * @param unknown_type $more_link_text 
    173  * @param unknown_type $stripteaser 
    174  * @param unknown_type $more_file 
    175  * @return unknown 
     174 * @param string $more_link_text Optional. Content for when there is more text. 
     175 * @param string $stripteaser Optional. Teaser content before the more text. 
     176 * @param string $more_file Optional. Not used. 
     177 * @return string 
    176178 */ 
    177179function get_the_content($more_link_text = null, $stripteaser = 0, $more_file = '') { 
    178180        global $id, $post, $more, $page, $pages, $multipage, $preview, $pagenow; 
     
    182184 
    183185        $output = ''; 
    184186 
    185         if ( post_password_required($post) ) {  // If post password required and it doesn't match the cookie 
     187        // If post password required and it doesn't match the cookie. 
     188        if ( post_password_required($post) ) { 
    186189                $output = get_the_password_form(); 
    187190                return $output; 
    188191        } 
     
    226229} 
    227230 
    228231/** 
    229  * {@internal Missing Short Description}} 
     232 * Display the post excerpt. 
    230233 * 
    231  * {@internal Missing Long Description}} 
    232  * 
    233234 * @since 0.71 
    234  * @uses apply_filters() -  
     235 * @uses apply_filters() Calls 'the_excerpt' hook on post excerpt. 
    235236 */ 
    236237function the_excerpt() { 
    237238        echo apply_filters('the_excerpt', get_the_excerpt()); 
    238239} 
    239240 
    240241/** 
    241  * {@internal Missing Short Description}} 
     242 * Retrieve the post excerpt. 
    242243 * 
    243  * {@internal Missing Long Description}} 
    244  * 
    245244 * @since 0.71 
    246245 * 
    247  * @param unknown_type $deprecated 
    248  * @return unknown 
     246 * @param mixed $deprecated Not used. 
     247 * @return string 
    249248 */ 
    250249function get_the_excerpt($deprecated = '') { 
    251250        global $post; 
     
    260259} 
    261260 
    262261/** 
    263  * {@internal Missing Short Description}} 
     262 * Whether post has excerpt. 
    264263 * 
    265  * {@internal Missing Long Description}} 
    266  * 
    267264 * @since 2.3.0 
    268265 * 
    269  * @param unknown_type $id 
    270  * @return unknown 
     266 * @param int $id Optional. Post ID. 
     267 * @return bool 
    271268 */ 
    272269function has_excerpt( $id = 0 ) { 
    273270        $post = &get_post( $id ); 
     
    277274/** 
    278275 * Display the classes for the post div. 
    279276 * 
    280  * {@internal Missing Long Description}} 
    281  * 
    282277 * @since 2.7.0 
    283278 * 
    284  * @param string|array $class One or more classes to add to the class list 
     279 * @param string|array $class One or more classes to add to the class list. 
    285280 * @param int $post_id An optional post ID. 
    286281 */ 
    287282function post_class( $class = '', $post_id = null ) { 
     
    292287/** 
    293288 * Retrieve the classes for the post div as an array. 
    294289 * 
    295  * {@internal Missing Long Description}} 
     290 * The class names are add are many. If the post is a sticky, then the 'sticky' 
     291 * class name. The class 'hentry' is always added to each post. For each 
     292 * category, the class will be added with 'category-' with category slug is 
     293 * added. The tags are the same way as the categories with 'tag-' before the tag 
     294 * slug. All classes are passed through the filter, 'post_class' with the list 
     295 * of classes, followed by $class parameter value, with the post ID as the last 
     296 * parameter. 
    296297 * 
    297298 * @since 2.7.0 
    298299 * 
    299  * @param string|array $class One or more classes to add to the class list 
    300  * @param int $post_id An optional post ID 
    301  * @return array Array of classes 
     300 * @param string|array $class One or more classes to add to the class list. 
     301 * @param int $post_id An optional post ID. 
     302 * @return array Array of classes. 
    302303 */ 
    303304function get_post_class( $class = '', $post_id = null ) { 
    304305        $post = get_post($post_id); 
     
    338339} 
    339340 
    340341/** 
    341  * Determines if post requires a password and if the correct password has been provided. 
     342 * Whether post requires password and correct password has been provided. 
    342343 * 
    343  * {@internal Missing Long Description}} 
    344  * 
    345344 * @since 2.7.0 
    346345 * 
    347346 * @param int|object $post An optional post.  Global $post used if not provided. 
    348  * @return bool false if a password is not required or the correct password cookie is present, true otherwise 
     347 * @return bool false if a password is not required or the correct password cookie is present, true otherwise. 
    349348 */ 
    350349function post_password_required( $post = null ) { 
    351350        $post = get_post($post); 
     
    367366 * 
    368367 * @since 2.7.0 
    369368 * 
    370  * @param int $post_id An optional post ID 
     369 * @param int $post_id An optional post ID. 
    371370 */ 
    372371function sticky_class( $post_id = null ) { 
    373372        if ( !is_sticky($post_id) ) 
     
    384383 */ 
    385384 
    386385/** 
    387  * The formatted output of a list of Pages. 
     386 * The formatted output of a list of pages. 
    388387 * 
    389  * Displays page-links for paginated posts (i.e. includes the <!--nextpage-->  Quicktag one or 
    390  * more times). This works in much the same way as link_pages(), the difference being that 
    391  * arguments are given in query string format. This tag must be within The_Loop.  
     388 * Displays page links for paginated posts (i.e. includes the <!--nextpage-->. 
     389 * Quicktag one or more times). This works in much the same way as link_pages(), 
     390 * the difference being that arguments are given in query string format. This 
     391 * tag must be within The Loop. 
    392392 * 
    393393 * The defaults for overwriting are: 
    394  * 'next_or_number' - Default is 'number' (string). Indicates whether page numbers should be 
    395  *      used. Valid values are number and next. 
     394 * 'next_or_number' - Default is 'number' (string). Indicates whether page 
     395 *      numbers should be used. Valid values are number and next. 
    396396 * 'nextpagelink' - Default is 'Next Page' (string). Text for link to next page. 
    397  *              of the bookmark. 
    398  * 'previouspagelink' - Default is 'Previous Page' (string). Text for link to previous page. 
    399  *              available. 
    400  * 'pagelink' - Default is '%' (String).Format string for page numbers. The  %  in the 
    401  *      parameter string will be replaced with the page number, so Page % generates 
    402  *      "Page 1", "Page 2", etc. Defaults to %, just the page number.  
    403  * 'before' - Default is '<p> Pages:' (string). The html or text to prepend to each 
    404  *              bookmarks. 
     397 *      of the bookmark. 
     398 * 'previouspagelink' - Default is 'Previous Page' (string). Text for link to 
     399 *      previous page, if available. 
     400 * 'pagelink' - Default is '%' (String).Format string for page numbers. The % in 
     401 *      the parameter string will be replaced with the page number, so Page % 
     402 *      generates "Page 1", "Page 2", etc. Defaults to %, just the page number. 
     403 * 'before' - Default is '<p> Pages:' (string). The html or text to prepend to 
     404 *      each bookmarks. 
    405405 * 'after' - Default is '</p>' (string). The html or text to append to each 
    406  *              bookmarks. 
    407  * 'more_file' - Default is '' (string) Page the links should point to. Defaults to 
    408  *      the current page. 
     406 *      bookmarks. 
     407 * 'more_file' - Default is '' (string) Page the links should point to. Defaults 
     408 *      to the current page. 
    409409 * 'link_before' - Default is '' (string). The html or text to prepend to each 
    410  *              Pages link inside the <a> tag. 
     410 *      Pages link inside the <a> tag. 
    411411 * 'link_after' - Default is '' (string). The html or text to append to each 
    412  *              Pages link inside the <a> tag. 
     412 *      Pages link inside the <a> tag. 
    413413 * 
    414414 * @since 1.2.0 
    415415 * @access private 
    416416 * 
    417  * @param array $bookmarks List of bookmarks to traverse 
    418417 * @param string|array $args Optional. Overwrite the defaults. 
    419  * @return string Formatted output in HTML 
     418 * @return string Formatted output in HTML. 
    420419 */ 
    421420function wp_link_pages($args = '') { 
    422421        $defaults = array( 
     
    541540        } 
    542541} 
    543542 
    544  
    545543// 
    546544// Pages 
    547545// 
    548546 
    549547/** 
    550  * {@internal Missing Short Description}} 
     548 * Retrieve or display list of pages as a dropdown (select list). 
    551549 * 
    552  * {@internal Missing Long Description}} 
    553  * 
    554550 * @since 2.1.0 
    555551 * 
    556  * @param unknown_type $args 
    557  * @return unknown 
     552 * @param array|string $args Optional. Override default arguments. 
     553 * @return string HTML content, if not displaying. 
    558554 */ 
    559555function wp_dropdown_pages($args = '') { 
    560556        $defaults = array( 
     
    586582} 
    587583 
    588584/** 
    589  * {@internal Missing Short Description}} 
     585 * Retrieve or display list of pages in list (li) format. 
    590586 * 
    591  * {@internal Missing Long Description}} 
    592  * 
    593587 * @since 1.5.0 
    594588 * 
    595589 * @param array|string $args Optional. Override default arguments. 
    596  * @return unknown 
     590 * @return string HTML content, if not displaying. 
    597591 */ 
    598592function wp_list_pages($args = '') { 
    599593        $defaults = array( 
     
    711705// 
    712706 
    713707/** 
    714  * {@internal Missing Short Description}} 
     708 * Display an attachment page link using an image or icon. 
    715709 * 
    716  * {@internal Missing Long Description}} 
    717  * 
    718710 * @since 2.0.0 
    719711 * 
    720  * @param unknown_type $id 
    721  * @param unknown_type $fullsize 
    722  * @param unknown_type $max_dims 
     712 * @param int $id Optional. Post ID. 
     713 * @param bool $fullsize Optional, default is false. Whether to use full size. 
     714 * @param bool $deprecated Deprecated. Not used. 
     715 * @param bool $permalink Optional, default is false. Whether to include permalink. 
    723716 */ 
    724717function the_attachment_link($id = 0, $fullsize = false, $deprecated = false, $permalink = false) { 
    725718        if ( $fullsize ) 
     
    731724/** 
    732725 * Retrieve an attachment page link using an image or icon, if possible. 
    733726 * 
    734  * {@internal Missing Long Description}} 
     727 * @since 2.5.0 
     728 * @uses apply_filters() Calls 'wp_get_attachment_link' filter on HTML content with same parameters as function. 
    735729 * 
    736  * @since unknown 
    737  * 
    738  * @param unknown_type $id 
    739  * @param unknown_type $size 
    740  * @param unknown_type $permalink 
    741  * @param unknown_type $icon 
    742  * @return unknown 
     730 * @param int $id Optional. Post ID. 
     731 * @param string $size Optional. Image size. 
     732 * @param bool $permalink Optional, default is false. Whether to add permalink to image. 
     733 * @param bool $icon Optional, default is false. Whether to include icon. 
     734 * @return string HTML content. 
    743735 */ 
    744736function wp_get_attachment_link($id = 0, $size = 'thumbnail', $permalink = false, $icon = false) { 
    745737        $id = intval($id); 
     
    761753} 
    762754 
    763755/** 
    764  * {@internal Missing Short Description}} 
     756 * Retrieve HTML content of attachment image with link. 
    765757 * 
    766  * {@internal Missing Long Description}} 
    767  * 
    768  * @since unknown 
     758 * @since 2.0.0 
    769759 * @deprecated Use {@link wp_get_attachment_link()} 
    770760 * @see wp_get_attachment_link() Use instead. 
    771761 * 
    772  * @param unknown_type $id 
    773  * @param unknown_type $fullsize 
    774  * @param unknown_type $max_dims 
    775  * @param unknown_type $permalink 
    776  * @return unknown 
     762 * @param int $id Optional. Post ID. 
     763 * @param bool $fullsize Optional, default is false. Whether to use full size image. 
     764 * @param array $max_dims Optional. Max image dimensions. 
     765 * @param bool $permalink Optional, default is false. Whether to include permalink to image. 
     766 * @return string 
    777767 */ 
    778768function get_the_attachment_link($id = 0, $fullsize = false, $max_dims = false, $permalink = false) { 
    779769        $id = (int) $id; 
     
    792782} 
    793783 
    794784/** 
    795  * {@internal Missing Short Description}} 
     785 * Retrieve icon URL and Path. 
    796786 * 
    797  * {@internal Missing Long Description}} 
    798  * 
    799787 * @since 2.1.0 
    800788 * @deprecated Use {@link wp_get_attachment_image_src()} 
    801789 * @see wp_get_attachment_image_src() Use instead. 
    802790 * 
    803  * @param unknown_type $id 
    804  * @param unknown_type $fullsize 
    805  * @return unknown 
     791 * @param int $id Optional. Post ID. 
     792 * @param bool $fullsize Optional, default to false. Whether to have full image. 
     793 * @return array Icon URL and full path to file, respectively. 
    806794 */ 
    807795function get_attachment_icon_src( $id = 0, $fullsize = false ) { 
    808796        $id = (int) $id; 
     
    836824} 
    837825 
    838826/** 
    839  * {@internal Missing Short Description}} 
     827 * Retrieve HTML content of icon attachment image element. 
    840828 * 
    841  * {@internal Missing Long Description}} 
    842  * 
    843829 * @since 2.0.0 
    844830 * @deprecated Use {@link wp_get_attachment_image()} 
    845831 * @see wp_get_attachment_image() Use instead of. 
    846832 * 
    847  * @param unknown_type $id 
    848  * @param unknown_type $fullsize 
    849  * @param unknown_type $max_dims 
    850  * @return unknown 
     833 * @param int $id Optional. Post ID. 
     834 * @param bool $fullsize Optional, default to false. Whether to have full size image. 
     835 * @param array $max_dims Optional. Dimensions of image. 
     836 * @return string HTML content. 
    851837 */ 
    852838function get_attachment_icon( $id = 0, $fullsize = false, $max_dims = false ) { 
    853839        $id = (int) $id; 
     
    893879} 
    894880 
    895881/** 
    896  * {@internal Missing Short Description}} 
     882 * Retrieve HTML content of image element. 
    897883 * 
    898  * {@internal Missing Long Description}} 
    899  * 
    900884 * @since 2.0.0 
    901885 * @deprecated Use {@link wp_get_attachment_image()} 
    902886 * @see wp_get_attachment_image() Use instead. 
    903887 * 
    904  * @param unknown_type $id 
    905  * @param unknown_type $fullsize 
    906  * @param unknown_type $max_dims 
    907  * @return unknown 
     888 * @param int $id Optional. Post ID. 
     889 * @param bool $fullsize Optional, default to false. Whether to have full size image. 
     890 * @param array $max_dims Optional. Dimensions of image. 
     891 * @return string 
    908892 */ 
    909893function get_attachment_innerHTML($id = 0, $fullsize = false, $max_dims = false) { 
    910894        $id = (int) $id; 
     
    921905} 
    922906 
    923907/** 
    924  * {@internal Missing Short Description}} 
     908 * Wrap attachment in <<p>> element before content. 
    925909 * 
    926  * {@internal Missing Long Description}} 
    927  * 
    928910 * @since 2.0.0 
     911 * @uses apply_filters() Calls 'prepend_attachment' hook on HTML content. 
    929912 * 
    930  * @param unknown_type $content 
    931  * @return unknown 
     913 * @param string $content 
     914 * @return string 
    932915 */ 
    933916function prepend_attachment($content) { 
    934917        global $post;