Opened 20 months ago
Closed 19 months ago
#61400 closed defect (bug) (fixed)
`wp_get_plugin_action_button()` can return `void`.
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 6.5.5 | Priority: | normal |
| Severity: | normal | Version: | 6.5 |
| Component: | Plugins | Keywords: | has-patch has-unit-tests commit dev-reviewed |
| Focuses: | Cc: |
Description
[57545] introduced wp_get_plugin_action_button(). This function is documented to return a string.
However, the return $button; line is misplaced inside the following conditions:
if ( current_user_can( 'install_plugins' ) || current_user_can( 'update_plugins' ) ) {
As a result, when the user does not have the appropriate capabilities, the return line is not hit, and the function returns void.
Change History (9)
This ticket was mentioned in PR #6757 on WordPress/wordpress-develop by @costdev.
20 months ago
#1
#3
@
20 months ago
Patch: https://core.trac.wordpress.org/ticket/61400
Reviewed and is ready for commit.
#4
@
20 months ago
- Owner set to hellofromTonya
- Status changed from new to reviewing
Setting myself to owner for its review (already done) and commit.
@hellofromTonya commented on PR #6757:
20 months ago
#6
Committed via https://core.trac.wordpress.org/changeset/58396.
#7
@
20 months ago
@jorbin @costdev if there's a 6.5.5, r58396 might be a good candidate to backport.
For ease of testing this, I have just inversed the capability check so that I can test the patch with the admin user.
This is now working to return a string irrespective of the result of the capability check. Marking this for 'commit' as it has both manual and unit tests passed.