hello. how would I go about adding more than one custom dashboard widget? Would I just copy and rename the php file to dashboard-widgets-order-2.php or is there more to it?
hello. how would I go about adding more than one custom dashboard widget? Would I just copy and rename the php file to dashboard-widgets-order-2.php or is there more to it?
Yes, but you also need to rename all the functions or they will conflict, as well as the widget name in
wp_add_dashboard_widget( 'custom_content_dashboard_widget'
6593 pointsLike some sort of WPMU DEV GodExceptionally helpfulLifetime member
Keeper of the Dark Chocolate
—
30th January 2011 (1 year ago)
#
That's what we've done in the past. (edit: With plugins too.) The new widget code in 3.1 is setup though to assume that all widgets will have multiple copies. Not sure where that stands though.
Responses (6)
Lead Developer — 27th May 2010 (1 year ago) #
Yes, but you also need to rename all the functions or they will conflict, as well as the widget name in
wp_add_dashboard_widget( 'custom_content_dashboard_widget'
Member — 23rd October 2010 (1 year ago) #
Aaron, can you give a more detailed explanation, maybe a step by step one? Sorry, I'm kind of struggling with understanding what you meant.
Member — 23rd October 2010 (1 year ago) #
Nicolas,
I did it by simply adding a "2" after every instance of 'custom_content_dashboard_widget' in the code.
And added a "2" to the name of the plugin and filename as well.
Works great.
Member — 30th January 2011 (1 year ago) #
You should remame this - put "2" after every instance of:
Custom Content Dashboard Widget
custom_content_dashboard_init
custom_content_widget_content
custom_content_dashboard_widget
wp_dashboard_custom_content
custom_content_widget_title
-----------------------------------------------------
for version: 1.5.2
Keeper of the Dark Chocolate — 30th January 2011 (1 year ago) #
That's what we've done in the past. (edit: With plugins too.) The new widget code in 3.1 is setup though to assume that all widgets will have multiple copies. Not sure where that stands though.
edit: We just discussed this a few days ago.
Member — 6th March 2011 (1 year ago) #
Any news about multiple widget and WP 3.1?
It is already implemented? How to setup this?
Become a member