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

Points logs datatable

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 live search and the ability to change the number of logs per page. This is made possible through the use of the DataTables script (a web browser with JavaScript enabled is required for this to work). If you wish to display just a regular table without the extra features of DataTables, you need to set the 'datatables' attribute to '0'.

Example: #

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