Make WordPress Core


Ignore:
Timestamp:
04/05/2022 11:00:58 AM (2 years ago)
Author:
SergeyBiryukov
Message:

Plugins: Introduce the plugin_install_description filter.

This allows for modification of the plugin card description on the Add Plugins screen.

Use cases include displaying a list of dependencies for the Plugin Dependencies feature project (GitHub).

Props afragen, davidbaumwald, peterwilsoncc, SergeyBiryukov.
Fixes #55480.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-plugin-install-list-table.php

    r52978 r53074  
    515515            // Remove any HTML from the description.
    516516            $description = strip_tags( $plugin['short_description'] );
    517             $version     = wp_kses( $plugin['version'], $plugins_allowedtags );
     517
     518            /**
     519             * Filters the plugin card description on the Add Plugins screen.
     520             *
     521             * @since 6.0.0
     522             *
     523             * @param string $description Plugin card description.
     524             * @param array  $plugin      An array of plugin data. See the {@see 'plugin_row_meta'} filter
     525             *                            for the list of possible values.
     526             */
     527            $description = apply_filters( 'plugin_install_description', $description, $plugin );
     528
     529            $version = wp_kses( $plugin['version'], $plugins_allowedtags );
    518530
    519531            $name = strip_tags( $title . ' ' . $version );
     
    661673             *
    662674             * @param string[] $action_links An array of plugin action links. Defaults are links to Details and Install Now.
    663              * @param array    $plugin       The plugin currently being listed.
     675             * @param array    $plugin       An array of plugin data. See the {@see 'plugin_row_meta'} filter
     676             *                               for the list of possible values.
    664677             */
    665678            $action_links = apply_filters( 'plugin_install_action_links', $action_links, $plugin );
Note: See TracChangeset for help on using the changeset viewer.