Skip to content

User Contributions

The Contributions view shows a paginated list of wiki pages that a specific user has created or edited. It is used in BuddyPress and PeepSo profile tabs and is also accessible from the standalone wiki dashboard.

At the top of the view, a stats bar displays the user’s contribution summary:

  • Pages created - total number of wiki pages the user created
  • Pages edited - total number of wiki pages the user has contributed to (including pages created by others)

Below the stats, the list is filterable by two tabs:

Tab What it shows
All Contributions All published pages the user has contributed to (created or edited)
Created Only pages where the user is the original author

Each list item shows:

  • Lock icon if the page is protected (admin-only editing)
  • Page title linked to the full wiki page
  • “creator” badge if the viewing user originally created this page
  • Excerpt (up to 20 words, if a custom excerpt exists)
  • Last updated time in relative format
  • Category names the page belongs to
  • View button (always shown)
  • Edit button (shown only to the owner of the profile, if they have edit permission)

If you are viewing your own contributions, a Create New Page button appears (if you have create permission) and a Wiki Dashboard link. These are not shown when viewing another user’s contributions.

?wbmw_action=contributions&user=5

Replace 5 with the user ID whose contributions you want to view.

When using BuddyPress or PeepSo, a Wiki tab appears on member profile pages automatically and loads this view for the profile owner.

Switch between “All Contributions” and “Created” by appending wiki_filter to the current URL:

?wbmw_action=contributions&user=5&wiki_filter=all
?wbmw_action=contributions&user=5&wiki_filter=created

Results are paginated using the Pages Per Page setting from General Settings (default: 10). Navigate pages with:

?wiki_paged=2

Two hooks fire within the contributions template:

Fires before the contributions list is rendered.

add_action( 'wbmw_before_contributions', function( $user_id, $query ) {
// Example: show a custom message for new contributors
if ( $query->found_posts === 0 ) {
echo '<div class="notice">Welcome! Start contributing to the wiki.</div>';
}
}, 10, 2 );
Parameter Type Description
$user_id int User ID whose contributions are displayed
$query WP_Query The query object for the contributions list

Fires after the contributions list is rendered.

add_action( 'wbmw_after_contributions', function( $user_id, $query ) {
// Example: add a link to external profile
}, 10, 2 );
Parameter Type Description
$user_id int User ID whose contributions are displayed
$query WP_Query The query object for the contributions list

The “All Contributions” query finds pages where the user’s ID is stored in the _wbmw_contributors post meta array. The query uses a SQL LIKE search followed by PHP-side verification to avoid serialization false positives from partial integer matches.

The “Created” filter uses a standard author WP_Query argument.