Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 22 months ago

#55480 closed enhancement (fixed)

Add filter to modify description in plugin card

Reported by: afragen's profile afragen Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 6.0 Priority: normal
Severity: normal Version:
Component: Upgrade/Install Keywords: has-patch has-dev-note
Focuses: administration Cc:

Description

I've found it desirable to be able to modify the description of the plugin card in the plugin install list table.

If possible I would like to add a filter for this variable.

Attachments (1)

55480.ref.diff (819 bytes) - added by costdev 2 years ago.
Change @see reference to plugins_api().

Download all attachments as: .zip

Change History (19)

This ticket was mentioned in PR #2476 on WordPress/wordpress-develop by afragen.


2 years ago
#1

Add a filter to the plugin install list table to allow for modification of the plugin description in the plugin card.

Trac ticket: https://core.trac.wordpress.org/ticket/55480

#2 @SergeyBiryukov
2 years ago

  • Milestone changed from Awaiting Review to 6.0
  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

afragen commented on PR #2476:


2 years ago
#3

🤦🏻‍♂️ thanks for the assist 🙏🏼

#4 @SergeyBiryukov
2 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 53074:

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.

#6 @milana_cap
2 years ago

  • Keywords needs-dev-note added

Marking for Dev note but really just needs mentioning in Field guide.

#7 @milana_cap
2 years ago

  • Keywords add-to-field-guide added; needs-dev-note removed

This ticket was mentioned in Slack in #core-auto-updates by pbiron. View the logs.


2 years ago

#9 follow-up: @afragen
2 years ago

@SergeyBiryukov I believe the reference for the @param $plugin is a reference to the output of a call to plugins_api() and not to the plugin_row_meta filter.

Thanks @pbiron

#10 in reply to: ↑ 9 ; follow-up: @pbiron
2 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Replying to afragen:

@SergeyBiryukov I believe the reference for the @param $plugin is a reference to the output of a call to plugins_api() and not to the plugin_row_meta filter.

Thanks @pbiron

To expand on the above: this is in reference to the description of that param in the DocBlock. The param that is passed to plugin_row_meta contains a number of properties about the plugin that are only set in WP_Plugin_List_Table::single_row() and would never be set in the param that is passed to plugin_install_description.

The same discrepancy also applies to DocBlock of the plugin_install_action_links which was modified in the commit for this new filter.

#11 in reply to: ↑ 10 ; follow-up: @SergeyBiryukov
2 years ago

Replying to pbiron:

Replying to afragen:

I believe the reference for the @param $plugin is a reference to the output of a call to plugins_api() and not to the plugin_row_meta filter.

Thanks @pbiron

To expand on the above: this is in reference to the description of that param in the DocBlock. The param that is passed to plugin_row_meta contains a number of properties about the plugin that are only set in WP_Plugin_List_Table::single_row() and would never be set in the param that is passed to plugin_install_description.

Thanks! I think I went with a reference to plugin_row_meta because the plugins_api() DocBlock does not actually describe the structure of the returned array (as it depends on the arguments passed), and plugin_row_meta was the closest thing I could find. It looks like we could better document the plugins_api() response and link to that instead.

#12 @afragen
2 years ago

Closest would likely be the plugins_api_result filter and that's also sorta documented in plugins_api().

#13 in reply to: ↑ 11 @pbiron
2 years ago

Replying to SergeyBiryukov:

Thanks! I think I went with a reference to plugin_row_meta because the plugins_api() DocBlock does not actually describe the structure of the returned array (as it depends on the arguments passed), and plugin_row_meta was the closest thing I could find. It looks like we could better document the plugins_api() response and link to that instead.

Yeah, plugins_api() isn't documented very well, especially since the description of the return value says to see the Code Reference for the plugins_api() function :-)

#14 @costdev
2 years ago

Patch updated to change the @see reference to plugins_api.

I have also opened a follow-up ticket to handle the improvements in documentation for plugins_api(): #55645.

@costdev
2 years ago

Change @see reference to plugins_api().

#15 @peterwilsoncc
2 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 53328:

Plugins: Improve plugin_install_description filter's docs.

Refer developers to plugins_api() for array of plugin data.

Props afragen, pbiron, SergeyBiryukov, costdev.
Fixes #55480.

#16 @SergeyBiryukov
2 years ago

In 53330:

Docs: Improve plugin_install_action_links filter's docs.

Refer developers to plugins_api() for array of plugin data.

Follow-up to [53074], [53328].

Props afragen, pbiron.
See #55480.

#17 @sabernhardt
2 years ago

  • Keywords has-dev-note added; add-to-field-guide removed

#18 @afragen
22 months ago

#55479 was marked as a duplicate.

Note: See TracTickets for help on using tickets.