WordPress Plugin add_meta_box to functions.php instead of inside plugin class

I’m using a WordPress plugin that adds a metabox to the post page via

add_meta_box( 'WPInsights', 'Insights', array(&$this,'draw_insights'), 'post', 'normal', 'high' );

I want to add a meta box the same way through my functions.php file, but it says the first argument is supposed to be a valid callback (I assume it is referring to the use of &$this because WPInsights is a class and draw_insights() is a function inside that class.

Read More

How can I write an add_meta_box function for my functions.php file that uses the WPInsights class?

Related posts

Leave a Reply

2 comments

  1. I believe that the add_meta_box function does not function the same say the add_action function. The add_action reference states that it takes a callback but the add_meta_box function states that it takes a string that it uses as a callback. While the argument is named ‘callback’ it does not state that it will take any php callback as the add_action one does.