Plugin Author
anmari
(@anmari)
Hi Marteno,
You know you can use exclude and include features in the list settings?
http://wpusersplugin.com/3703/exclude-or-selectively-include-users-without-displaying-the-criteria-field/
eg: you could have a list with region field ‘include’ value set to Europe
Re: field_51cd002fad748
the plugin unless it has some code to tell it how to format a field, will display the value it finds in the user meta. In this case it must be finding field_51cd002fad748.
Most likely you could write a formatting function to lookup the descriptive name based on what is in the usermeta and display that.
The plugin looks for existence of formattingfunction based on field name (be careful with hyphens etc… converted to underscores so code will work.
See http://wpusersplugin.com/2645/format-any-field-any-way-you-wish/
and http://wpusersplugin.com/2823/formatting-and-pluggable-functions/
Hi Anmari,
Yes, I can create lists that includes or excludes certain regions. The reason I go the other way is that I want the system to be flexible, ie. when people visit the Europe taxonomy page I want to automatically generate a Europe user list based on the taxonomy they visit. So ideally I put the taxonomy term, ie. Europe in the shortcode (or probably even better would be directly in php if possible). Then when I add a region, I don’t have to add another list. That way my users menu won’t be filled with 30 or so user lists and I can add a field to all user lists by changing one instead of 30.
I know one can write a function (i did a few simple ones to format certain fields). But I’m probably not the person to do an advanced function. If you take work I’d be happy to see if we can come to some kind of financial understanding (see my website for contact info). A full Advanced Custom Fields integration would be nice for the plugin 🙂
Maybe the last remark holds a clue, ‘be careful with hyphens’, maybe the dash in wp_s2member_custom_fields-region trips the shortcode?
Thanks,
Maarten
http://maartenottens.com
Seems there is a similar problems with rows_perpage, which works as rows_per_page in the url, but not in the shortcode.
I managed to fix the rows_per_page issue by adding
if (isset($options['rows_per_page'])) { // number of rows per page
$rowsperpage = $options['rows_per_page'];
} else
above line 352 in ameta-list.php
The initial s2member filter problem had indeed to do with the dash in the name. I made another change in ameta-list.php to activate fieldnamefilter and fieldvaluefilter, to circumvent the problem. I added
if (isset ($options['fieldnamefilter']) AND isset ($options['fieldvaluefilter'])) {
$filtercol[$options['fieldnamefilter']] = $options['fieldvaluefilter'];
}
after
foreach ($icols as $cindex => $col) { ... }
The shortcode does need a filter option for it to pick up on the field parameters. It works like a charm. Any chance this can be part of the next release?
Thanks, M