This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.
This filter allows customization of postbox classes for a specific screen and screen ID combo. With dynamic parameters $page and $id, it offers flexibility for targeting specific admin pages.
- $classes : (string[]) An array of postbox classes.
Example 1: Adding a Class to Postbox
Here’s how you can add an additional class to the postbox using this filter.
add_filter('weplugins_postbox_classes_post_postexcerpt','weplugins_add_metabox_classes'); function weplugins_add_metabox_classes($classes) { array_push($classes, 'another_class'); return $classes; }
Example 2: Removing a Class from Postbox
Need to remove a class from the postbox? Check out this example.
// remove the filter add_filter('weplugins_postbox_classes_post_postexcerpt', 'weplugins_add_metabox_classes', 10, 1);
Example 3: Customizing Postbox Classes Further
Take customization a step further by manipulating the postbox classes based on conditions.
add_filter('weplugins_postbox_classes_page_custom', 'weplugins_customize_postbox_classes'); function weplugins_customize_postbox_classes($classes) { if (some_condition()) { $classes[] = 'custom_class'; } return $classes; }
If you need any customization or have queries, feel free to Contact Us.
Explore the latest in WordPress
Trying to stay on top of it all? Get the best tools, resources and inspiration sent to your inbox every Wednesday.