Make WordPress Core

Changeset 24490


Ignore:
Timestamp:
06/21/2013 12:45:11 PM (12 years ago)
Author:
SergeyBiryukov
Message:

PHPDoc fixes and additions. fixes #24616.

Location:
trunk/wp-includes
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/category-template.php

    r24377 r24490  
    3838 * @param bool $nicename Optional, default is false. Whether to use nice name for display.
    3939 * @param array $visited Optional. Already linked to categories to prevent duplicates.
    40  * @return string
     40 * @return string|WP_Error A list of category parents on success, WP_Error on failure.
    4141 */
    4242function get_category_parents( $id, $link = false, $separator = '/', $nicename = false, $visited = array() ) {
     
    132132 *
    133133 * @param int $cat_ID Category ID.
    134  * @return string Category name.
     134 * @return string|WP_Error Category name on success, WP_Error on failure.
    135135 */
    136136function get_the_category_by_ID( $cat_ID ) {
     
    981981 *
    982982 * @param int $id Post ID.
    983  * @return array
     983 * @return array|bool Array of tag objects on success, false on failure.
    984984 */
    985985function get_the_tags( $id = 0 ) {
     
    997997 * @param string $after Optional. After tags.
    998998 * @param int $id Optional. Post ID. Defaults to the current post.
    999  * @return string
     999 * @return string|bool|WP_Error A list of tags on success, false or WP_Error on failure.
    10001000 */
    10011001function get_the_tag_list( $before = '', $sep = '', $after = '', $id = 0 ) {
     
    10111011 * @param string $sep Optional. Separate items using this.
    10121012 * @param string $after Optional. After list.
    1013  * @return string
    10141013 */
    10151014function the_tags( $before = null, $sep = ', ', $after = '' ) {
     
    10551054 * @since 2.5.0
    10561055 *
    1057  * @param mixed $post Post ID or object.
     1056 * @param int|object $post Post ID or object.
    10581057 * @param string $taxonomy Taxonomy name.
    1059  * @return array|bool False on failure. Array of term objects on success.
     1058 * @return array|bool|WP_Error Array of term objects on success, false or WP_Error on failure.
    10601059 */
    10611060function get_the_terms( $post, $taxonomy ) {
     
    10871086 * @param string $sep Optional. Separate items using this.
    10881087 * @param string $after Optional. After list.
    1089  * @return string
     1088 * @return string|bool|WP_Error A list of terms on success, false or WP_Error on failure.
    10901089 */
    10911090function get_the_term_list( $id, $taxonomy, $before = '', $sep = '', $after = '' ) {
  • trunk/wp-includes/comment.php

    r24480 r24490  
    540540 * @param mixed $meta_value Metadata value.
    541541 * @param bool $unique Optional, default is false. Whether the same key should not be added.
    542  * @return bool False for failure. True for success.
     542 * @return int|bool Meta ID on success, false on failure.
    543543 */
    544544function add_comment_meta($comment_id, $meta_key, $meta_value, $unique = false) {
     
    560560 * @param string $meta_key Metadata name.
    561561 * @param mixed $meta_value Optional. Metadata value.
    562  * @return bool False for failure. True for success.
     562 * @return bool True on success, false on failure.
    563563 */
    564564function delete_comment_meta($comment_id, $meta_key, $meta_value = '') {
     
    599599 * @param mixed $meta_value Metadata value.
    600600 * @param mixed $prev_value Optional. Previous value to check before removing.
    601  * @return bool False on failure, true if success.
     601 * @return bool True on success, false on failure.
    602602 */
    603603function update_comment_meta($comment_id, $meta_key, $meta_value, $prev_value = '') {
     
    995995 * @param int $comment_id Comment ID
    996996 * @param bool $force_delete Whether to bypass trash and force deletion. Default is false.
    997  * @return bool False if delete comment query failure, true on success.
     997 * @return bool True on success, false on failure.
    998998 */
    999999function wp_delete_comment($comment_id, $force_delete = false) {
     
    10451045 *
    10461046 * @param int $comment_id Comment ID.
    1047  * @return mixed False on failure
     1047 * @return bool True on success, false on failure.
    10481048 */
    10491049function wp_trash_comment($comment_id) {
     
    10741074 *
    10751075 * @param int $comment_id Comment ID.
    1076  * @return mixed False on failure
     1076 * @return bool True on success, false on failure.
    10771077 */
    10781078function wp_untrash_comment($comment_id) {
     
    11041104 *
    11051105 * @param int $comment_id Comment ID.
    1106  * @return mixed False on failure
     1106 * @return bool True on success, false on failure.
    11071107 */
    11081108function wp_spam_comment($comment_id) {
     
    11291129 *
    11301130 * @param int $comment_id Comment ID.
    1131  * @return mixed False on failure
     1131 * @return bool True on success, false on failure.
    11321132 */
    11331133function wp_unspam_comment($comment_id) {
     
    14241424 * @param string $comment_status New comment status, either 'hold', 'approve', 'spam', or 'trash'.
    14251425 * @param bool $wp_error Whether to return a WP_Error object if there is a failure. Default is false.
    1426  * @return bool False on failure or deletion and true on success.
     1426 * @return bool|WP_Error True on success, false or WP_Error on failure.
    14271427 */
    14281428function wp_set_comment_status($comment_id, $comment_status, $wp_error = false) {
     
    16021602 *
    16031603 * @param int $post_id Post ID
    1604  * @return bool False on '0' $post_id or if post with ID does not exist. True on success.
     1604 * @return bool True on success, false on '0' $post_id or if post with ID does not exist.
    16051605 */
    16061606function wp_update_comment_count_now($post_id) {
  • trunk/wp-includes/formatting.php

    r24448 r24490  
    31173117 * @since 2.5.0
    31183118 *
    3119  * @param integer $str String to get the excerpt from.
     3119 * @param string $str String to get the excerpt from.
    31203120 * @param integer $count Maximum number of characters to take.
    31213121 * @param string $more Optional. What to append if $str needs to be trimmed. Defaults to empty string.
  • trunk/wp-includes/js/quicktags.js

    r24052 r24490  
    297297     *     QTags.addButton( 'my_id2', 'my button', '<br />' );
    298298     *
    299      * @param id string required Button HTML ID
    300      * @param display string required Button's value="..."
    301      * @param arg1 string || function required Either a starting tag to be inserted like "<span>" or a callback that is executed when the button is clicked.
    302      * @param arg2 string optional Ending tag like "</span>"
    303      * @param access_key string optional Access key for the button.
    304      * @param title string optional Button's title="..."
    305      * @param priority int optional Number representing the desired position of the button in the toolbar. 1 - 9 = first, 11 - 19 = second, 21 - 29 = third, etc.
    306      * @param instance string optional Limit the button to a specifric instance of Quicktags, add to all instances if not present.
     299     * @param string id Required. Button HTML ID
     300     * @param string display Required. Button's value="..."
     301     * @param string|function arg1 Required. Either a starting tag to be inserted like "<span>" or a callback that is executed when the button is clicked.
     302     * @param string arg2 Optional. Ending tag like "</span>"
     303     * @param string access_key Optional. Access key for the button.
     304     * @param string title Optional. Button's title="..."
     305     * @param int priority Optional. Number representing the desired position of the button in the toolbar. 1 - 9 = first, 11 - 19 = second, 21 - 29 = third, etc.
     306     * @param string instance Optional. Limit the button to a specifric instance of Quicktags, add to all instances if not present.
    307307     * @return mixed null or the button object that is needed for back-compat.
    308308     */
  • trunk/wp-includes/link-template.php

    r24182 r24490  
    233233 * @since 1.5.0
    234234 *
    235  * @param mixed $post Optional. Post ID or object.
     235 * @param int|object $post Optional. Post ID or object.
    236236 * @param bool $leavename Optional, defaults to false. Whether to keep page name.
    237237 * @param bool $sample Optional, defaults to false. Is it a sample permalink.
     
    257257 * @access private
    258258 *
    259  * @param mixed $post Optional. Post ID or object.
     259 * @param int|object $post Optional. Post ID or object.
    260260 * @param bool $leavename Optional. Leave name.
    261261 * @param bool $sample Optional. Sample permalink.
     
    292292 * @since 2.0.0
    293293 *
    294  * @param mixed $post Optional. Post ID or object.
     294 * @param int|object $post Optional. Post ID or object.
    295295 * @param bool $leavename Optional. Leave name.
    296296 * @return string
  • trunk/wp-includes/meta.php

    r23591 r24490  
    2727 *      unique for the object. If true, and the object already has a value for the specified
    2828 *      metadata key, no change will be made
    29  * @return bool The meta ID on successful update, false on failure.
     29 * @return int|bool The meta ID on successful update, false on failure.
    3030 */
    3131function add_metadata($meta_type, $object_id, $meta_key, $meta_value, $unique = false) {
  • trunk/wp-includes/post-template.php

    r24466 r24490  
    9797 * @since 0.71
    9898 *
    99  * @param mixed $post Optional. Post ID or object.
     99 * @param int|object $post Optional. Post ID or object.
    100100 * @return string
    101101 */
     
    12661266 *
    12671267 * @param string $template The specific template name if specific matching is required.
    1268  * @return bool False on failure, true if success.
     1268 * @return bool True on success, false on failure.
    12691269 */
    12701270function is_page_template( $template = '' ) {
  • trunk/wp-includes/post.php

    r24400 r24490  
    204204 * @param int $attachment_id Attachment ID
    205205 * @param string $file File path for the attachment
    206  * @return bool False on failure, true on success.
     206 * @return bool True on success, false on failure.
    207207 */
    208208function update_attached_file( $attachment_id, $file ) {
     
    725725 * @uses sanitize_post_field() See for possible $context values.
    726726 *
    727  * @param string $field Post field name
    728  * @param id $post Post ID
    729  * @param string $context Optional. How to filter the field. Default is display.
    730  * @return bool|string False on failure or returns the value in post field
     727 * @param string $field Post field name.
     728 * @param int|object $post Post ID or post object.
     729 * @param string $context Optional. How to filter the field. Default is 'display'.
     730 * @return string The value of the post field on success, empty string on failure.
    731731 */
    732732function get_post_field( $field, $post, $context = 'display' ) {
     
    750750 * @since 2.0.0
    751751 *
    752  * @param int $ID Optional. Post ID.
    753  * @return bool|string False on failure or returns the mime type
     752 * @param int $ID Optional. Post ID. Default is the current post from the loop.
     753 * @return string|bool The mime type on success, false on failure.
    754754 */
    755755function get_post_mime_type($ID = '') {
     
    770770 * @since 2.0.0
    771771 *
    772  * @param int $ID Post ID
    773  * @return string|bool Post status or false on failure.
     772 * @param int $ID Optional. Post ID. Default is the current post from the loop.
     773 * @return string|bool Post status on success, false on failure.
    774774 */
    775775function get_post_status($ID = '') {
     
    10101010 * @since 2.1.0
    10111011 *
    1012  * @uses $post The Loop current post global
    1013  *
    1014  * @param mixed $post Optional. Post object or post ID.
    1015  * @return bool|string post type or false on failure.
     1012 * @param int|object $post Optional. Post ID or post object. Default is the current post from the loop.
     1013 * @return string|bool Post type on success, false on failure.
    10161014 */
    10171015function get_post_type( $post = null ) {
     
    16761674 * @param mixed $meta_value Metadata value.
    16771675 * @param bool $unique Optional, default is false. Whether the same key should not be added.
    1678  * @return bool False for failure. True for success.
     1676 * @return int|bool Meta ID on success, false on failure.
    16791677 */
    16801678function add_post_meta($post_id, $meta_key, $meta_value, $unique = false) {
     
    17001698 * @param string $meta_key Metadata name.
    17011699 * @param mixed $meta_value Optional. Metadata value.
    1702  * @return bool False for failure. True for success.
     1700 * @return bool True on success, false on failure.
    17031701 */
    17041702function delete_post_meta($post_id, $meta_key, $meta_value = '') {
     
    17431741 * @param mixed $meta_value Metadata value.
    17441742 * @param mixed $prev_value Optional. Previous value to check before removing.
    1745  * @return bool False on failure, true if success.
     1743 * @return bool True on success, false on failure.
    17461744 */
    17471745function update_post_meta($post_id, $meta_key, $meta_value, $prev_value = '') {
     
    23922390 * @uses do_action() on 'trashed_post_comments' after trashing
    23932391 *
    2394  * @param int $post Post ID or object.
     2392 * @param int|object $post Post ID or object.
    23952393 * @return mixed False on failure
    23962394 */
     
    24332431 * @uses do_action() on 'untrashed_post_comments' after trashing
    24342432 *
    2435  * @param int $post Post ID or object.
     2433 * @param int|object $post Post ID or object.
    24362434 * @return mixed False on failure
    24372435 */
     
    29542952 * @uses do_action() Calls 'edit_post', 'save_post', and 'wp_insert_post' on post_id and post data.
    29552953 *
    2956  * @param mixed $post Post ID or object.
     2954 * @param int|object $post Post ID or object.
    29572955 */
    29582956function wp_publish_post( $post ) {
     
    46074605 * @uses do_action() Calls 'clean_post_cache' on $id before adding children (if any).
    46084606 *
    4609  * @param object|int $post The post object or ID to remove from the cache
     4607 * @param int|object $post Post ID or object to remove from the cache
    46104608 */
    46114609function clean_post_cache( $post ) {
  • trunk/wp-includes/user.php

    r24345 r24490  
    792792 * @param mixed $meta_value Metadata value.
    793793 * @param bool $unique Optional, default is false. Whether the same key should not be added.
    794  * @return bool False for failure. True for success.
     794 * @return int|bool Meta ID on success, false on failure.
    795795 */
    796796function add_user_meta($user_id, $meta_key, $meta_value, $unique = false) {
     
    812812 * @param string $meta_key Metadata name.
    813813 * @param mixed $meta_value Optional. Metadata value.
    814  * @return bool False for failure. True for success.
     814 * @return bool True on success, false on failure.
    815815 */
    816816function delete_user_meta($user_id, $meta_key, $meta_value = '') {
     
    851851 * @param mixed $meta_value Metadata value.
    852852 * @param mixed $prev_value Optional. Previous value to check before removing.
    853  * @return bool False on failure, true if success.
     853 * @return bool True on success, false on failure.
    854854 */
    855855function update_user_meta($user_id, $meta_key, $meta_value, $prev_value = '') {
Note: See TracChangeset for help on using the changeset viewer.