[ display-frm-data id=5 user_id=[101 show=id]]
[ formresults id=6 user_id=[101 show=id]
are both on the same dynamic page of a custom page…. i want to use the one on top since its styled the way I want, but the one on bottom is the only one that shows entries only from the correct user… any idea on why this would be? the one on top limits the entries as well, but not to the correct user, or not even just to one user.




February 22, 2012 at 7:44 am
Go to your custom display and add a where row to set the user ID field equal to current user. The shortcode value will override it.
February 22, 2012 at 11:08 am
I already did that, could this be a problem because I have this one added in my functions for another custom display...
add_filter('frm_where_filter', 'filter_custom_display', 10, 2);
function filter_custom_display($where, $args){
if($args['where_opt'] == 101){ //change 25 to the ID of your user ID field
$where = "fi.id='". $args['where_opt'] ."' GROUP BY meta_value";
}
return $where;
}
when i use the first one i still get only the one user.. when i use the second one i get one entry from each user...
[ display-frm-data id=5 user_id=[101 show=id]]
[ formresults id=6 user_id=[101 show=id]
February 22, 2012 at 11:11 am
Yes. Are both displays using the same form? If so, your custom code is overriding it.
February 22, 2012 at 11:13 am
Yeah, is there anyway around this? I need to group the first display by the userid and the second display I want to make a listing of all the user's entries...
February 22, 2012 at 11:23 am
You'll need to make it more specific.
Change
if($args['where_opt'] == 101){
to:
if($args['where_opt'] == 101 and is_page(25)){
25 would e the ID of the WordPress page your custom display with the grouping it on.
February 22, 2012 at 11:38 am
its still not working, the grouping page works fine, the other does not, still only listing one entry from each user as opposed to all entries from one user
February 22, 2012 at 11:44 am
You'll need to troubleshoot that line of code to make sure it only fires on the page you want it to.
http://codex.wordpress.org/Function_Reference/is_page
Or you can use
global $post;
and $post->ID