42 |
42 |
43 /** |
43 /** |
44 * Starts the element output. |
44 * Starts the element output. |
45 * |
45 * |
46 * @since 2.1.0 |
46 * @since 2.1.0 |
|
47 * @since 5.9.0 Renamed `$page` to `$data_object` and `$id` to `$current_object_id` |
|
48 * to match parent class for PHP 8 named parameter support. |
47 * |
49 * |
48 * @see Walker::start_el() |
50 * @see Walker::start_el() |
49 * |
51 * |
50 * @param string $output Used to append additional content. Passed by reference. |
52 * @param string $output Used to append additional content. Passed by reference. |
51 * @param WP_Post $page Page data object. |
53 * @param WP_Post $data_object Page data object. |
52 * @param int $depth Optional. Depth of page in reference to parent pages. Used for padding. |
54 * @param int $depth Optional. Depth of page in reference to parent pages. |
53 * Default 0. |
55 * Used for padding. Default 0. |
54 * @param array $args Optional. Uses 'selected' argument for selected page to set selected HTML |
56 * @param array $args Optional. Uses 'selected' argument for selected page to |
55 * attribute for option element. Uses 'value_field' argument to fill "value" |
57 * set selected HTML attribute for option element. Uses |
56 * attribute. See wp_dropdown_pages(). Default empty array. |
58 * 'value_field' argument to fill "value" attribute. |
57 * @param int $id Optional. ID of the current page. Default 0 (unused). |
59 * See wp_dropdown_pages(). Default empty array. |
|
60 * @param int $current_object_id Optional. ID of the current page. Default 0. |
58 */ |
61 */ |
59 public function start_el( &$output, $page, $depth = 0, $args = array(), $id = 0 ) { |
62 public function start_el( &$output, $data_object, $depth = 0, $args = array(), $current_object_id = 0 ) { |
60 $pad = str_repeat( ' ', $depth * 3 ); |
63 // Restores the more descriptive, specific name for use within this method. |
|
64 $page = $data_object; |
|
65 $pad = str_repeat( ' ', $depth * 3 ); |
61 |
66 |
62 if ( ! isset( $args['value_field'] ) || ! isset( $page->{$args['value_field']} ) ) { |
67 if ( ! isset( $args['value_field'] ) || ! isset( $page->{$args['value_field']} ) ) { |
63 $args['value_field'] = 'ID'; |
68 $args['value_field'] = 'ID'; |
64 } |
69 } |
65 |
70 |