I am trying to get a list of all registered meta boxes in the wordpress admin, specifically the Dashboard widgets.
Now this is easily achieved with the global variable $wp_meta_boxes
and does exactly what I need but only when on the dashboard page.
If I am on a custom admin page or a setting page for example, I get nothing. I am trying to get a list of dashboard widgets and give users the option to put them on a different custom admin page / dashboard.
There are a couple of other similar questions to getting these meta boxes and I am aware of the following code that is been given as an answer, however it has the same problem and it returns an empty array if not on the dashboard page:
Anyone have any ideas? Should the $wp_meta_boxes
be working and there is something going on with my setup? Or is there another way of doing this?
Any help would be massively appreciated!
- Hiện tại chúng tôi có hơn 25 nghìn bài văn mẫu các thể loại.
- Kho tài liệu, đề thi học sinh giỏi các lớp vô cùng phong phú.
- Mỗi ngày cập nhật hơn 100 đề thi chất lượng từ các website bán tài liệu lớn.
Tải đề thi VIP với giá siêu rẻ tại Vip.Dethihsg247.Com