From 733ec3da48353bea73d6c4b332a76e8fed18389f Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 1 Apr 2019 12:47:51 +0000 Subject: [PATCH] Docs: Improve documentation for `postbox_classes()`. Rename `$page` and `$id` variables to `$screen_id` and `$box_id` for clarity. Props sharifkiberu, DrewAPicture. Fixes #45179. Built from https://develop.svn.wordpress.org/trunk@45083 git-svn-id: http://core.svn.wordpress.org/trunk@44892 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/post.php | 22 +++++++++++----------- wp-includes/version.php | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index 5fcb76e544..ef732407de 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -1291,34 +1291,34 @@ function wp_edit_attachments_query( $q = false ) { * * @since 2.5.0 * - * @param string $id - * @param string $page - * @return string + * @param string $box_id Meta box ID (used in the 'id' attribute for the meta box). + * @param string $screen_id The screen on which the meta box is shown. + * @return string Space-separated string of class names. */ -function postbox_classes( $id, $page ) { - if ( isset( $_GET['edit'] ) && $_GET['edit'] == $id ) { +function postbox_classes( $box_id, $screen_id ) { + if ( isset( $_GET['edit'] ) && $_GET['edit'] == $box_id ) { $classes = array( '' ); - } elseif ( $closed = get_user_option( 'closedpostboxes_' . $page ) ) { + } elseif ( $closed = get_user_option( 'closedpostboxes_' . $screen_id ) ) { if ( ! is_array( $closed ) ) { $classes = array( '' ); } else { - $classes = in_array( $id, $closed ) ? array( 'closed' ) : array( '' ); + $classes = in_array( $box_id, $closed ) ? array( 'closed' ) : array( '' ); } } else { $classes = array( '' ); } /** - * Filters the postbox classes for a specific screen and screen ID combo. + * Filters the postbox classes for a specific screen and box ID combo. * - * The dynamic portions of the hook name, `$page` and `$id`, refer to - * the screen and screen ID, respectively. + * 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_{$page}_{$id}", $classes ); + $classes = apply_filters( "postbox_classes_{$screen_id}_{$box_id}", $classes ); return implode( ' ', $classes ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index 080f67f185..a50b29815f 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.2-beta1-45082'; +$wp_version = '5.2-beta1-45083'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.