Changeset 45083
- Timestamp:
- 04/01/2019 12:46:04 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/post.php
r44959 r45083 1292 1292 * @since 2.5.0 1293 1293 * 1294 * @param string $ id1295 * @param string $ page1296 * @return string 1297 */ 1298 function postbox_classes( $ id, $page) {1299 if ( isset( $_GET['edit'] ) && $_GET['edit'] == $ id ) {1294 * @param string $box_id Meta box ID (used in the 'id' attribute for the meta box). 1295 * @param string $screen_id The screen on which the meta box is shown. 1296 * @return string Space-separated string of class names. 1297 */ 1298 function postbox_classes( $box_id, $screen_id ) { 1299 if ( isset( $_GET['edit'] ) && $_GET['edit'] == $box_id ) { 1300 1300 $classes = array( '' ); 1301 } elseif ( $closed = get_user_option( 'closedpostboxes_' . $ page) ) {1301 } elseif ( $closed = get_user_option( 'closedpostboxes_' . $screen_id ) ) { 1302 1302 if ( ! is_array( $closed ) ) { 1303 1303 $classes = array( '' ); 1304 1304 } else { 1305 $classes = in_array( $ id, $closed ) ? array( 'closed' ) : array( '' );1305 $classes = in_array( $box_id, $closed ) ? array( 'closed' ) : array( '' ); 1306 1306 } 1307 1307 } else { … … 1310 1310 1311 1311 /** 1312 * Filters the postbox classes for a specific screen and screenID combo.1313 * 1314 * The dynamic portions of the hook name, `$ page` and `$id`, refer to1315 * the screen and screenID, respectively.1312 * Filters the postbox classes for a specific screen and box ID combo. 1313 * 1314 * The dynamic portions of the hook name, `$screen_id` and `$box_id`, refer to 1315 * the screen ID and meta box ID, respectively. 1316 1316 * 1317 1317 * @since 3.2.0 … … 1319 1319 * @param string[] $classes An array of postbox classes. 1320 1320 */ 1321 $classes = apply_filters( "postbox_classes_{$ page}_{$id}", $classes );1321 $classes = apply_filters( "postbox_classes_{$screen_id}_{$box_id}", $classes ); 1322 1322 return implode( ' ', $classes ); 1323 1323 }
Note: See TracChangeset
for help on using the changeset viewer.