WordPress.org

Make WordPress Core

Changeset 21598


Ignore:
Timestamp:
08/23/2012 08:34:41 PM (8 years ago)
Author:
ryan
Message:

Update phpdoc for functions that return WP_Post. Soft deprecate get_page(). see #21309

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/post.php

    r21597 r21598  
    400400 *
    401401 * @param string $post_type A post type string, defaults to 'post'.
    402  * @return object stdClass object containing all the default post data as attributes
     402 * @return WP_Post Post object containing all the default post data as attributes
    403403 */
    404404function get_default_post_to_edit( $post_type = 'post', $create_in_db = false ) {
     
    456456 * @since 2.5.0
    457457 *
    458  * @return object stdClass object containing all the default post data as attributes
     458 * @return WP_Post Post object containing all the default post data as attributes
    459459 */
    460460function get_default_page_to_edit() {
     
    469469 * @since 2.0.0
    470470 *
    471  * @param unknown_type $id
    472  * @return unknown
     471 * @param int $id
     472 * @return WP_Post
    473473 */
    474474function get_post_to_edit( $id ) {
  • trunk/wp-includes/post.php

    r21597 r21598  
    376376 * @param string $output Optional, default is Object. Either OBJECT, ARRAY_A, or ARRAY_N.
    377377 * @param string $filter Optional, default is raw.
    378  * @return mixed Post data or null on failure
     378 * @return WP_Post|null WP_Post on success or null on failure
    379379 */
    380380function get_post( $post, $output = OBJECT, $filter = 'raw' ) {
     
    17801780 * @uses sanitize_post_field() Used to sanitize the fields.
    17811781 *
    1782  * @param object|array $post The Post Object or Array
     1782 * @param object|WP_Post|array $post The Post Object or Array
    17831783 * @param string $context Optional, default is 'display'. How to sanitize post fields.
    1784  * @return object|array The now sanitized Post Object or Array (will be the same type as $post)
     1784 * @return object|WP_Post|array The now sanitized Post Object or Array (will be the same type as $post)
    17851785 */
    17861786function sanitize_post($post, $context = 'display') {
     
    24992499 * @param int $postid Post ID.
    25002500 * @param string $mode How to return result, either OBJECT, ARRAY_N, or ARRAY_A.
    2501  * @return object|array Post object or array holding post contents and information
     2501 * @return WP_Post|array WP_Post object or array holding post contents and information
    25022502 */
    25032503function wp_get_single_post($postid = 0, $mode = OBJECT) {
     
    32893289 * Retrieves page data given a page ID or page object.
    32903290 *
     3291 * Use get_post() instead instead of get_page().
     3292 *
    32913293 * @since 1.5.1
     3294 * @deprecated 3.5.0
    32923295 *
    32933296 * @param mixed $page Page object or page ID. Passed by reference.
    32943297 * @param string $output What to output. OBJECT, ARRAY_A, or ARRAY_N.
    32953298 * @param string $filter How the return value should be filtered.
    3296  * @return mixed Page data.
     3299 * @return WP_Post|null WP_Post on success or null on failure
    32973300 */
    32983301function get_page( $page, $output = OBJECT, $filter = 'raw') {
     
    33093312 * @param string $output Optional. Output type. OBJECT, ARRAY_N, or ARRAY_A. Default OBJECT.
    33103313 * @param string $post_type Optional. Post type. Default page.
    3311  * @return mixed Null when complete.
     3314 * @return WP_Post|null WP_Post on success or null on failure
    33123315 */
    33133316function get_page_by_path($page_path, $output = OBJECT, $post_type = 'page') {
     
    33633366 * @param string $output Optional. Output type. OBJECT, ARRAY_N, or ARRAY_A. Default OBJECT.
    33643367 * @param string $post_type Optional. Post type. Default page.
    3365  * @return mixed
     3368 * @return WP_Post|null WP_Post on success or null on failure
    33663369 */
    33673370function get_page_by_title($page_title, $output = OBJECT, $post_type = 'page' ) {
  • trunk/wp-includes/query.php

    r21597 r21598  
    27862786     * @access public
    27872787     *
    2788      * @return object Next post.
     2788     * @return WP_Post Next post.
    27892789     */
    27902790    function next_post() {
Note: See TracChangeset for help on using the changeset viewer.