mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@53074 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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 );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user