wordpress shortcodes not working on child pages

For some reason my wordpress theme isn’t filtering/translating shortcodes … this is the relevant code from the theme

    <?PHP

   $my_wp_query  = new WP_Query();
   $all_wp_pages = $my_wp_query->query(array('post_type' => 'page'));

   $children = get_page_children(get_the_ID(), $all_wp_pages);
   $children = (array)$children;

    function object_to_array($object) {
    if(is_array($object) OR is_object($object)) {
    $result = array();
    foreach($object as $key => $value) {
    $result[$key] = object_to_array($value);
    }
    return $result;
    }
    return $object;
    }
    $children = object_to_array($children);

    function sortByOrder($a, $b) {
    return $a['menu_order'] - $b['menu_order'];
    }

    usort($children, 'sortByOrder');

    ?>

How do I filter the content in the array $children so that shortcodes in wordpress are “translated” ?

Related posts

Leave a Reply