function test_get_incoming_links() { $posts = get_incoming_links(array('movie'), 33); $this->assertTrue($posts[0] == 77); }
/** * Print posts that link to this post via a relation field. * @param string $tpl * @return void -- this actually prints data. */ function print_incoming_links($tpl = null) { if (empty($tpl)) { $tpl = '<span><a href="[+permalink+]">[+post_title+] ([+ID+])</a></span> '; } $Q = new GetPostsQuery(); $args = array(); $args['include'] = get_incoming_links(); // $args['post_status'] = 'draft,publish,inherit'; $results = $Q->get_posts($args); $output = ''; foreach ($results as $r) { $output .= CCTM::parse($tpl, $r); } print $output; }