phpdoc updates from jacobsantos. see #7038

git-svn-id: http://svn.automattic.com/wordpress/trunk@7990 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-05-25 15:45:05 +00:00
parent fba6b2415c
commit 62784a594f
5 changed files with 255 additions and 169 deletions

View File

@ -2,12 +2,16 @@
/**
* Author Template functions for use in themes.
*
* These functions must be used within the WordPress Loop.
*
* @link http://codex.wordpress.org/Author_Templates
*
* @package WordPress
* @subpackage Template
*/
/**
* get_the_author() - Get the author of the current post in the Loop.
* Retrieve the author of the current post.
*
* @since 1.5
* @uses $authordata The current author's DB object.
@ -22,21 +26,22 @@ function get_the_author($deprecated = '') {
}
/**
* the_author() - Echo the name of the author of the current post in the Loop.
* Display the name of the author of the current post.
*
* The behavior of this function is based off of old functionality predating get_the_author().
* This function is not deprecated, but is designed to echo the value from get_the_author()
* and as an result of any old theme that might still use the old behavior will also
* pass the value from get_the_author().
* The behavior of this function is based off of old functionality predating
* get_the_author(). This function is not deprecated, but is designed to echo
* the value from get_the_author() and as an result of any old theme that might
* still use the old behavior will also pass the value from get_the_author().
*
* The normal, expected behavior of this function is to echo the author and not return it.
* However, backwards compatiability has to be maintained.
* The normal, expected behavior of this function is to echo the author and not
* return it. However, backwards compatiability has to be maintained.
*
* @since 0.71
* @see get_the_author()
* @link http://codex.wordpress.org/Template_Tags/the_author
*
* @param string $deprecated Deprecated.
* @param string $deprecated_echo Echo the string or return it. Deprecated, use get_the_author().
* @param string $deprecated_echo Echo the string or return it.
* @return string The author's display name, from get_the_author().
*/
function the_author($deprecated = '', $deprecated_echo = true) {
@ -46,7 +51,7 @@ function the_author($deprecated = '', $deprecated_echo = true) {
}
/**
* get_the_author_description() - Get the description of the author of the current post in the Loop.
* Retrieve the description of the author of the current post.
*
* @since 1.5
* @uses $authordata The current author's DB object.
@ -58,8 +63,9 @@ function get_the_author_description() {
}
/**
* the_author_description() - Echo the description of the author of the current post in the Loop.
* Display the description of the author of the current post.
*
* @link http://codex.wordpress.org/Template_Tags/the_author_description
* @since 1.0.0
* @see get_the_author_description()
*/
@ -68,7 +74,7 @@ function the_author_description() {
}
/**
* get_the_author_login() - Get the login name of the author of the current post in the Loop.
* Retrieve the login name of the author of the current post.
*
* @since 1.5
* @uses $authordata The current author's DB object.
@ -80,8 +86,9 @@ function get_the_author_login() {
}
/**
* the_author_login() - Echo the login name of the author of the current post in the Loop.
* Display the login name of the author of the current post.
*
* @link http://codex.wordpress.org/Template_Tags/the_author_login
* @since 0.71
* @see get_the_author_login()
*/
@ -90,7 +97,7 @@ function the_author_login() {
}
/**
* get_the_author_firstname() - Get the first name of the author of the current post in the Loop.
* Retrieve the first name of the author of the current post.
*
* @since 1.5
* @uses $authordata The current author's DB object.
@ -102,8 +109,9 @@ function get_the_author_firstname() {
}
/**
* the_author_firstname() - Echo the first name of the author of the current post in the Loop.
* Display the first name of the author of the current post.
*
* @link http://codex.wordpress.org/Template_Tags/the_author_firstname
* @since 0.71
* @uses get_the_author_firstname()
*/
@ -112,7 +120,7 @@ function the_author_firstname() {
}
/**
* get_the_author_lastname() - Get the last name of the author of the current post in the Loop.
* Retrieve the last name of the author of the current post.
*
* @since 1.5
* @uses $authordata The current author's DB object.
@ -124,8 +132,9 @@ function get_the_author_lastname() {
}
/**
* the_author_lastname() - Echo the last name of the author of the current post in the Loop.
* Display the last name of the author of the current post.
*
* @link http://codex.wordpress.org/Template_Tags/the_author_lastname
* @since 0.71
* @uses get_the_author_lastname()
*/
@ -134,7 +143,7 @@ function the_author_lastname() {
}
/**
* get_the_author_nickname() - Get the nickname of the author of the current post in the Loop.
* Retrieve the nickname of the author of the current post.
*
* @since 1.5
* @uses $authordata The current author's DB object.
@ -146,8 +155,9 @@ function get_the_author_nickname() {
}
/**
* the_author_nickname() - Echo the nickname of the author of the current post in the Loop.
* Display the nickname of the author of the current post.
*
* @link http://codex.wordpress.org/Template_Tags/the_author_nickname
* @since 0.71
* @uses get_the_author_nickname()
*/
@ -156,7 +166,7 @@ function the_author_nickname() {
}
/**
* get_the_author_ID() - Get the ID of the author of the current post in the Loop.
* Retrieve the ID of the author of the current post.
*
* @since 1.5
* @uses $authordata The current author's DB object.
@ -168,8 +178,9 @@ function get_the_author_ID() {
}
/**
* the_author_ID() - Echo the ID of the author of the current post in the Loop.
* Display the ID of the author of the current post.
*
* @http://codex.wordpress.org/Template_Tags/the_author_ID
* @since 0.71
* @uses get_the_author_ID()
*/
@ -178,7 +189,7 @@ function the_author_ID() {
}
/**
* get_the_author_email() - Get the email of the author of the current post in the Loop.
* Retrieve the email of the author of the current post.
*
* @since 1.5
* @uses $authordata The current author's DB object.
@ -190,8 +201,9 @@ function get_the_author_email() {
}
/**
* the_author_email() - Echo the email of the author of the current post in the Loop.
* Display the email of the author of the current post.
*
* @link http://codex.wordpress.org/Template_Tags/the_author_email
* @since 0.71
* @uses get_the_author_email()
*/
@ -200,7 +212,7 @@ function the_author_email() {
}
/**
* get_the_author_url() - Get the URL to the home page of the author of the current post in the Loop.
* Retrieve the URL to the home page of the author of the current post.
*
* @since 1.5
* @uses $authordata The current author's DB object.
@ -216,8 +228,9 @@ function get_the_author_url() {
}
/**
* the_author_url() - Echo the URL to the home page of the author of the current post in the Loop.
* Display the URL to the home page of the author of the current post.
*
* @link http://codex.wordpress.org/Template_Tags/the_author_url
* @since 0.71
* @uses get_the_author_url()
*/
@ -226,8 +239,12 @@ function the_author_url() {
}
/**
* the_author_link() - If the author has a home page set, echo an HTML link, otherwise just echo the author's name.
* Display either author's link or author's name.
*
* If the author has a home page set, echo an HTML link, otherwise just echo the
* author's name.
*
* @link http://codex.wordpress.org/Template_Tags/the_author_link
* @since 2.1
* @uses get_the_author_url()
* @uses the_author()
@ -241,7 +258,7 @@ function the_author_link() {
}
/**
* get_the_author_icq() - Get the ICQ number of the author of the current post in the Loop.
* Retrieve the ICQ number of the author of the current post.
*
* @since 1.5
* @uses $authordata The current author's DB object.
@ -253,8 +270,9 @@ function get_the_author_icq() {
}
/**
* the_author_icq() - Echo the ICQ number of the author of the current post in the Loop.
* Display the ICQ number of the author of the current post.
*
* @link http://codex.wordpress.org/Template_Tags/the_author_icq
* @since 0.71
* @see get_the_author_icq()
*/
@ -263,7 +281,7 @@ function the_author_icq() {
}
/**
* get_the_author_aim() - Get the AIM name of the author of the current post in the Loop.
* Retrieve the AIM name of the author of the current post.
*
* @since 1.5
* @uses $authordata The current author's DB object.
@ -275,8 +293,9 @@ function get_the_author_aim() {
}
/**
* the_author_aim() - Echo the AIM name of the author of the current post in the Loop.
* Display the AIM name of the author of the current post.
*
* @link http://codex.wordpress.org/Template_Tags/the_author_aim
* @since 0.71
* @see get_the_author_aim()
*/
@ -285,7 +304,7 @@ function the_author_aim() {
}
/**
* get_the_author_yim() - Get the Yahoo! IM name of the author of the current post in the Loop.
* Retrieve the Yahoo! IM name of the author of the current post.
*
* @since 1.5
* @uses $authordata The current author's DB object.
@ -297,8 +316,9 @@ function get_the_author_yim() {
}
/**
* the_author_yim() - Echo the Yahoo! IM name of the author of the current post in the Loop.
* Display the Yahoo! IM name of the author of the current post.
*
* @link http://codex.wordpress.org/Template_Tags/the_author_yim
* @since 0.71
* @see get_the_author_yim()
*/
@ -307,7 +327,7 @@ function the_author_yim() {
}
/**
* get_the_author_msn() - Get the MSN address of the author of the current post in the Loop.
* Retrieve the MSN address of the author of the current post.
*
* @since 1.5
* @uses $authordata The current author's DB object.
@ -319,8 +339,9 @@ function get_the_author_msn() {
}
/**
* the_author_msn() - Echo the MSN address of the author of the current post in the Loop.
* Display the MSN address of the author of the current post.
*
* @link http://codex.wordpress.org/Template_Tags/the_author_msn
* @since 0.71
* @see get_the_author_msn()
*/
@ -329,7 +350,7 @@ function the_author_msn() {
}
/**
* get_the_author_posts() - Get the number of posts by the author of the current post in the Loop.
* Retrieve the number of posts by the author of the current post.
*
* @since 1.5
* @uses $post The current post in the Loop's DB object.
@ -342,8 +363,9 @@ function get_the_author_posts() {
}
/**
* the_author_posts() - Echo the number of posts by the author of the current post in the Loop.
* Display the number of posts by the author of the current post.
*
* @link http://codex.wordpress.org/Template_Tags/the_author_posts
* @since 0.71
* @uses get_the_author_posts() Echos returned value from function.
*/
@ -352,11 +374,13 @@ function the_author_posts() {
}
/**
* the_author_posts_link() - Echo an HTML link to the author page of the author of the current post in the Loop.
* Display an HTML link to the author page of the author of the current post.
*
* Does just echo get_author_posts_url() function, like the others do. The reason for this,
* is that another function is used to help in printing the link to the author's posts.
* Does just echo get_author_posts_url() function, like the others do. The
* reason for this, is that another function is used to help in printing the
* link to the author's posts.
*
* @link http://codex.wordpress.org/Template_Tags/the_author_posts_link
* @since 1.2
* @uses $authordata The current author's DB object.
* @uses get_author_posts_url()
@ -374,7 +398,7 @@ function the_author_posts_link($deprecated = '') {
}
/**
* get_author_posts_url() - Get the URL to the author page of the author of the current post in the Loop.
* Retrieve the URL to the author page of the author of the current post.
*
* @since 2.1
* @uses $wp_rewrite WP_Rewrite
@ -404,7 +428,7 @@ function get_author_posts_url($author_id, $author_nicename = '') {
}
/**
* get_author_name() - Get the specified author's preferred display name.
* Retrieve the specified author's preferred display name.
*
* @since 1.0.0
* @param int $auth_id The ID of the author.
@ -416,16 +440,19 @@ function get_author_name( $auth_id ) {
}
/**
* wp_list_authors() - List all the authors of the blog, with several options available.
* List all the authors of the blog, with several options available.
*
* optioncount (boolean) (false): Show the count in parenthesis next to the author's name.
* exclude_admin (boolean) (true): Exclude the 'admin' user that is installed by default.
* optioncount (boolean) (false): Show the count in parenthesis next to the
* author's name.
* exclude_admin (boolean) (true): Exclude the 'admin' user that is installed by
* default.
* show_fullname (boolean) (false): Show their full names.
* hide_empty (boolean) (true): Don't show authors without any posts.
* feed (string) (''): If isn't empty, show links to author's feeds.
* feed_image (string) (''): If isn't empty, use this image to link to feeds.
* echo (boolean) (true): Set to false to return the output, instead of echoing.
*
* @link http://codex.wordpress.org/Template_Tags/wp_list_authors
* @since 1.2
* @param array $args The argument array.
* @return null|string The output, if echo is set to false.

View File

@ -7,24 +7,31 @@
*/
/**
* _walk_bookmarks() - The formatted output of a list of bookmarks
* The formatted output of a list of bookmarks
*
* The $bookmarks array must contain bookmark objects and will be iterated over
* to retrieve the bookmark to be used in the output.
*
* The output is formatted as HTML with no way to change that format. However, what
* is between, before, and after can be changed. The link itself will be HTML.
* The output is formatted as HTML with no way to change that format. However,
* what is between, before, and after can be changed. The link itself will be
* HTML.
*
* This function is used internally by wp_list_bookmarks() and should not be used by
* themes.
* This function is used internally by wp_list_bookmarks() and should not be
* used by themes.
*
* The defaults for overwriting are:
* 'show_updated' - Default is 0 (integer). Will show the time of when the bookmark was last updated.
* 'show_description' - Default is 0 (integer). Whether to show the description of the bookmark.
* 'show_images' - Default is 1 (integer). Whether to show link image if available.
* 'before' - Default is '<li>' (string). The html or text to prepend to each bookmarks.
* 'after' - Default is '</li>' (string). The html or text to append to each bookmarks.
* 'between' - Default is '\n' (string). The string for use in between the link, description, and image.
* 'show_updated' - Default is 0 (integer). Will show the time of when the
* bookmark was last updated.
* 'show_description' - Default is 0 (integer). Whether to show the description
* of the bookmark.
* 'show_images' - Default is 1 (integer). Whether to show link image if
* available.
* 'before' - Default is '<li>' (string). The html or text to prepend to each
* bookmarks.
* 'after' - Default is '</li>' (string). The html or text to append to each
* bookmarks.
* 'between' - Default is '\n' (string). The string for use in between the link,
* description, and image.
* 'show_rating' - Default is 0 (integer). Whether to show the link rating.
*
* @since 2.1
@ -113,44 +120,68 @@ function _walk_bookmarks($bookmarks, $args = '' ) {
}
/**
* wp_list_bookmarks() - Retrieve or echo all of the bookmarks
* Retrieve or echo all of the bookmarks
*
* List of default arguments are as follows:
* 'orderby' - Default is 'name' (string). How to order the links by. String is based off of the bookmark scheme.
* 'order' - Default is 'ASC' (string). Either 'ASC' or 'DESC'. Orders in either ascending or descending order.
* 'limit' - Default is -1 (integer) or show all. The amount of bookmarks to display.
* 'category' - Default is empty string (string). Include the links in what category ID(s).
* 'category_name' - Default is empty string (string). Get links by category name.
* 'hide_invisible' - Default is 1 (integer). Whether to show (default) or hide links marked as 'invisible'.
* 'show_updated' - Default is 0 (integer). Will show the time of when the bookmark was last updated.
* 'echo' - Default is 1 (integer). Whether to echo (default) or return the formatted bookmarks.
* 'categorize' - Default is 1 (integer). Whether to show links listed by category (default) or show links in one column.
* 'orderby' - Default is 'name' (string). How to order the links by. String is
* based off of the bookmark scheme.
* 'order' - Default is 'ASC' (string). Either 'ASC' or 'DESC'. Orders in either
* ascending or descending order.
* 'limit' - Default is -1 (integer) or show all. The amount of bookmarks to
* display.
* 'category' - Default is empty string (string). Include the links in what
* category ID(s).
* 'category_name' - Default is empty string (string). Get links by category
* name.
* 'hide_invisible' - Default is 1 (integer). Whether to show (default) or hide
* links marked as 'invisible'.
* 'show_updated' - Default is 0 (integer). Will show the time of when the
* bookmark was last updated.
* 'echo' - Default is 1 (integer). Whether to echo (default) or return the
* formatted bookmarks.
* 'categorize' - Default is 1 (integer). Whether to show links listed by
* category (default) or show links in one column.
*
* These options define how the Category name will appear before the category links are displayed, if 'categorize' is 1.
* If 'categorize' is 0, then it will display for only the 'title_li' string and only if 'title_li' is not empty.
* 'title_li' - Default is 'Bookmarks' (translatable string). What to show before the links appear.
* 'title_before' - Default is '<h2>' (string). The HTML or text to show before the 'title_li' string.
* 'title_after' - Default is '</h2>' (string). The HTML or text to show after the 'title_li' string.
* 'class' - Default is 'linkcat' (string). The CSS class to use for the 'title_li'.
* These options define how the Category name will appear before the category
* links are displayed, if 'categorize' is 1. If 'categorize' is 0, then it will
* display for only the 'title_li' string and only if 'title_li' is not empty.
* 'title_li' - Default is 'Bookmarks' (translatable string). What to show
* before the links appear.
* 'title_before' - Default is '<h2>' (string). The HTML or text to show before
* the 'title_li' string.
* 'title_after' - Default is '</h2>' (string). The HTML or text to show after
* the 'title_li' string.
* 'class' - Default is 'linkcat' (string). The CSS class to use for the
* 'title_li'.
*
* 'category_before' - Default is '<li id="%id" class="%class">'. String must contain '%id' and '%class' to get
* the id of the category and the 'class' argument. These are used for formatting in themes. Argument will be displayed
* before the 'title_before' argument.
* 'category_after' - Default is '</li>' (string). The HTML or text that will appear after the list of links.
* 'category_before' - Default is '<li id="%id" class="%class">'. String must
* contain '%id' and '%class' to get
* the id of the category and the 'class' argument. These are used for
* formatting in themes.
* Argument will be displayed before the 'title_before' argument.
* 'category_after' - Default is '</li>' (string). The HTML or text that will
* appear after the list of links.
*
* These are only used if 'categorize' is set to 1 or true.
* 'category_orderby' - Default is 'name'. How to order the bookmark category based on term scheme.
* 'category_order' - Default is 'ASC'. Set the order by either ASC (ascending) or DESC (descending).
* 'category_orderby' - Default is 'name'. How to order the bookmark category
* based on term scheme.
* 'category_order' - Default is 'ASC'. Set the order by either ASC (ascending)
* or DESC (descending).
*
* @see _walk_bookmarks() For other arguments that can be set in this function and passed to _walk_bookmarks().
* @see get_bookmarks() For other arguments that can be set in this function and passed to get_bookmarks().
* @see _walk_bookmarks() For other arguments that can be set in this function
* and passed to _walk_bookmarks().
* @see get_bookmarks() For other arguments that can be set in this function and
* passed to get_bookmarks().
* @link http://codex.wordpress.org/Template_Tags/wp_list_bookmarks
*
* @since 2.1
* @uses _list_bookmarks() Used to iterate over all of the bookmarks and return the html
* @uses _list_bookmarks() Used to iterate over all of the bookmarks and return
* the html
* @uses get_terms() Gets all of the categories that are for links.
*
* @param string|array $args Optional. Overwrite the defaults of the function
* @return string|null Will only return if echo option is set to not echo. Default is not return anything.
* @return string|null Will only return if echo option is set to not echo.
* Default is not return anything.
*/
function wp_list_bookmarks($args = '') {
$defaults = array(

View File

@ -7,7 +7,7 @@
*/
/**
* get_bookmark() - Get Bookmark data based on ID
* Retrieve Bookmark data based on ID
*
* @since 2.1
* @uses $wpdb Database Object
@ -37,7 +37,7 @@ function get_bookmark($bookmark_id, $output = OBJECT, $filter = 'raw') {
}
/**
* get_bookmark_field() - Gets single bookmark data item or field.
* Retrieve single bookmark data item or field.
*
* @since 2.3
* @uses get_bookmark() Gets bookmark object using $bookmark as ID
@ -65,7 +65,7 @@ function get_bookmark_field( $field, $bookmark, $context = 'display' ) {
}
/**
* get_link() - Returns bookmark data based on ID.
* Retrieve bookmark data based on ID.
*
* @since 2.0
* @deprecated Use get_bookmark()
@ -80,25 +80,35 @@ function get_link($bookmark_id, $output = OBJECT, $filter = 'raw') {
}
/**
* get_bookmarks() - Retrieves the list of bookmarks
* Retrieves the list of bookmarks
*
* Attempts to retrieve from the cache first based on MD5 hash of arguments. If
* that fails, then the query will be built from the arguments and executed. The
* results will be stored to the cache.
*
* List of default arguments are as follows:
* 'orderby' - Default is 'name' (string). How to order the links by. String is based off of the bookmark scheme.
* 'order' - Default is 'ASC' (string). Either 'ASC' or 'DESC'. Orders in either ascending or descending order.
* 'limit' - Default is -1 (integer) or show all. The amount of bookmarks to display.
* 'category' - Default is empty string (string). Include the links in what category ID(s).
* 'category_name' - Default is empty string (string). Get links by category name.
* 'hide_invisible' - Default is 1 (integer). Whether to show (default) or hide links marked as 'invisible'.
* 'show_updated' - Default is 0 (integer). Will show the time of when the bookmark was last updated.
* 'include' - Default is empty string (string). Include other categories separated by commas.
* 'exclude' - Default is empty string (string). Exclude other categories separated by commas.
* 'orderby' - Default is 'name' (string). How to order the links by. String is
* based off of the bookmark scheme.
* 'order' - Default is 'ASC' (string). Either 'ASC' or 'DESC'. Orders in either
* ascending or descending order.
* 'limit' - Default is -1 (integer) or show all. The amount of bookmarks to
* display.
* 'category' - Default is empty string (string). Include the links in what
* category ID(s).
* 'category_name' - Default is empty string (string). Get links by category
* name.
* 'hide_invisible' - Default is 1 (integer). Whether to show (default) or hide
* links marked as 'invisible'.
* 'show_updated' - Default is 0 (integer). Will show the time of when the
* bookmark was last updated.
* 'include' - Default is empty string (string). Include other categories
* separated by commas.
* 'exclude' - Default is empty string (string). Exclude other categories
* separated by commas.
*
* @since 2.1
* @uses $wpdb Database Object
* @link http://codex.wordpress.org/Template_Tags/get_bookmarks
*
* @param string|array $args List of arguments to overwrite the defaults
* @return array List of bookmark row objects
@ -226,12 +236,13 @@ function get_bookmarks($args = '') {
}
/**
* sanitize_bookmark() - Sanitizes all bookmark fields
* Sanitizes all bookmark fields
*
* @since 2.3
*
* @param object|array $bookmark Bookmark row
* @param string $context Optional, default is 'display'. How to filter the fields
* @param string $context Optional, default is 'display'. How to filter the
* fields
* @return object|array Same type as $bookmark but with fields sanitized.
*/
function sanitize_bookmark($bookmark, $context = 'display') {
@ -254,25 +265,27 @@ function sanitize_bookmark($bookmark, $context = 'display') {
}
/**
* sanitize_bookmark_field() - Sanitizes a bookmark field
* Sanitizes a bookmark field
*
* Sanitizes the bookmark fields based on what the field name is. If the field has a
* strict value set, then it will be tested for that, else a more generic filtering is
* applied. After the more strict filter is applied, if the $context is 'raw' then the
* value is immediately return.
* Sanitizes the bookmark fields based on what the field name is. If the field
* has a strict value set, then it will be tested for that, else a more generic
* filtering is applied. After the more strict filter is applied, if the
* $context is 'raw' then the value is immediately return.
*
* Hooks exist for the more generic cases. With the 'edit' context, the 'edit_$field'
* filter will be called and passed the $value and $bookmark_id respectively. With the
* 'db' context, the 'pre_$field' filter is called and passed the value. The 'display'
* context is the final context and has the $field has the filter name and is passed the
* $value, $bookmark_id, and $context respectively.
* Hooks exist for the more generic cases. With the 'edit' context, the
* 'edit_$field' filter will be called and passed the $value and $bookmark_id
* respectively. With the 'db' context, the 'pre_$field' filter is called and
* passed the value. The 'display' context is the final context and has the
* $field has the filter name and is passed the $value, $bookmark_id, and
* $context respectively.
*
* @since 2.3
*
* @param string $field The bookmark field
* @param mixed $value The bookmark field value
* @param int $bookmark_id Bookmark ID
* @param string $context How to filter the field value. Either 'raw', 'edit', 'attribute', 'js', 'db', or 'display'
* @param string $context How to filter the field value. Either 'raw', 'edit',
* 'attribute', 'js', 'db', or 'display'
* @return mixed The filtered value
*/
function sanitize_bookmark_field($field, $value, $bookmark_id, $context) {
@ -318,7 +331,7 @@ function sanitize_bookmark_field($field, $value, $bookmark_id, $context) {
}
/**
* delete_get_bookmark_cache() - Deletes entire bookmark cache
* Deletes entire bookmark cache
*
* @since 2.1
* @uses wp_cache_delete() Deletes the contents of 'get_bookmarks'

View File

@ -2,12 +2,14 @@
/**
* Object Cache API
*
* @link http://codex.wordpress.org/Function_Reference/WP_Cache
*
* @package WordPress
* @subpackage Cache
*/
/**
* wp_cache_add() - Adds data to the cache, if the cache key doesn't aleady exist
* Adds data to the cache, if the cache key doesn't aleady exist.
*
* @since 2.0
* @uses $wp_object_cache Object Cache Class
@ -26,11 +28,12 @@ function wp_cache_add($key, $data, $flag = '', $expire = 0) {
}
/**
* wp_cache_close() - Closes the cache
* Closes the cache.
*
* This function has ceased to do anything since WordPress 2.5.
* The functionality was removed along with the rest of the
* persistant cache.
* This function has ceased to do anything since WordPress 2.5. The
* functionality was removed along with the rest of the persistant cache. This
* does not mean that plugins can't implement this function when they need to
* make sure that the cache is cleaned up after WordPress no longer needs it.
*
* @since 2.0
*
@ -41,7 +44,7 @@ function wp_cache_close() {
}
/**
* wp_cache_delete() - Removes the cache contents matching ID and flag
* Removes the cache contents matching ID and flag.
*
* @since 2.0
* @uses $wp_object_cache Object Cache Class
@ -58,7 +61,7 @@ function wp_cache_delete($id, $flag = '') {
}
/**
* wp_cache_flush() - Removes all cache items
* Removes all cache items.
*
* @since 2.0
* @uses $wp_object_cache Object Cache Class
@ -73,7 +76,7 @@ function wp_cache_flush() {
}
/**
* wp_cache_get() - Retrieves the cache contents from the cache by ID and flag
* Retrieves the cache contents from the cache by ID and flag.
*
* @since 2.0
* @uses $wp_object_cache Object Cache Class
@ -81,7 +84,8 @@ function wp_cache_flush() {
*
* @param int|string $id What the contents in the cache are called
* @param string $flag Where the cache contents are grouped
* @return bool|mixed False on failure to retrieve contents or the cache contents on success
* @return bool|mixed False on failure to retrieve contents or the cache
* contents on success
*/
function wp_cache_get($id, $flag = '') {
global $wp_object_cache;
@ -90,7 +94,7 @@ function wp_cache_get($id, $flag = '') {
}
/**
* wp_cache_init() - Sets up Object Cache Global and assigns it
* Sets up Object Cache Global and assigns it.
*
* @since 2.0
* @global WP_Object_Cache $wp_object_cache WordPress Object Cache
@ -100,7 +104,7 @@ function wp_cache_init() {
}
/**
* wp_cache_replace() - Replaces the contents of the cache with new data
* Replaces the contents of the cache with new data.
*
* @since 2.0
* @uses $wp_object_cache Object Cache Class
@ -119,7 +123,7 @@ function wp_cache_replace($key, $data, $flag = '', $expire = 0) {
}
/**
* wp_cache_set() - Saves the data to the cache
* Saves the data to the cache.
*
* @since 2.0
* @uses $wp_object_cache Object Cache Class
@ -138,7 +142,7 @@ function wp_cache_set($key, $data, $flag = '', $expire = 0) {
}
/**
* wp_cache_add_global_groups() - Adds a group or set of groups to the list of global groups
* Adds a group or set of groups to the list of global groups.
*
* @since 2.6
*
@ -150,7 +154,7 @@ function wp_cache_add_global_groups( $groups ) {
}
/**
* wp_cache_add_non_persistent_groups() - Adds a group or set of groups to the list of non-persistent groups
* Adds a group or set of groups to the list of non-persistent groups.
*
* @since 2.6
*
@ -164,14 +168,14 @@ function wp_cache_add_non_persistent_groups( $groups ) {
/**
* WordPress Object Cache
*
* The WordPress Object Cache is used to save on trips to the database.
* The Object Cache stores all of the cache data to memory and makes the
* cache contents available by using a key, which is used to name and
* later retrieve the cache contents.
* The WordPress Object Cache is used to save on trips to the database. The
* Object Cache stores all of the cache data to memory and makes the cache
* contents available by using a key, which is used to name and later retrieve
* the cache contents.
*
* The Object Cache can be replaced by other caching mechanisms by placing
* files in the wp-content folder which is looked at in wp-settings. If
* that file exists, then this file will not be included.
* The Object Cache can be replaced by other caching mechanisms by placing files
* in the wp-content folder which is looked at in wp-settings. If that file
* exists, then this file will not be included.
*
* @package WordPress
* @subpackage Cache
@ -219,7 +223,8 @@ class WP_Object_Cache {
* Adds data to the cache if it doesn't already exist.
*
* @uses WP_Object_Cache::get Checks to see if the cache already has data.
* @uses WP_Object_Cache::set Sets the data after the checking the cache contents existance.
* @uses WP_Object_Cache::set Sets the data after the checking the cache
* contents existance.
*
* @since 2.0
*
@ -242,18 +247,19 @@ class WP_Object_Cache {
/**
* Remove the contents of the cache ID in the group
*
* If the cache ID does not exist in the group and $force parameter
* is set to false, then nothing will happen. The $force parameter
* is set to false by default.
* If the cache ID does not exist in the group and $force parameter is set
* to false, then nothing will happen. The $force parameter is set to false
* by default.
*
* On success the group and the id will be added to the
* On success the group and the id will be added to the
* $non_existant_objects property in the class.
*
* @since 2.0
*
* @param int|string $id What the contents in the cache are called
* @param string $group Where the cache contents are grouped
* @param bool $force Optional. Whether to force the unsetting of the cache ID in the group
* @param bool $force Optional. Whether to force the unsetting of the cache
* ID in the group
* @return bool False if the contents weren't deleted and true on success
*/
function delete($id, $group = 'default', $force = false) {
@ -284,21 +290,22 @@ class WP_Object_Cache {
/**
* Retrieves the cache contents, if it exists
*
* The contents will be first attempted to be retrieved by searching
* by the ID in the cache group. If the cache is hit (success) then
* the contents are returned.
* The contents will be first attempted to be retrieved by searching by the
* ID in the cache group. If the cache is hit (success) then the contents
* are returned.
*
* On failure, the $non_existant_objects property is checked and if
* the cache group and ID exist in there the cache misses will not be
* incremented. If not in the nonexistant objects property, then the
* cache misses will be incremented and the cache group and ID will
* be added to the nonexistant objects.
* On failure, the $non_existant_objects property is checked and if the
* cache group and ID exist in there the cache misses will not be
* incremented. If not in the nonexistant objects property, then the cache
* misses will be incremented and the cache group and ID will be added to
* the nonexistant objects.
*
* @since 2.0
*
* @param int|string $id What the contents in the cache are called
* @param string $group Where the cache contents are grouped
* @return bool|mixed False on failure to retrieve contents or the cache contents on success
* @return bool|mixed False on failure to retrieve contents or the cache
* contents on success
*/
function get($id, $group = 'default') {
if (empty ($group))
@ -342,15 +349,14 @@ class WP_Object_Cache {
/**
* Sets the data contents into the cache
*
* The cache contents is grouped by the $group parameter followed
* by the $id. This allows for duplicate ids in unique groups.
* Therefore, naming of the group should be used with care and
* should follow normal function naming guidelines outside of
* core WordPress usage.
* The cache contents is grouped by the $group parameter followed by the
* $id. This allows for duplicate ids in unique groups. Therefore, naming of
* the group should be used with care and should follow normal function
* naming guidelines outside of core WordPress usage.
*
* The $expire parameter is not used, because the cache will
* automatically expire for each time a page is accessed and PHP
* finishes. The method is more for cache plugins which use files.
* The $expire parameter is not used, because the cache will automatically
* expire for each time a page is accessed and PHP finishes. The method is
* more for cache plugins which use files.
*
* @since 2.0
*
@ -378,8 +384,8 @@ class WP_Object_Cache {
/**
* Echos the stats of the caching.
*
* Gives the cache hits, and cache misses. Also prints every cached
* group, key and the data.
* Gives the cache hits, and cache misses. Also prints every cached group,
* key and the data.
*
* @since 2.0
*/
@ -417,7 +423,11 @@ class WP_Object_Cache {
* @return null|WP_Object_Cache If cache is disabled, returns null.
*/
function __construct() {
register_shutdown_function(array(&$this, "__destruct")); /** @todo This should be moved to the PHP4 style constructor, PHP5 already calls __destruct() */
/**
* @todo This should be moved to the PHP4 style constructor, PHP5
* already calls __destruct()
*/
register_shutdown_function(array(&$this, "__destruct"));
}
/**

View File

@ -2,7 +2,8 @@
/**
* Canonical API to handle WordPress Redirecting
*
* Based on "Permalink Redirect" from Scott Yang and "Enforce www. Preference" by Mark Jaquith
* Based on "Permalink Redirect" from Scott Yang and "Enforce www. Preference"
* by Mark Jaquith
*
* @author Scott Yang
* @author Mark Jaquith
@ -11,26 +12,29 @@
*/
/**
* redirect_canonical() - Redirects incoming links to the proper URL based on the site url
* Redirects incoming links to the proper URL based on the site url
*
* Search engines consider www.somedomain.com and somedomain.com to be two different URLs
* when they both go to the same location. This SEO enhancement prevents penality for
* duplicate content by redirecting all incoming links to one or the other.
* Search engines consider www.somedomain.com and somedomain.com to be two
* different URLs when they both go to the same location. This SEO enhancement
* prevents penality for duplicate content by redirecting all incoming links to
* one or the other.
*
* Prevents redirection for feeds, trackbacks, searches, comment popup, and admin URLs.
* Does not redirect on IIS, page/post previews, and on form data.
* Prevents redirection for feeds, trackbacks, searches, comment popup, and
* admin URLs. Does not redirect on IIS, page/post previews, and on form data.
*
* Will also attempt to find the correct link when a user enters a URL that does not exist
* based on exact WordPress query. Will instead try to parse the URL or query in an attempt
* to figure the correct page to go to.
* Will also attempt to find the correct link when a user enters a URL that does
* not exist based on exact WordPress query. Will instead try to parse the URL
* or query in an attempt to figure the correct page to go to.
*
* @since 2.3
* @uses $wp_rewrite
* @uses $is_IIS
*
* @param string $requested_url Optional. The URL that was requested, used to figure if redirect is needed.
* @param string $requested_url Optional. The URL that was requested, used to
* figure if redirect is needed.
* @param bool $do_redirect Optional. Redirect to the new URL.
* @return null|false|string Null, if redirect not needed. False, if redirect not needed or the string of the URL
* @return null|false|string Null, if redirect not needed. False, if redirect
* not needed or the string of the URL
*/
function redirect_canonical($requested_url=null, $do_redirect=true) {
global $wp_rewrite, $is_IIS;
@ -211,12 +215,13 @@ function redirect_canonical($requested_url=null, $do_redirect=true) {
}
/**
* redirect_guess_404_permalink() - Tries to guess correct post based on query vars
* Attempts to guess correct post based on query vars
*
* @since 2.3
* @uses $wpdb
*
* @return bool|string Returns False, if it can't find post, returns correct location on success.
* @return bool|string Returns False, if it can't find post, returns correct
* location on success.
*/
function redirect_guess_404_permalink() {
global $wpdb;