postbox_classes( string $box_id, string $screen_id )
Returns the list of classes to be used by a meta box.
Parameters
- $box_id
-
(Required) Meta box ID (used in the 'id' attribute for the meta box).
- $screen_id
-
(Required) The screen on which the meta box is shown.
Return
(string) Space-separated string of class names.
Source
File: wp-admin/includes/post.php
function postbox_classes( $id, $page ) {
if ( isset( $_GET['edit'] ) && $_GET['edit'] == $id ) {
$classes = array( '' );
} elseif ( $closed = get_user_option('closedpostboxes_'.$page ) ) {
if ( !is_array( $closed ) ) {
$classes = array( '' );
} else {
$classes = in_array( $id, $closed ) ? array( 'closed' ) : array( '' );
}
} else {
$classes = array( '' );
}
/**
* Filters the postbox classes for a specific screen and screen ID combo.
*
* The dynamic portions of the hook name, `$page` and `$id`, refer to
* the screen and screen ID, respectively.
*
* @since WP-3.2.0
*
* @param array $classes An array of postbox classes.
*/
$classes = apply_filters( "postbox_classes_{$page}_{$id}", $classes );
return implode( ' ', $classes );
}
Changelog
Version | Description |
---|---|
2.5.0 | Introduced. |