php – Generates a parent / child page ID table based on the parent page name

I use the following functions (manually updating identifiers) to group the parent and child pages in an array, which I then use in an if / else statement to present the content, depending on the current page is in this table or not. Examples below:

function id_array_function () {
$ array = array (
10, // Parent ID Example
12, // Example of child ID
14 // Example of child ID
)
return $ array;
}
function content_placement_function () {
if (is_page (id_array_example ())) {
// If the current page is in a table, do this
}
other {
// Otherwise, do this
}
}

Ideally, I would like to create a reusable feature to which I can connect to any page name (avoid identifiers due to local installation / production issues having different page identifiers), and return a table containing parent and child page names to use elsewhere, such as:

if (is_page (id_array_function (& # 39;) & nbsp;)))) {
// The function would return a table in the form ('About', 'Our Company', 'Careers', etc.) & # 39; 39;)
// If the current page is in a table, do this
}

I've tried this with wp_list_pages (can not return, only echo) and get_posts / get_terms (both tables returned were empty). If anyone has a pre-existing snippet or idea of ​​how I could achieve reusable function, I would greatly appreciate the help.