Skip to:
Content

bbPress.org


Ignore:
Timestamp:
06/05/2016 06:27:54 PM (8 years ago)
Author:
johnjamesjacoby
Message:

Moderators: Refactor per-forum moderators to use meta-data instead of mocked taxonomy terms.

If the future of Forums is a taxonomy (vs. a custom post-type) then a per-forum Moderator taxonomy for a Forum taxonomy won't work very well, for a few reasons:

  • Scalability
  • Taxonomies for taxonomies is a bit more inception than should be required for this simple feature
  • Forum moderators do not require much of what taxonomy objects provide (permalinks, visibility, metadata, etc...)
  • User taxonomy terms matching nicenames works okay for something like Automattic's P2 theme, but bbPress requires a user ID based solution to avoid data synchronization issues between nicenames & term slugs

So... the future of per-forum per-user capability mappings is in meta-data using map_meta_cap.

This commit:

  • Removes the forum_mod taxonomy and surrounding code additions introduced in the first pass in r5834
  • Renames forum_mod functions to forum_moderator to be more explicit
  • Adds CRUD wrapper functions for per-forum moderator meta data
  • Adds administrative interfaces for assigning moderators to forums for wp-admin and forum edit pages
  • Adds helper functions for getting user nicenames & IDs

Note that this feature has now been refactored to no longer be forum specific (I.E. object agnostic) -- it's possible for any user access to be mapped based on the object type using any meta-data key. While this is currently useful for per-forum moderators, it may be user for per-topic blocking, per-topic-tag moderation, etc...

See #459.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/core/actions.php

    r6054 r6056  
    341341
    342342// Clean bbPress post caches when WordPress's is cleaned
    343 add_action( 'clean_post_cache', 'bbp_clean_post_cache', 10, 2 );
     343add_action( 'clean_post_cache', 'bbp_clean_post_cache' );
    344344
    345345/**
Note: See TracChangeset for help on using the changeset viewer.