16,
‘post_type’ => ‘nf_sub’,
);
$query = new WP_Query( $args );
$subs = Ninja_Forms()->subs()->get( $args );
if ( $query->have_posts() ) {
$data[‘list’][‘options’]=array();
foreach ( $subs as $sub ) {
//$form_id = $sub->form_id;
//$user_id = $sub->user_id;
// Returns an array of [field_id] => [user_value] pairs
$all_fields = $sub->get_all_fields();
// Echoes out the submitted value for a field
echo $sub->get_field( 46 );
$data[‘list’][‘options’][] = array(
‘label’ => $sub->get_field( 46 ),
‘value’ => null,
‘calc’ => null,
‘selected’ => 0
);
}
while ( $query->have_posts() ) {
$query->the_post();
}
}
wp_reset_postdata();
}
return $data;
}
add_filter(‘ninja_forms_field’,’jason_prepopulate_forms’);
?>
No Fields Found.