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.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
WordPress® is a registered trademark of the WordPress Foundation, and WooCommerce® is a registered trademark of WooCommerce, Inc. MainWP is an independent product and is not affiliated, associated, or endorsed by the WordPress Foundation, WooCommerce, Inc., or Automattic Inc., except where noted under the Jetpack® API and Trademark License Agreement. All product names, logos, and brands are property of their respective owners and are used for identification purposes only.