WordPress.org

Make WordPress Core

Changeset 46662


Ignore:
Timestamp:
11/05/2019 09:28:51 PM (13 months ago)
Author:
johnbillion
Message:

Docs: Docs on docs. Further improve documentation of known return types, plus other docs fixes.

See #48303

Location:
trunk/src
Files:
15 edited

Legend:

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

    r45932 r46662  
    118118
    119119/**
    120  * Retrieves the link categories associated with the link specified.
     120 * Retrieves the link category IDs associated with the link specified.
    121121 *
    122122 * @since 2.1.0
    123123 *
    124  * @param int $link_id Link ID to look up
    125  * @return array The requested link's categories
     124 * @param int $link_id Link ID to look up.
     125 * @return int[] The IDs of the requested link's categories.
    126126 */
    127127function wp_get_link_cats( $link_id = 0 ) {
  • trunk/src/wp-admin/includes/class-wp-list-table.php

    r46610 r46662  
    12181218     * @since 3.1.0
    12191219     *
    1220      * @return array List of CSS classes for the table tag.
     1220     * @return string[] Array of CSS classes for the table tag.
    12211221     */
    12221222    protected function get_table_classes() {
  • trunk/src/wp-admin/includes/class-wp-privacy-requests-table.php

    r46374 r46662  
    3636     * @since 4.9.6
    3737     *
    38      * @return array Array of columns.
     38     * @return string[] Array of column titles keyed by their column name.
    3939     */
    4040    public function get_columns() {
     
    138138     * @since 4.9.6
    139139     *
    140      * @return array Associative array of views in the format of $view_name => $view_markup.
     140     * @return string[] An array of HTML links keyed by their view.
    141141     */
    142142    protected function get_views() {
     
    201201     * @since 4.9.6
    202202     *
    203      * @return array List of bulk actions.
     203     * @return string[] Array of bulk action labels keyed by their action.
    204204     */
    205205    protected function get_bulk_actions() {
  • trunk/src/wp-admin/includes/class-wp-users-list-table.php

    r45932 r46662  
    171171     * @global string $role
    172172     *
    173      * @return array An array of HTML links, one for each view.
     173     * @return string[] An array of HTML links keyed by their view.
    174174     */
    175175    protected function get_views() {
     
    260260     * @since  3.1.0
    261261     *
    262      * @return array Array of bulk actions.
     262     * @return string[] Array of bulk action labels keyed by their action.
    263263     */
    264264    protected function get_bulk_actions() {
     
    349349     * @since  3.1.0
    350350     *
    351      * @return array Array in which the key is the ID of the column,
    352      *               and the value is the description.
     351     * @return string[] Array of column titles keyed by their column name.
    353352     */
    354353    public function get_columns() {
  • trunk/src/wp-admin/includes/misc.php

    r45932 r46662  
    6363 * @param string $filename Filename to extract the strings from.
    6464 * @param string $marker   The marker to extract the strings from.
    65  * @return array An array of strings from a file (.htaccess) from between BEGIN and END markers.
     65 * @return string[] An array of strings from a file (.htaccess) from between BEGIN and END markers.
    6666 */
    6767function extract_from_markers( $filename, $marker ) {
  • trunk/src/wp-admin/includes/nav-menu.php

    r46644 r46662  
    10861086 * @since 3.0.0
    10871087 *
    1088  * @return array Columns.
     1088 * @return string[] Array of column titles keyed by their column name.
    10891089 */
    10901090function wp_nav_menu_manage_columns() {
  • trunk/src/wp-admin/includes/plugin.php

    r46570 r46662  
    227227 *
    228228 * @param string $plugin Path to the plugin file relative to the plugins directory.
    229  * @return array List of files relative to the plugin root.
     229 * @return string[] Array of file names relative to the plugin root.
    230230 */
    231231function get_plugin_files( $plugin ) {
     
    274274 *
    275275 * @param string $plugin_folder Optional. Relative path to single plugin folder.
    276  * @return array Key is the plugin file path and the value is an array of the plugin data.
     276 * @return array[] Array of arrays of plugin data, keyed by plugin file name. See `get_plugin_data()`.
    277277 */
    278278function get_plugins( $plugin_folder = '' ) {
     
    355355 *
    356356 * @since 3.0.0
    357  * @return array Key is the mu-plugin file path and the value is an array of the mu-plugin data.
     357 * @return array[] Array of arrays of mu-plugin data, keyed by plugin file name. See `get_plugin_data()`.
    358358 */
    359359function get_mu_plugins() {
     
    424424 *
    425425 * @since 3.0.0
    426  * @return array Key is the file path and the value is an array of the plugin data.
     426 * @return array[] Array of arrays of dropin plugin data, keyed by plugin file name. See `get_plugin_data()`.
    427427 */
    428428function get_dropins() {
     
    472472 *
    473473 * @since 3.0.0
    474  * @return array Key is file name. The value is an array, with the first value the
     474 * @return array[] Key is file name. The value is an array, with the first value the
    475475 *  purpose of the drop-in and the second value the name of the constant that must be
    476476 *  true for the drop-in to be used, or true if no constant is required.
     
    10301030 *
    10311031 * @since 2.5.0
    1032  * @return array invalid plugins, plugin as key, error as value
     1032 * @return WP_Error[] Array of plugin errors keyed by plugin file name.
    10331033 */
    10341034function validate_active_plugins() {
  • trunk/src/wp-admin/includes/post.php

    r46623 r46662  
    10831083 * @since 2.5.0
    10841084 *
    1085  * @param string $type The post_type you want the statuses for
    1086  * @return array As array of all the statuses for the supplied post type
     1085 * @param string $type The post_type you want the statuses for. Default 'post'.
     1086 * @return string[] An array of all the statuses for the supplied post type.
    10871087 */
    10881088function get_available_post_statuses( $type = 'post' ) {
     
    14931493 *
    14941494 * @param int $thumbnail_id ID of the attachment used for thumbnail
    1495  * @param mixed $post The post ID or object associated with the thumbnail, defaults to global $post.
     1495 * @param int|WP_Post $post Optional. The post ID or object associated with the thumbnail, defaults to global $post.
    14961496 * @return string html
    14971497 */
     
    21512151 *
    21522152 * @param WP_Post $post Post object.
    2153  * @return array Array of block categories.
     2153 * @return array[] Array of block categories.
    21542154 */
    21552155function get_block_categories( $post ) {
  • trunk/src/wp-admin/includes/screen.php

    r46596 r46662  
    141141
    142142/**
    143  * Get Hidden Meta Boxes
     143 * Gets an array of IDs of hidden meta boxes.
    144144 *
    145145 * @since 2.7.0
    146146 *
    147147 * @param string|WP_Screen $screen Screen identifier
    148  * @return array Hidden Meta Boxes
     148 * @return string[] IDs of hidden meta boxes.
    149149 */
    150150function get_hidden_meta_boxes( $screen ) {
     
    173173         * @since 3.1.0
    174174         *
    175          * @param array     $hidden An array of meta boxes hidden by default.
     175         * @param string[]  $hidden An array of IDs of meta boxes hidden by default.
    176176         * @param WP_Screen $screen WP_Screen object of the current screen.
    177177         */
     
    184184     * @since 3.3.0
    185185     *
    186      * @param array     $hidden       An array of hidden meta boxes.
     186     * @param string[]  $hidden       An array of IDs of hidden meta boxes.
    187187     * @param WP_Screen $screen       WP_Screen object of the current screen.
    188188     * @param bool      $use_defaults Whether to show the default meta boxes.
     
    234234 * @since 3.0.0
    235235 *
    236  * @param mixed $hook_name Optional. The hook name (also known as the hook suffix) used to determine the screen,
    237  *                         or an existing screen object.
     236 * @param string|WP_Screen $hook_name Optional. The hook name (also known as the hook suffix) used to determine the screen,
     237 *                                    or an existing screen object.
    238238 */
    239239function set_current_screen( $hook_name = '' ) {
  • trunk/src/wp-admin/includes/taxonomy.php

    r45583 r46662  
    7474 * @param string[] $categories Array of category names to create.
    7575 * @param int      $post_id    Optional. The post ID. Default empty.
    76  * @return array List of categories to create for the given post.
     76 * @return int[] Array of IDs of categories assigned to the given post.
    7777 */
    7878function wp_create_categories( $categories, $post_id = '' ) {
  • trunk/src/wp-admin/includes/template.php

    r46315 r46662  
    200200 *
    201201 * @param string $taxonomy Taxonomy to retrieve terms from.
    202  * @param int $default Not used.
    203  * @param int $number Number of terms to retrieve. Defaults to 10.
    204  * @param bool $echo Optionally output the list as well. Defaults to true.
    205  * @return array List of popular term IDs.
     202 * @param int    $default Not used.
     203 * @param int    $number  Number of terms to retrieve. Defaults to 10.
     204 * @param bool   $echo    Optionally output the list as well. Defaults to true.
     205 * @return int[] Array of popular term IDs.
    206206 */
    207207function wp_popular_terms_checklist( $taxonomy, $default = 0, $number = 10, $echo = true ) {
     
    20982098
    20992099/**
    2100  * Function to retrieve an array of post states from a post.
     2100 * Retrieves an array of post states from a post.
    21012101 *
    21022102 * @since 5.3.0
    21032103 *
    21042104 * @param WP_Post $post The post to retrieve states for.
    2105  * @return array The array of translated post states.
     2105 * @return string[] Array of post state labels keyed by their state.
    21062106 */
    21072107function get_post_states( $post ) {
  • trunk/src/wp-admin/includes/theme.php

    r46232 r46662  
    113113
    114114/**
    115  * Get the Page Templates available in this theme
     115 * Gets the page templates available in this theme.
    116116 *
    117117 * @since 1.5.0
     
    120120 * @param WP_Post|null $post      Optional. The post being edited, provided for context.
    121121 * @param string       $post_type Optional. Post type to get the templates for. Default 'page'.
    122  * @return array Key is the template name, value is the filename of the template
     122 * @return string[] Array of template file names keyed by the template header name.
    123123 */
    124124function get_page_templates( $post = null, $post_type = 'page' ) {
  • trunk/src/wp-admin/includes/translation-install.php

    r46596 r46662  
    116116 * @see translations_api()
    117117 *
    118  * @return array Array of translations, each an array of data. If the API response results
    119  *               in an error, an empty array will be returned.
     118 * @return array[] Array of translations, each an array of data, keyed by the language. If the API response results
     119 *                 in an error, an empty array will be returned.
    120120 */
    121121function wp_get_available_translations() {
  • trunk/src/wp-admin/includes/upgrade.php

    r46290 r46662  
    3636     * @param string $user_password Optional. User's chosen password. Default empty (random password).
    3737     * @param string $language      Optional. Language chosen. Default empty.
    38      * @return array Array keys 'url', 'user_id', 'password', and 'password_message'.
     38     * @return array {
     39     *     Data for the newly installed site.
     40     *
     41     *     @type string $url              The URL of the site.
     42     *     @type int    $user_id          The ID of the site owner.
     43     *     @type string $password         The password of the site owner, if their user account didn't already exist.
     44     *     @type string $password_message The explanatory message regarding the password.
     45     * }
    3946     */
    4047    function wp_install( $blog_title, $user_name, $user_email, $public, $deprecated = '', $user_password = '', $language = '' ) {
  • trunk/src/wp-includes/blocks.php

    r46586 r46662  
    9999 * @since 5.0.0
    100100 *
    101  * @return array Array of dynamic block names.
     101 * @return string[] Array of dynamic block names.
    102102 */
    103103function get_dynamic_block_names() {
     
    282282 *
    283283 * @param string $content Post content.
    284  * @return array Array of parsed block objects.
     284 * @return array[] Array of parsed block objects.
    285285 */
    286286function parse_blocks( $content ) {
Note: See TracChangeset for help on using the changeset viewer.