diff --git a/src/wp-includes/post-template.php b/src/wp-includes/post-template.php index 86ea3eca58271..c6c8cbe7e9703 100644 --- a/src/wp-includes/post-template.php +++ b/src/wp-includes/post-template.php @@ -1288,7 +1288,7 @@ function wp_dropdown_pages( $args = '' ) { * the given n depth). Default 0. * @type bool $echo Whether or not to echo the list of pages. Default true. * @type string $exclude Comma-separated list of page IDs to exclude. Default empty. - * @type array $include Comma-separated list of page IDs to include. Default empty. + * @type int[]|string $include Array or comma-separated list of page IDs to include. Default empty array. * @type string $link_after Text or HTML to follow the page link label. Default null. * @type string $link_before Text or HTML to precede the page link label. Default null. * @type string $post_type Post type to query for. Default 'page'. diff --git a/tests/phpunit/tests/post/wpListPages.php b/tests/phpunit/tests/post/wpListPages.php index f059591219b1a..123356de7b7e8 100644 --- a/tests/phpunit/tests/post/wpListPages.php +++ b/tests/phpunit/tests/post/wpListPages.php @@ -437,6 +437,22 @@ public function test_wp_list_pages_include() { $this->assertSameIgnoreEOL( $expected, wp_list_pages( $args ) ); } + /** + * @ticket 66052 + */ + public function test_wp_list_pages_include_accepts_array_of_ids() { + $args = array( + 'echo' => false, + 'include' => array( self::$parent_1, self::$parent_3 ), + ); + + $expected = '