Home › Forums › Front End PM PRO › Hook to use before messages load › Reply To: Hook to use before messages load
February 20, 2018 at 9:57 pm
#11340
Alex Brearley
Participant
$not_post = array();
foreach ($findrefs as $ref) {
array_push($not_post, $ref->mes_id);
$args = array(
‘post_parent’ => $ref->mes_id,
‘post_type’ => ‘any’,
‘numberposts’ => – 1,
‘post_status’ => ‘any’
);
$children = get_children($args);
foreach ($children as $child) {
array_push($not_post, $child);
}
}
$args[‘post__not_in’] = $not_post;
$findrefs is an object that contains a list of parent message id