The [wordpoints_points_logs] shortcode displays the log entries for a type of points.

Searchabe, paginated table of points logs.

Basic Usage: #


This default usage displays the most recent log entries for the default points type. If you haven’t set a default points type, then you will be required to specify which one’s logs to display using the 'points_type' attribute.

Example: #

[wordpoints_points_logs points_type="credits"]

This will display the most recent points logs for the “credits” points type.

Specifying a Different Query to Display #

When the points logs are displayed, the Points component has to query the database to retrieve the logs. Which logs are returned depends on the query used. By default, this shortcode uses the 'default' query, which shows the most recent logs from the current site for all users, ordered from newest to oldest. You can change what logs are displayed by specifying a different query to be used.

Example: #

[wordpoints_points_logs points_type="credits" query="current_user"]

This will display the log entries returned by the 'current_user' query. This query is similar to the default one, except that only logs for the current (logged in) user are returned. For more information about the available logs queries, see here. Information on how developers can add their own custom logs queries may be found here {@todo link}.

Hiding the User Column #

In the above example, we used the shortcode to display the results of the 'current_user' query. This will result in a table where the ‘User’ column will always have the name of the current user. That’s kind of unnecessary, no? To hide the ‘User’ column, we can set the 'show_users' attribute to '0'.

Example: #

[wordpoints_points_logs points_type="credits" query="current_user" show_users="0"]

Setting 'show_users' to '1' (or any other value) will display the Users column in the table as usual.

Making the Table Non-interactive #

By default this shortcode displays an interactive paginated table with a search box. Each of these features can be independently disabled, using the paginate and searchable attributes, respectively. As with the show_users attribute, setting their values to 0 disables them.

(Note: before version 1.6.0, the table was paginated with the DataTables script (a web browser with JavaScript enabled was required for this to work). If you wanted to display a table without the extra features of DataTables, you needed to set the datatables attribute to '0'. This attribute is now deprecated in favor of the paginate and searchable attributes, and the DataTables script is no longer used.)

Examples: #

[wordpoints_points_logs points_type="credits" paginate="0"]

[wordpoints_points_logs points_type="credits" searchable="0"]

[wordpoints_points_logs points_type="credits" paginate="0" searchable="0"]