WordPress.org

Make WordPress Core

#21331 closed enhancement (duplicate)

Allow dashboard and welcome panel to be filtered and modified

Reported by: martythornley Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: UI Keywords: has-patch
Focuses: Cc:

Description

Part of the UI discussion for 3.5 has involved how to create a setup/wizard mode for new site. One way to encourage some new ideas in this direction would be to allow plugins to be developed that could experiment with this area.

in wp-admin/index.php, the calls to wp_welcome_panel(); and wp_dashboard(); could be filtered so that they could be replaced by custom functions.

Attachments (1)

21331.diff (592 bytes) - added by martythornley 21 months ago.

Download all attachments as: .zip

Change History (14)

martythornley21 months ago

comment:1 martythornley21 months ago

  • Keywords has-patch added
  • Type changed from defect (bug) to enhancement

comment:3 follow-up: nacin21 months ago

I'm okay with this, but this is essentially duplicating the role of actions. So:

do_action( 'welcome_panel' );

And in default-filters:

add_action( 'welcome_panel', 'wp_welcome_panel' );

Not sure I see a reason to "plug" wp_dashboard(), though.

comment:4 martythornley21 months ago

I think being able to plug and replace the dashboard is a crucial part of the discussions around the new setup/wizard steps and would allow plugins to rethink things a little and push what that dashboard might be. The talks here are great: http://make.wordpress.org/ui/2012/07/24/welcome-screen-design-v2/ - but why not allow it?

comment:5 follow-up: martythornley21 months ago

Oh... and I see why do_action makes sense but I see the the idea as more of a way to replace the whole thing, not just tie in at an action. More like the way comments or something work. If it is just adding an action, you would have to first find all hooked actions and remove them. Not impossible but an extra step.

As an example: My reason for wanting to do this is to control the welcome panel and dashboard on a multisite install. I can see the reluctance to let any number of plugins take over a dashboard. But what if it happened in a way that only network admins could let it happen?

Last edited 21 months ago by martythornley (previous) (diff)

comment:6 in reply to: ↑ 5 ; follow-up: nacin21 months ago

Replying to martythornley:

Oh... and I see why do_action makes sense but I see the the idea as more of a way to replace the whole thing, not just tie in at an action. More like the way comments or something work. If it is just adding an action, you would have to first find all hooked actions and remove them. Not impossible but an extra step.

If you look through default-filters.php, this is a fairly standard design pattern in core.

comment:7 in reply to: ↑ 6 ; follow-up: mikeschinkel21 months ago

  • Cc mikeschinkel@… added

Replying to nacin:

If you look through default-filters.php, this is a fairly standard design pattern in core.

I'm confused? How does default-filters.php relate?

comment:8 martythornley21 months ago

Replying to nacin:

If you look through default-filters.php, this is a fairly standard design pattern in core.

That all assumes no one else has tied into it either. If several plugins/themes have added their own functions you need to find what those hooked actions are then remove them all. Whereas if the name of the function for the whole thing can be filtered, you can change it in one line and just adjust priority.

I think they are two different ideas, just depending on how much control you want to give developers and how easy you want to make it on them. One lets you swap the function as a whole, the other just lets plugins tack their two cents on at a specific spot.

Maybe the do_action( 'welcome_panel' ); could exist in the 'wp_welcome_panel' function and plugins could just add a little there. That way you could either just add a little widget or section to the existing panel.

Then if a plugins has swapped out the function as a whole, they could include all the hooked actions in their new function by adding the do_action( 'welcome_panel' ) in the right spot to allow others to add on. Same as if you want your theme to work correctly you need to include the wp_head();

comment:9 in reply to: ↑ 7 martythornley21 months ago

Replying to mikeschinkel:

I'm confused? How does default-filters.php relate?

I was confused at first too but I think it was just to point out it would be easy to find what function was hooked in by default. But like I mentioned above, the problem is when a bunch of random stuff has been hooked in and you need to remove it all.

comment:10 bootsz21 months ago

  • Cc sbutze@… added

comment:11 in reply to: ↑ 3 bootsz21 months ago

Forgive me if I missed anything, but I'm not sure I'm following what the debate is. Is it a matter of HOW we make these areas changeable, or whether or not we should be able to at all? Regardless of how it's achieved, I think developers definitely need an easier means of customizing these areas.

Replying to nacin:

I'm okay with this, but this is essentially duplicating the role of actions. So:

do_action( 'welcome_panel' );

And in default-filters:

add_action( 'welcome_panel', 'wp_welcome_panel' );

Not sure I see a reason to "plug" wp_dashboard(), though.

comment:13 helenyhou19 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #19972.

Note: See TracTickets for help on using tickets.