Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#21331 closed enhancement (duplicate)

Allow dashboard and welcome panel to be filtered and modified

Reported by: martythornley's profile 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 12 years ago.

Download all attachments as: .zip

Change History (14)

@martythornley
12 years ago

#1 @martythornley
12 years ago

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

#3 follow-up: @nacin
12 years 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.

#4 @martythornley
12 years 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?

#5 follow-up: @martythornley
12 years 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.

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?

Version 0, edited 12 years ago by martythornley (next)

#6 in reply to: ↑ 5 ; follow-up: @nacin
12 years 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.

#7 in reply to: ↑ 6 ; follow-up: @mikeschinkel
12 years 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?

#8 @martythornley
12 years 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();

#9 in reply to: ↑ 7 @martythornley
12 years 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.

#10 @bootsz
12 years ago

  • Cc sbutze@… added

#11 in reply to: ↑ 3 @bootsz
12 years 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.

#13 @helenyhou
12 years 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.