wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
postbox_classes › WordPress Function
Seit2.5.0
Veraltetn/v
› postbox_classes ( $box_id, $screen_id )
Parameter: (2) |
|
Gibt zurück: |
|
Definiert in: |
|
Codex: |
Returns the list of classes to be used by a meta box.
Quellcode
function postbox_classes( $box_id, $screen_id ) { if ( isset( $_GET['edit'] ) && $_GET['edit'] === $box_id ) { $classes = array( '' ); } elseif ( get_user_option( 'closedpostboxes_' . $screen_id ) ) { $closed = get_user_option( 'closedpostboxes_' . $screen_id ); if ( ! is_array( $closed ) ) { $classes = array( '' ); } else { $classes = in_array( $box_id, $closed, true ) ? array( 'closed' ) : array( '' ); } } else { $classes = array( '' ); } /** * Filters the postbox classes for a specific screen and box ID combo. * * The dynamic portions of the hook name, `$screen_id` and `$box_id`, refer to * the screen ID and meta box ID, respectively. * * @since 3.2.0 * * @param string[] $classes An array of postbox classes. */ $classes = apply_filters( "postbox_classes_{$screen_id}_{$box_id}", $classes ); return implode( ' ', $classes ); }