I'm trying to get my head around a fairly simple concept in PHP but I'm pretty green.
I have a function..
function pa_insertPage($atts, $content = null) {
// Default output if no pageid given
$output = NULL;
// extract atts and assign to array
extract(shortcode_atts(array("page" => '2404' // Value for Course Descriptions page
), $atts));
// if a page id is specified, then run query
if (!empty($page)) {
$pageContent = new WP_query();
$pageContent->query(array('page_id' => $page));
while ($pageContent->have_posts()) : $pageContent->the_post();
// assign the content to $output
$output = apply_filters( 'the_content', get_the_content() );
endwhile;
}
return $output;
}
And I'd like to use the returned $output
from this function in another function called naada_assess()
In my naada_assess
function I've called $recClasses = pa_insertPage($output);
but that doesn't seem to do the trick.