1

I want to include the 'Comments' meta box (the one usually seen on the post creation page) on my plugin's admin page. Is there a way to do that? I am aware of how you can use add_meta_box() to add a custom one, but I want to simply add the comments meta box of a specific post on a particular admin page.

  • I think you can't do that... However, you can play with the html tags and the css classes of wp, like .postbox etc. to obtain what ou want – Pierre Jun 17 '16 at 16:05
0

You can also use add_meta_box to add predefined boxes to different places in the admin, as long as you know the right handles. In the case of the comments meta box you need:

add_meta_box('commentsdiv', __('Comments'), 'post_comment_meta_box', $screen, 'normal');

Here post_comments_meta_box is the callback function that fills the metabox. I am supposing your plugin is setting a current post, because the callback needs it (it doesn't make sense to display a comments meta box if you don't specify which post the comments must be taken from). $screen is the location of your plugin admin page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.