How to add a class to meta box

When adding a metabox, i.e.:

    'Metabox Title',
    array( 'foo' => $var1, 'bar' => $var2)

how do I add a class to it for css styling? I’d like to avoid having to call each id in the style rule for metaboxes that contain elements having the same style.

2 s

Just add the class to the markup you are generating in the callback.

Leave a Comment