WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/05/2019 09:21:46 PM (18 months ago)
Author:
johnbillion
Message:

Docs: Improve documentation of known return types, plus other docs fixes.

See #48303

File:
1 edited

Legend:

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

    r46596 r46660  
    707707 *
    708708 * @param string $post Post content.
    709  * @return array Post before ('main'), after ('extended'), and custom read more ('more_text').
     709 * @return string[] {
     710 *     Extended entry info.
     711 *
     712 *     @type string $main      Content before the more tag.
     713 *     @type string $extended  Content after the more tag.
     714 *     @type string $more_text Custom read more text, or empty string.
     715 * }
    710716 */
    711717function get_extended( $post ) {
     
    791797 *
    792798 * @param int|WP_Post $post Post ID or post object.
    793  * @return array Ancestor IDs or empty array if none are found.
     799 * @return int[] Ancestor IDs or empty array if none are found.
    794800 */
    795801function get_post_ancestors( $post ) {
     
    931937 * @since 2.5.0
    932938 *
    933  * @return array List of post statuses.
     939 * @return string[] Array of post status labels keyed by their status.
    934940 */
    935941function get_post_statuses() {
     
    952958 * @since 2.5.0
    953959 *
    954  * @return array List of page statuses.
     960 * @return string[] Array of page status labels keyed by their status.
    955961 */
    956962function get_page_statuses() {
     
    19171923 *                               means all elements must match; 'not' means no elements may
    19181924 *                               match. Default 'and'.
    1919  * @return array A list of post type names.
     1925 * @return string[] A list of post type names.
    19201926 */
    19211927function get_post_types_by_support( $feature, $operator = 'and' ) {
     
    47074713 *
    47084714 * @param int $post_id Post ID.
    4709  * @return array List of enclosures.
     4715 * @return string[] Array of enclosures for the given post.
    47104716 */
    47114717function get_enclosed( $post_id ) {
     
    48344840 * @global wpdb $wpdb WordPress database abstraction object.
    48354841 *
    4836  * @return array List of page IDs.
     4842 * @return string[] List of page IDs as strings.
    48374843 */
    48384844function get_all_page_ids() {
     
    48564862 * @deprecated 3.5.0 Use get_post()
    48574863 *
    4858  * @param mixed $page   Page object or page ID. Passed by reference.
    4859  * @param string $output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which correspond to
    4860  *                       a WP_Post object, an associative array, or a numeric array, respectively. Default OBJECT.
    4861  * @param string $filter Optional. How the return value should be filtered. Accepts 'raw',
    4862  *                       'edit', 'db', 'display'. Default 'raw'.
    4863  * @return WP_Post|array|null WP_Post (or array) on success, or null on failure.
     4864 * @param int|WP_Post $page   Page object or page ID. Passed by reference.
     4865 * @param string      $output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which correspond to
     4866 *                            a WP_Post object, an associative array, or a numeric array, respectively. Default OBJECT.
     4867 * @param string      $filter Optional. How the return value should be filtered. Accepts 'raw',
     4868 *                            'edit', 'db', 'display'. Default 'raw'.
     4869 * @return WP_Post|array|null WP_Post or array on success, null on failure.
    48644870 */
    48654871function get_page( $page, $output = OBJECT, $filter = 'raw' ) {
     
    62946300 * @global wpdb $wpdb WordPress database abstraction object.
    62956301 *
    6296  * @param array|string  $post_type   Single post type or an array of post types.
    6297  * @param bool           $full        Optional. Returns a full WHERE statement instead of just
    6298  *                                    an 'andalso' term. Default true.
    6299  * @param int            $post_author Optional. Query posts having a single author ID. Default null.
    6300  * @param bool           $public_only Optional. Only return public posts. Skips cap checks for
    6301  *                                    $current_user.  Default false.
     6302 * @param string|string[] $post_type   Single post type or an array of post types.
     6303 * @param bool            $full        Optional. Returns a full WHERE statement instead of just
     6304 *                                     an 'andalso' term. Default true.
     6305 * @param int             $post_author Optional. Query posts having a single author ID. Default null.
     6306 * @param bool            $public_only Optional. Only return public posts. Skips cap checks for
     6307 *                                     $current_user.  Default false.
    63026308 * @return string SQL WHERE code that can be added to a query.
    63036309 */
Note: See TracChangeset for help on using the changeset viewer.