I need to create a custom widget for my child sites. The MainWp plugin seems to include widgets with the MainWP_UI class inside the page-mainwp-overview.php file.
In another post, I read that we can use the mainwp_before_overview_widgets() hook to include custom code.
Do I use this hook to call my custom widget class ? Do I use the MainWP_UI class inside this hook ? It’s not clear for me.
One more thing I need to ask, are you building a custom extension or you just want to build a custom snippet to insert custom widget on the Overview page?
I need to add aditionnal datas for the child sites (on the overview page). So, I want to create new widgets in the overview page of the child sites.
For the moment I can add new columns in the sites table. It’ not very complicated. But, for create new widgets, with specific datas, I don’t see how to proceed.
So, if I use a custom snippet, maybe I could create these new widgets.
thank for this example.
To test, I use directly your code. But I don’t see any new widget in the site dashboard (after having clear the cache). The first function seems to be correct. But, the callback doesn’t seem to be calling. I don’t see a widget with the ‘My Metabox’ title.
No. No element/widget seems to appear on the main overview page or in site overview page.
If I insert a ‘print_r’ inside the function …( $metaboxes ) I see an element. A ‘print_r’ inside the callback function don’t render anything.
Hi Cyril, mainwp_after_overview_widgets is not appropriate hook for this. It fires before the section where other widgets render. Please check one more time the example that we sent earlier.