#42791 closed enhancement (fixed)
wp_add_dashboard_widget() should accept location and priority parameters
Reported by: | johnbillion | Owned by: | johnbillion |
---|---|---|---|
Milestone: | 5.6 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Administration | Keywords: | has-patch has-unit-tests commit |
Focuses: | Cc: |
Description
The wp_add_dashboard_widget()
function should accept $location
and $priority
parameters to bring the function inline with add_meta_box()
, which it ultimately calls.
Attachments (6)
Change History (17)
#3
@
7 years ago
- Keywords needs-unit-tests added
- Owner set to davidjlaietta
- Status changed from new to assigned
Hi @davidjlaietta, thanks for the patch! I've assigned the ticket to you to mark this good-first-bug
as "claimed". Sorry for the delay in response.
I did a first pass on the patch, and the big standouts that are still missing are changelog entries for the new parameters in the DocBlock, and we could probably also benefit from unit tests here as well.
For info on changelog entries, check out this article in the core handbook.
@
7 years ago
Why not set $priority = 'core'
and $location = 'normal'
to begin with? Why the whole 'default' dance? See 3rd diff version based on 2nd. Also removed tabs from docblock.
#6
@
4 years ago
- Keywords good-first-bug removed
- Milestone changed from Awaiting Review to 5.6
- Owner changed from davidjlaietta to johnbillion
- Status changed from assigned to reviewing
#7
@
4 years ago
- Keywords commit added
42791.5.diff is a refreshed patch with improved docs. I think this is ready to go.
Attached diff includes $location and $priority arguments, and maintains similar logic for wp_add_dashboard_widget.
If location is not set, it'll be set to normal unless it's a side widget. If priority is not set it will be set to core unless dashboard_browser_nag is set, then it'll be set to high.
New usage: