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 [https://make.wordpress.org/core/2022/02/24/feature-project-plugin-dependencies/ Plugin Dependencies feature project] ([https://github.com/WordPress/wp-plugin-dependencies GitHub]).

Props afragen, davidbaumwald, peterwilsoncc, SergeyBiryukov.
Fixes #55480.
Built from https://develop.svn.wordpress.org/trunk@53074


git-svn-id: http://core.svn.wordpress.org/trunk@52663 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2022-04-05 11:02:01 +00:00
parent 88026a4f37
commit 74079f27a9
2 changed files with 16 additions and 3 deletions

View File

@ -514,7 +514,19 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
// Remove any HTML from the description.
$description = strip_tags( $plugin['short_description'] );
$version = wp_kses( $plugin['version'], $plugins_allowedtags );
/**
* Filters the plugin card description on the Add Plugins screen.
*
* @since 6.0.0
*
* @param string $description Plugin card description.
* @param array $plugin An array of plugin data. See the {@see 'plugin_row_meta'} filter
* for the list of possible values.
*/
$description = apply_filters( 'plugin_install_description', $description, $plugin );
$version = wp_kses( $plugin['version'], $plugins_allowedtags );
$name = strip_tags( $title . ' ' . $version );
@ -660,7 +672,8 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
* @since 2.7.0
*
* @param string[] $action_links An array of plugin action links. Defaults are links to Details and Install Now.
* @param array $plugin The plugin currently being listed.
* @param array $plugin An array of plugin data. See the {@see 'plugin_row_meta'} filter
* for the list of possible values.
*/
$action_links = apply_filters( 'plugin_install_action_links', $action_links, $plugin );

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.0-alpha-53072';
$wp_version = '6.0-alpha-53074';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.