WPDev.one
Core Function
View Source on Trac ↗

get_children()

get_children( mixed $args = '', mixed $output = OBJECT )

Retrieves all children of the post parent ID.

Parameters 1 required

Name / Type Description
$args
mixed

Optional. User defined arguments for replacing the defaults. Default empty.

string

$output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which correspond to a WP_Post object, an associative array, or a numeric array, respectively. Default OBJECT.

Required

Return Value

((WP_Post[])
| array[] | int[]) Array of post objects, arrays, or IDs, depending on `$output`.

Function Information

Since Version
2.0.0
Source File
wp-includes/post.php
Advertisement