wp/wp-includes/class-walker-page-dropdown.php
changeset 19 3d72ae0968f4
parent 16 a86126ab1dd4
child 21 48c4eec2b7e6
--- a/wp/wp-includes/class-walker-page-dropdown.php	Wed Sep 21 18:19:35 2022 +0200
+++ b/wp/wp-includes/class-walker-page-dropdown.php	Tue Sep 27 16:37:53 2022 +0200
@@ -30,7 +30,7 @@
 	 * Database fields to use.
 	 *
 	 * @since 2.1.0
-	 * @var array
+	 * @var string[]
 	 *
 	 * @see Walker::$db_fields
 	 * @todo Decouple this
@@ -44,20 +44,25 @@
 	 * Starts the element output.
 	 *
 	 * @since 2.1.0
+	 * @since 5.9.0 Renamed `$page` to `$data_object` and `$id` to `$current_object_id`
+	 *              to match parent class for PHP 8 named parameter support.
 	 *
 	 * @see Walker::start_el()
 	 *
-	 * @param string  $output Used to append additional content. Passed by reference.
-	 * @param WP_Post $page   Page data object.
-	 * @param int     $depth  Optional. Depth of page in reference to parent pages. Used for padding.
-	 *                        Default 0.
-	 * @param array   $args   Optional. Uses 'selected' argument for selected page to set selected HTML
-	 *                        attribute for option element. Uses 'value_field' argument to fill "value"
-	 *                        attribute. See wp_dropdown_pages(). Default empty array.
-	 * @param int     $id     Optional. ID of the current page. Default 0 (unused).
+	 * @param string  $output            Used to append additional content. Passed by reference.
+	 * @param WP_Post $data_object       Page data object.
+	 * @param int     $depth             Optional. Depth of page in reference to parent pages.
+	 *                                   Used for padding. Default 0.
+	 * @param array   $args              Optional. Uses 'selected' argument for selected page to
+	 *                                   set selected HTML attribute for option element. Uses
+	 *                                   'value_field' argument to fill "value" attribute.
+	 *                                   See wp_dropdown_pages(). Default empty array.
+	 * @param int     $current_object_id Optional. ID of the current page. Default 0.
 	 */
-	public function start_el( &$output, $page, $depth = 0, $args = array(), $id = 0 ) {
-		$pad = str_repeat( ' ', $depth * 3 );
+	public function start_el( &$output, $data_object, $depth = 0, $args = array(), $current_object_id = 0 ) {
+		// Restores the more descriptive, specific name for use within this method.
+		$page = $data_object;
+		$pad  = str_repeat( ' ', $depth * 3 );
 
 		if ( ! isset( $args['value_field'] ) || ! isset( $page->{$args['value_field']} ) ) {
 			$args['value_field'] = 'ID';