Make WordPress Core


Ignore:
Timestamp:
11/20/2021 02:21:15 AM (3 years ago)
Author:
SergeyBiryukov
Message:

Docs: Update documentation for the $plugin_data parameter of various hooks:

  • Document the structure of the $plugin_data array passed to the plugin_row_meta filter.
  • Document some missing values returned by get_plugin_data():
    • PluginURI
    • AuthorName
  • Link to get_plugin_data() and the plugin_row_meta filter as the canonical sources in other various filters and actions which receive the $plugin_data parameter:
    • network_admin_plugin_action_links
    • network_admin_plugin_action_links_{$plugin_file}
    • plugin_action_links
    • plugin_action_links_{$plugin_file}
    • plugin_auto_update_setting_html
    • manage_plugins_custom_column
    • after_plugin_row
    • after_plugin_row_{$plugin_file}
    • in_plugin_update_message-{$file}
  • Update documentation for the $response parameter of the in_plugin_update_message-{$file} filter:
    • Correct type for the id value. It contains a string like w.org/plugins/[plugin-name], not a numeric ID.
    • Update $icons, $banners, and $banners_rtl values to use typed array notation.

Follow-up to [8367], [8402], [12976], [16758], [26540], [30544], [34818], [51733], [52212], [52224].

See #53399.

File:
1 edited

Legend:

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

    r52224 r52227  
    559559         * @since 2.8.0
    560560         *
    561          * @param array  $plugin_data {
    562          *     An array of plugin metadata.
    563          *
    564          *     @type string $name        The human-readable name of the plugin.
    565          *     @type string $plugin_uri  Plugin URI.
    566          *     @type string $version     Plugin version.
    567          *     @type string $description Plugin description.
    568          *     @type string $author      Plugin author.
    569          *     @type string $author_uri  Plugin author URI.
    570          *     @type string $text_domain Plugin text domain.
    571          *     @type string $domain_path Relative path to the plugin's .mo file(s).
    572          *     @type bool   $network     Whether the plugin can only be activated network wide.
    573          *     @type string $title       The human-readable title of the plugin.
    574          *     @type string $author_name Plugin author's name.
    575          *     @type bool   $update      Whether there's an available update. Default null.
    576          * }
     561         * @param array  $plugin_data An array of plugin metadata. See get_plugin_data()
     562         *                            and the {@see 'plugin_row_meta'} filter for the list
     563         *                            of possible values.
    577564         * @param object $response {
    578565         *     An object of metadata about the available plugin update.
    579566         *
    580          *     @type int    $id           Plugin ID.
    581          *     @type string $slug         Plugin slug.
    582          *     @type string $plugin       Plugin basename.
    583          *     @type string $new_version  New plugin version.
    584          *     @type string $url          Plugin URL.
    585          *     @type string $package      Plugin update package URL.
    586          *     @type array $icons        An array of plugin icon URLs.
    587          *     @type array $banners      An array of plugin banner URLs.
    588          *     @type array $banners_rtl  An array of plugin RTL banner URLs.
    589          *     @type string $requires     The version of WordPress which the plugin requires.
    590          *     @type string $tested       The version of WordPress the plugin is tested against.
    591          *     @type string $requires_php The version of PHP which the plugin requires.
     567         *     @type string   $id           Plugin ID, e.g. `w.org/plugins/[plugin-name]`.
     568         *     @type string   $slug         Plugin slug.
     569         *     @type string   $plugin       Plugin basename.
     570         *     @type string   $new_version  New plugin version.
     571         *     @type string   $url          Plugin URL.
     572         *     @type string   $package      Plugin update package URL.
     573         *     @type string[] $icons        An array of plugin icon URLs.
     574         *     @type string[] $banners      An array of plugin banner URLs.
     575         *     @type string[] $banners_rtl  An array of plugin RTL banner URLs.
     576         *     @type string   $requires     The version of WordPress which the plugin requires.
     577         *     @type string   $tested       The version of WordPress the plugin is tested against.
     578         *     @type string   $requires_php The version of PHP which the plugin requires.
    592579         * }
    593580         */
Note: See TracChangeset for help on using the changeset viewer.