post-template phpdoc from jacobsantos. fixes #7659

git-svn-id: https://develop.svn.wordpress.org/trunk@9273 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2008-10-22 03:06:53 +00:00
parent 42d6208061
commit 8c15b4e5a6
1 changed files with 113 additions and 130 deletions

View File

@ -92,14 +92,16 @@ function the_title_attribute( $args = '' ) {
} }
/** /**
* {@internal Missing Short Description}} * Retrieve post title.
* *
* {@internal Missing Long Description}} * If the post is protected and the visitor is not an admin, then "Protected"
* will be displayed before the post title. If the post is private, then
* "Private" will be located before the post title.
* *
* @since 0.71 * @since 0.71
* *
* @param int $id * @param int $id Optional. Post ID.
* @return unknown * @return string
*/ */
function get_the_title( $id = 0 ) { function get_the_title( $id = 0 ) {
$post = &get_post($id); $post = &get_post($id);
@ -116,27 +118,31 @@ function get_the_title( $id = 0 ) {
} }
/** /**
* {@internal Missing Short Description}} * Display the Post Global Unique Identifier (guid).
* *
* {@internal Missing Long Description}} * The guid will appear to be a link, but should not be used as an link to the
* post. The reason you should not use it as a link, is because of moving the
* blog across domains.
* *
* @since 1.5.0 * @since 1.5.0
* *
* @param unknown_type $id * @param int $id Optional. Post ID.
*/ */
function the_guid( $id = 0 ) { function the_guid( $id = 0 ) {
echo get_the_guid($id); echo get_the_guid($id);
} }
/** /**
* {@internal Missing Short Description}} * Retrieve the Post Global Unique Identifier (guid).
* *
* {@internal Missing Long Description}} * The guid will appear to be a link, but should not be used as an link to the
* post. The reason you should not use it as a link, is because of moving the
* blog across domains.
* *
* @since 1.5.0 * @since 1.5.0
* *
* @param unknown_type $id * @param int $id Optional. Post ID.
* @return unknown * @return string
*/ */
function get_the_guid( $id = 0 ) { function get_the_guid( $id = 0 ) {
$post = &get_post($id); $post = &get_post($id);
@ -145,15 +151,13 @@ function get_the_guid( $id = 0 ) {
} }
/** /**
* {@internal Missing Short Description}} * Display the post content.
*
* {@internal Missing Long Description}}
* *
* @since 0.71 * @since 0.71
* *
* @param unknown_type $more_link_text * @param string $more_link_text Optional. Content for when there is more text.
* @param unknown_type $stripteaser * @param string $stripteaser Optional. Teaser content before the more text.
* @param unknown_type $more_file * @param string $more_file Optional. Not used.
*/ */
function the_content($more_link_text = null, $stripteaser = 0, $more_file = '') { function the_content($more_link_text = null, $stripteaser = 0, $more_file = '') {
$content = get_the_content($more_link_text, $stripteaser, $more_file); $content = get_the_content($more_link_text, $stripteaser, $more_file);
@ -163,16 +167,14 @@ function the_content($more_link_text = null, $stripteaser = 0, $more_file = '')
} }
/** /**
* {@internal Missing Short Description}} * Retrieve the post content.
*
* {@internal Missing Long Description}}
* *
* @since 0.71 * @since 0.71
* *
* @param unknown_type $more_link_text * @param string $more_link_text Optional. Content for when there is more text.
* @param unknown_type $stripteaser * @param string $stripteaser Optional. Teaser content before the more text.
* @param unknown_type $more_file * @param string $more_file Optional. Not used.
* @return unknown * @return string
*/ */
function get_the_content($more_link_text = null, $stripteaser = 0, $more_file = '') { function get_the_content($more_link_text = null, $stripteaser = 0, $more_file = '') {
global $id, $post, $more, $page, $pages, $multipage, $preview, $pagenow; global $id, $post, $more, $page, $pages, $multipage, $preview, $pagenow;
@ -182,7 +184,8 @@ function get_the_content($more_link_text = null, $stripteaser = 0, $more_file =
$output = ''; $output = '';
if ( post_password_required($post) ) { // If post password required and it doesn't match the cookie // If post password required and it doesn't match the cookie.
if ( post_password_required($post) ) {
$output = get_the_password_form(); $output = get_the_password_form();
return $output; return $output;
} }
@ -226,26 +229,22 @@ function get_the_content($more_link_text = null, $stripteaser = 0, $more_file =
} }
/** /**
* {@internal Missing Short Description}} * Display the post excerpt.
*
* {@internal Missing Long Description}}
* *
* @since 0.71 * @since 0.71
* @uses apply_filters() - * @uses apply_filters() Calls 'the_excerpt' hook on post excerpt.
*/ */
function the_excerpt() { function the_excerpt() {
echo apply_filters('the_excerpt', get_the_excerpt()); echo apply_filters('the_excerpt', get_the_excerpt());
} }
/** /**
* {@internal Missing Short Description}} * Retrieve the post excerpt.
*
* {@internal Missing Long Description}}
* *
* @since 0.71 * @since 0.71
* *
* @param unknown_type $deprecated * @param mixed $deprecated Not used.
* @return unknown * @return string
*/ */
function get_the_excerpt($deprecated = '') { function get_the_excerpt($deprecated = '') {
global $post; global $post;
@ -260,14 +259,12 @@ function get_the_excerpt($deprecated = '') {
} }
/** /**
* {@internal Missing Short Description}} * Whether post has excerpt.
*
* {@internal Missing Long Description}}
* *
* @since 2.3.0 * @since 2.3.0
* *
* @param unknown_type $id * @param int $id Optional. Post ID.
* @return unknown * @return bool
*/ */
function has_excerpt( $id = 0 ) { function has_excerpt( $id = 0 ) {
$post = &get_post( $id ); $post = &get_post( $id );
@ -277,11 +274,9 @@ function has_excerpt( $id = 0 ) {
/** /**
* Display the classes for the post div. * Display the classes for the post div.
* *
* {@internal Missing Long Description}}
*
* @since 2.7.0 * @since 2.7.0
* *
* @param string|array $class One or more classes to add to the class list * @param string|array $class One or more classes to add to the class list.
* @param int $post_id An optional post ID. * @param int $post_id An optional post ID.
*/ */
function post_class( $class = '', $post_id = null ) { function post_class( $class = '', $post_id = null ) {
@ -292,13 +287,19 @@ function post_class( $class = '', $post_id = null ) {
/** /**
* Retrieve the classes for the post div as an array. * Retrieve the classes for the post div as an array.
* *
* {@internal Missing Long Description}} * The class names are add are many. If the post is a sticky, then the 'sticky'
* class name. The class 'hentry' is always added to each post. For each
* category, the class will be added with 'category-' with category slug is
* added. The tags are the same way as the categories with 'tag-' before the tag
* slug. All classes are passed through the filter, 'post_class' with the list
* of classes, followed by $class parameter value, with the post ID as the last
* parameter.
* *
* @since 2.7.0 * @since 2.7.0
* *
* @param string|array $class One or more classes to add to the class list * @param string|array $class One or more classes to add to the class list.
* @param int $post_id An optional post ID * @param int $post_id An optional post ID.
* @return array Array of classes * @return array Array of classes.
*/ */
function get_post_class( $class = '', $post_id = null ) { function get_post_class( $class = '', $post_id = null ) {
$post = get_post($post_id); $post = get_post($post_id);
@ -338,14 +339,12 @@ function get_post_class( $class = '', $post_id = null ) {
} }
/** /**
* Determines if post requires a password and if the correct password has been provided. * Whether post requires password and correct password has been provided.
*
* {@internal Missing Long Description}}
* *
* @since 2.7.0 * @since 2.7.0
* *
* @param int|object $post An optional post. Global $post used if not provided. * @param int|object $post An optional post. Global $post used if not provided.
* @return bool false if a password is not required or the correct password cookie is present, true otherwise * @return bool false if a password is not required or the correct password cookie is present, true otherwise.
*/ */
function post_password_required( $post = null ) { function post_password_required( $post = null ) {
$post = get_post($post); $post = get_post($post);
@ -367,7 +366,7 @@ function post_password_required( $post = null ) {
* *
* @since 2.7.0 * @since 2.7.0
* *
* @param int $post_id An optional post ID * @param int $post_id An optional post ID.
*/ */
function sticky_class( $post_id = null ) { function sticky_class( $post_id = null ) {
if ( !is_sticky($post_id) ) if ( !is_sticky($post_id) )
@ -384,39 +383,39 @@ function sticky_class( $post_id = null ) {
*/ */
/** /**
* The formatted output of a list of Pages. * The formatted output of a list of pages.
* *
* Displays page-links for paginated posts (i.e. includes the <!--nextpage--> Quicktag one or * Displays page links for paginated posts (i.e. includes the <!--nextpage-->.
* more times). This works in much the same way as link_pages(), the difference being that * Quicktag one or more times). This works in much the same way as link_pages(),
* arguments are given in query string format. This tag must be within The_Loop. * the difference being that arguments are given in query string format. This
* tag must be within The Loop.
* *
* The defaults for overwriting are: * The defaults for overwriting are:
* 'next_or_number' - Default is 'number' (string). Indicates whether page numbers should be * 'next_or_number' - Default is 'number' (string). Indicates whether page
* used. Valid values are number and next. * numbers should be used. Valid values are number and next.
* 'nextpagelink' - Default is 'Next Page' (string). Text for link to next page. * 'nextpagelink' - Default is 'Next Page' (string). Text for link to next page.
* of the bookmark. * of the bookmark.
* 'previouspagelink' - Default is 'Previous Page' (string). Text for link to previous page. * 'previouspagelink' - Default is 'Previous Page' (string). Text for link to
* available. * previous page, if available.
* 'pagelink' - Default is '%' (String).Format string for page numbers. The % in the * 'pagelink' - Default is '%' (String).Format string for page numbers. The % in
* parameter string will be replaced with the page number, so Page % generates * the parameter string will be replaced with the page number, so Page %
* "Page 1", "Page 2", etc. Defaults to %, just the page number. * generates "Page 1", "Page 2", etc. Defaults to %, just the page number.
* 'before' - Default is '<p> Pages:' (string). The html or text to prepend to each * 'before' - Default is '<p> Pages:' (string). The html or text to prepend to
* bookmarks. * each bookmarks.
* 'after' - Default is '</p>' (string). The html or text to append to each * 'after' - Default is '</p>' (string). The html or text to append to each
* bookmarks. * bookmarks.
* 'more_file' - Default is '' (string) Page the links should point to. Defaults to * 'more_file' - Default is '' (string) Page the links should point to. Defaults
* the current page. * to the current page.
* 'link_before' - Default is '' (string). The html or text to prepend to each * 'link_before' - Default is '' (string). The html or text to prepend to each
* Pages link inside the <a> tag. * Pages link inside the <a> tag.
* 'link_after' - Default is '' (string). The html or text to append to each * 'link_after' - Default is '' (string). The html or text to append to each
* Pages link inside the <a> tag. * Pages link inside the <a> tag.
* *
* @since 1.2.0 * @since 1.2.0
* @access private * @access private
* *
* @param array $bookmarks List of bookmarks to traverse
* @param string|array $args Optional. Overwrite the defaults. * @param string|array $args Optional. Overwrite the defaults.
* @return string Formatted output in HTML * @return string Formatted output in HTML.
*/ */
function wp_link_pages($args = '') { function wp_link_pages($args = '') {
$defaults = array( $defaults = array(
@ -541,20 +540,17 @@ function the_meta() {
} }
} }
// //
// Pages // Pages
// //
/** /**
* {@internal Missing Short Description}} * Retrieve or display list of pages as a dropdown (select list).
*
* {@internal Missing Long Description}}
* *
* @since 2.1.0 * @since 2.1.0
* *
* @param unknown_type $args * @param array|string $args Optional. Override default arguments.
* @return unknown * @return string HTML content, if not displaying.
*/ */
function wp_dropdown_pages($args = '') { function wp_dropdown_pages($args = '') {
$defaults = array( $defaults = array(
@ -586,14 +582,12 @@ function wp_dropdown_pages($args = '') {
} }
/** /**
* {@internal Missing Short Description}} * Retrieve or display list of pages in list (li) format.
*
* {@internal Missing Long Description}}
* *
* @since 1.5.0 * @since 1.5.0
* *
* @param array|string $args Optional. Override default arguments. * @param array|string $args Optional. Override default arguments.
* @return unknown * @return string HTML content, if not displaying.
*/ */
function wp_list_pages($args = '') { function wp_list_pages($args = '') {
$defaults = array( $defaults = array(
@ -718,15 +712,14 @@ function walk_page_dropdown_tree() {
// //
/** /**
* {@internal Missing Short Description}} * Display an attachment page link using an image or icon.
*
* {@internal Missing Long Description}}
* *
* @since 2.0.0 * @since 2.0.0
* *
* @param unknown_type $id * @param int $id Optional. Post ID.
* @param unknown_type $fullsize * @param bool $fullsize Optional, default is false. Whether to use full size.
* @param unknown_type $max_dims * @param bool $deprecated Deprecated. Not used.
* @param bool $permalink Optional, default is false. Whether to include permalink.
*/ */
function the_attachment_link($id = 0, $fullsize = false, $deprecated = false, $permalink = false) { function the_attachment_link($id = 0, $fullsize = false, $deprecated = false, $permalink = false) {
if ( $fullsize ) if ( $fullsize )
@ -738,15 +731,14 @@ function the_attachment_link($id = 0, $fullsize = false, $deprecated = false, $p
/** /**
* Retrieve an attachment page link using an image or icon, if possible. * Retrieve an attachment page link using an image or icon, if possible.
* *
* {@internal Missing Long Description}} * @since 2.5.0
* @uses apply_filters() Calls 'wp_get_attachment_link' filter on HTML content with same parameters as function.
* *
* @since unknown * @param int $id Optional. Post ID.
* * @param string $size Optional. Image size.
* @param unknown_type $id * @param bool $permalink Optional, default is false. Whether to add permalink to image.
* @param unknown_type $size * @param bool $icon Optional, default is false. Whether to include icon.
* @param unknown_type $permalink * @return string HTML content.
* @param unknown_type $icon
* @return unknown
*/ */
function wp_get_attachment_link($id = 0, $size = 'thumbnail', $permalink = false, $icon = false) { function wp_get_attachment_link($id = 0, $size = 'thumbnail', $permalink = false, $icon = false) {
$id = intval($id); $id = intval($id);
@ -768,19 +760,17 @@ function wp_get_attachment_link($id = 0, $size = 'thumbnail', $permalink = false
} }
/** /**
* {@internal Missing Short Description}} * Retrieve HTML content of attachment image with link.
* *
* {@internal Missing Long Description}} * @since 2.0.0
*
* @since unknown
* @deprecated Use {@link wp_get_attachment_link()} * @deprecated Use {@link wp_get_attachment_link()}
* @see wp_get_attachment_link() Use instead. * @see wp_get_attachment_link() Use instead.
* *
* @param unknown_type $id * @param int $id Optional. Post ID.
* @param unknown_type $fullsize * @param bool $fullsize Optional, default is false. Whether to use full size image.
* @param unknown_type $max_dims * @param array $max_dims Optional. Max image dimensions.
* @param unknown_type $permalink * @param bool $permalink Optional, default is false. Whether to include permalink to image.
* @return unknown * @return string
*/ */
function get_the_attachment_link($id = 0, $fullsize = false, $max_dims = false, $permalink = false) { function get_the_attachment_link($id = 0, $fullsize = false, $max_dims = false, $permalink = false) {
$id = (int) $id; $id = (int) $id;
@ -799,17 +789,15 @@ function get_the_attachment_link($id = 0, $fullsize = false, $max_dims = false,
} }
/** /**
* {@internal Missing Short Description}} * Retrieve icon URL and Path.
*
* {@internal Missing Long Description}}
* *
* @since 2.1.0 * @since 2.1.0
* @deprecated Use {@link wp_get_attachment_image_src()} * @deprecated Use {@link wp_get_attachment_image_src()}
* @see wp_get_attachment_image_src() Use instead. * @see wp_get_attachment_image_src() Use instead.
* *
* @param unknown_type $id * @param int $id Optional. Post ID.
* @param unknown_type $fullsize * @param bool $fullsize Optional, default to false. Whether to have full image.
* @return unknown * @return array Icon URL and full path to file, respectively.
*/ */
function get_attachment_icon_src( $id = 0, $fullsize = false ) { function get_attachment_icon_src( $id = 0, $fullsize = false ) {
$id = (int) $id; $id = (int) $id;
@ -843,18 +831,16 @@ function get_attachment_icon_src( $id = 0, $fullsize = false ) {
} }
/** /**
* {@internal Missing Short Description}} * Retrieve HTML content of icon attachment image element.
*
* {@internal Missing Long Description}}
* *
* @since 2.0.0 * @since 2.0.0
* @deprecated Use {@link wp_get_attachment_image()} * @deprecated Use {@link wp_get_attachment_image()}
* @see wp_get_attachment_image() Use instead of. * @see wp_get_attachment_image() Use instead of.
* *
* @param unknown_type $id * @param int $id Optional. Post ID.
* @param unknown_type $fullsize * @param bool $fullsize Optional, default to false. Whether to have full size image.
* @param unknown_type $max_dims * @param array $max_dims Optional. Dimensions of image.
* @return unknown * @return string HTML content.
*/ */
function get_attachment_icon( $id = 0, $fullsize = false, $max_dims = false ) { function get_attachment_icon( $id = 0, $fullsize = false, $max_dims = false ) {
$id = (int) $id; $id = (int) $id;
@ -900,18 +886,16 @@ function get_attachment_icon( $id = 0, $fullsize = false, $max_dims = false ) {
} }
/** /**
* {@internal Missing Short Description}} * Retrieve HTML content of image element.
*
* {@internal Missing Long Description}}
* *
* @since 2.0.0 * @since 2.0.0
* @deprecated Use {@link wp_get_attachment_image()} * @deprecated Use {@link wp_get_attachment_image()}
* @see wp_get_attachment_image() Use instead. * @see wp_get_attachment_image() Use instead.
* *
* @param unknown_type $id * @param int $id Optional. Post ID.
* @param unknown_type $fullsize * @param bool $fullsize Optional, default to false. Whether to have full size image.
* @param unknown_type $max_dims * @param array $max_dims Optional. Dimensions of image.
* @return unknown * @return string
*/ */
function get_attachment_innerHTML($id = 0, $fullsize = false, $max_dims = false) { function get_attachment_innerHTML($id = 0, $fullsize = false, $max_dims = false) {
$id = (int) $id; $id = (int) $id;
@ -928,14 +912,13 @@ function get_attachment_innerHTML($id = 0, $fullsize = false, $max_dims = false)
} }
/** /**
* {@internal Missing Short Description}} * Wrap attachment in <<p>> element before content.
*
* {@internal Missing Long Description}}
* *
* @since 2.0.0 * @since 2.0.0
* @uses apply_filters() Calls 'prepend_attachment' hook on HTML content.
* *
* @param unknown_type $content * @param string $content
* @return unknown * @return string
*/ */
function prepend_attachment($content) { function prepend_attachment($content) {
global $post; global $post;