Search will search all fields in the current list for the search text and return users who are in the current list and have that text in a field in the list.


Search will search all fields in the current list for the search text and return users who are in the current list and have that text in a field in the list.
The amr-user plugin offers wordpress capability control of access to users lists. In wordpress roles have capabilities, and the capabilities determine what the users can do. User lists can also be tagged as ‘public’ so that a viewer with no role can see the list if used on the front end.
If you want to isolate the ‘manage_userlists’ capability to a non-administrator and you don’t already have a plugin to do that for you, something like Justin Tadlock’s Members plugin is useful.
There are two fields that show details of date of registration. When the plugin started I wanted to see a human based ‘days ago’ view as I found that much more helpful to assess how long a user had been a member.
Thus that is the real wordpress registration date fields default formatting. If one hovers over the field full details of the actual date will show.
It is also possible for you to write your own formatting function to format the date any way you would like. For those people who are unable to write their own functions from the example and just want to display the registration date, there is a ‘pseudo’ field created which is called ‘Registration Date’ – it is not a real field though and does not sort well.
In the future there may be the possibility for one to choose from a range of formats. For example I can imagine a number of possibilities:
Do you want to add css for html generated by a plugin perhaps?
Do you have a custom theme that you are NEVER going to automatically update?
Then edit the themes css, add your custom css to the bottom of the main style.css. This should be in your themes folder under wp-content.
Does your theme have upates occasionally ? If you want to be able to auto update your theme, then it is better to add your css separately.
Some plugin have ways to add a custom css file for that plugin and/or to disable any plugin css so that you may reduce the number of stylesheets. Do NOT edit any plugin css files unless it is a site specific plugin that will not be updated automatically – you will lose your css when the update is applied.
The easiest way to add custom css if you cannot use your themes style.css is probably by using the official wordpress jetpack plugin: http://wordpress.org/support/plugin/jetpack
It has a custom css module http://jetpack.me/support/custom-css/ There are other plugins that allow you to do this.
First you need to work out what css selectors have been provided in the html that is generated. My plugins generally offer many css selectors in the html. The various ‘inspect element’ tools are invaluable here.
They help highlight what css is being applied to the html and what is being overwritten. And of course they help you to see easily what css ‘hooks’ there are to add special styling.
Your custom css needs to work with your theme, so you either need to specify the css tightly enough that no theme css will ever override it, or know that you are not going to be changing themes.
To work out what css to add, ideally you should have a reasonable understanding of css. In particular the concepts of specificity and inheritance
http://coding.smashingmagazine.com/2007/07/27/css-specificity-things-you-should-know/ .
When asking for help you should
You should also know that browsers vary in their implementation and while your hack that you worked out or have been given might look beautiful on your apple mac running safari, results can vary greatly.
If you have any pride in your work at all, you should test the result using something like http://browsershots.org/, or risk the site looking really stupid.
In this example from the amr-users plugin, one can see that:
Experiencing wordpress theme or plugin problems with shortcodes generated html such as:
Does your website weirdly add ‘<br />’ html when page or post content is displayed with shortcode content? Does it disappear when you have standard wordpress theme with no plugins?
Using amr-users and the pagination is vertical instead of horizontal ? Yup, you guessed it. This is caused by those break tags being added AFTER the shortcode has run.
My plugin uses the wordpress function paginate_links with formatting option ‘plain’ . This generates a list of links joined with ‘newlines’ :
$r = join("\n", $page_links);
This works very nicely in default wordpress themes, producing nice paginated user lists with horizontal pagination and nicely structured html.
BUT then…..
When your pagination is vertical, or your newlines become breaks, then most likely the theme or another plugin is adding the wordpress wpautop function to the_content filter, possibly with a non default priority .
To avoid wpautop affecting shortcodes, various people have suggested removing it and then adding it with a later priority to get around other problems… BUT adding it back can just cause more problems. To be clear it is possible to add wpautop with an argument that specifies NOT to change newlines.
My plugin tries to avoid this problem for you by executing a
remove_filter ('the_content', 'wpautop');
The remove filter will only work if the filter was added with the default priority and arguments. It the filter was added with any other priority, the remove will not work. Filters must be removed with the same priority and arguments that was used to add them. It simply isn’t possible for my plugin to know what your theme or other plugin is doing. (eg: WP Unformatted plugin apparently used to apply the filter )
Get rid of wpautop. Some folks really don’t like it and arguably your theme should not be applying it the way it does. WordPress default themes don’t cause this problem.
Or change the add filter priority to something less than 11 so it executes BEFORE the shortcode filter .
My plugins default front side css in versions after version 3.6.3 will include this css. It is not ideal, it would be better if the html code was not changed. This is to cut down the support effort generated by people who do not realise what is going on. (It’s a tricky one).
If you are not using the front end css, or its not yet available (plugin still at v 3.6.3) then add something like this to your css (in theme or custom css):
.tablenav-pages br { /* fix those annoying themes or other plugins that insist on adding wpautop filter to post shortcode content */ display: none }
Super easy! It is explained very briefly in the ‘configure’ section and in the How to exclude users from a list. This is more detail.
List will now use criteria but not display the fields.
From version 3.4.4, Parameters are available to overide list settings. If you are not a farly expert wordpress user, please use the settings rather to avoid confusing yourself. The parameters are for more expert users or more complex requirements. For example they allow one to reuse a single list on multiple pages but with different sort or filtering criteria.
URL Parameter use opens up some possibilities that have been requested. EG: currently search only allows one to search the fields that are in the list. One can now add fields to the list, then ‘hide’ that field by adding a filter ‘*’ (display all with values) to it. Then the search will include that field, but not display it. (Personally I do not recommend this as i think it’s confusing.)
filter=hide columnname=*
Several add-ons have been developed to extract data created by third party plugins and not stored in the wordpress user and user meta tables.
Request an add-on (charges apply) or If you some php skills, use the example plugin to write your own addon.
If you have a custom table that has user data in it, you can pull it into a list by writing a little site specific plugin and making use of some of the hooks available in the amr-users plugin.
The hooks you may need are:
Read the filter documentation and see the add-on plugins to see how to use these hooks. Many of the add-ons use them to add data from a variety of different styles of tables.
See https://wpusersplugin.com/2940/filters/#examples
See one of the add-on plugins or thee xample site specific plugin. Do NOT cut and paste the code here. It is meant to inform only and will NOT work as is.
add_filter('amr_get_fields', 'amr_add_my_fields', 1);
add_filter('amr_get_users_with_meta', 'amr_get_my_users_data', 1);
function amr_add_my_fields ($keys) { // write code here to return the list of additional fields // you'd like to see in your user lists. //IE these are fields in your custom table that are //NOT in wordpress user or usermeta table. // the function will be passed the existing list of fields //and should add the additional fields to the array. eg: $keys[] = 'newfield'; return ($keys); // then return the array $keys }
function amr_get_my_users_data ($users) {
// write code here to get the user data from the custom tables. Various approaches are open to you. Either
for each $extradata { $users[$userid]['newfield'] = $extradata['newfield']; // then return the array $users return ($users); /pre>Alternative (or to format nicely)
The function above has to process ALL the users. The data will then be available in csv export. If you only need the data to be displayed, then you could use a formatting function rather. The amr-users plugin will look for a custom formatting function for each column to be displayed for each user.function ausers_format_newfield($value, $user) { $customdata_maybearray = code to get data ($user->ID); $html = implode (', ',$customdata_maybearray) }
Cacheing is required because:
So the plugin grabs, extracts, does some magic and stores the data in a separate generic cache table. Originally this was aimed primary at csv extraction.
Ideally the lists should be up to date when you see them. BUT for reasons above this may not always be possible. So consider the following scenarios:
(version 3.4.9 at time of writing)
The cache can be set to automatically update in the ‘background’. This is achieved using standard wordpress cron features. If you are new to cron, then basically all you need to know is that it needs some activity on your website to run. eg: a page request. A scheduled job will only run on the first page request after the jobs scheduled time. If you have a very low traffic site, this could be quite late.
A cache update request is initiated via cron on the following wordpress actions:
If your install has a user update that does NOT trigger a wordpress action (eg: another plugin stores user data somewhere else), then the plugin has no way of knowing that a user update has happened.
If the other plugin uses its own update actions, you could add a custom function call on that action similar to the above calls.
Alternatively either a regularly scheduled update or a manual on demand refresh may be adequate.
The cache update request attempts to schedule a master cron job. Many of these wordpress actions may trigger within milliseconds of each other. The plugin therefore checks whether a cache update is scheduled within the near future to avoid duplicate work.
The master cron cache job then schedules individual jobs for each of the reports. They are scheduled to run separately, not concurrently. In your cron manager plugin you should see an entry for each job.
When testing, you should therefore do a page request or two approximately minutes apart for each report that you have designed. Check the cache log in between.
(version 3.4.9 at time of writing)
This may change at a later stage for installs that only use standard wordpress user meta. Other installs will need the current setupo to deal with their user data created by other plugins.
Currently a generic cache report table in csv format is created. This made sense originally, however as the plugin became popular more features were requested. This approach is not ideal for optimum efficiency (especially large high traffic installs). If one is only using standard wordpress user and user meta data, then the lists could be more efficient. To cope with non standard data, the curremt approach will have to continue.
The cache log will list the most recent cache rebuild activities. If you are concerned or not sure how the cache updates are initiated, please pay close attention to the cache log when testing. For more details see cacheing-the-cache-log
The cache status page lists
It also has options to totally clear out the various cache records (in case your install gets in a knot), and force the plugin to start again.