Skip to:
Content

bbPress.org


Ignore:
Timestamp:
06/05/2016 06:27:54 PM (9 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/templates/default/bbpress/form-forum.php

    r5868 r6056  
    9191                    <?php endif; ?>
    9292
    93                     <?php if ( bbp_allow_forum_mods() && current_user_can( 'assign_forum_mods' ) ) : ?>
     93                    <?php if ( bbp_allow_forum_mods() && current_user_can( 'assign_moderators' ) ) : ?>
    9494
    9595                        <?php do_action( 'bbp_theme_before_forum_form_mods' ); ?>
    9696
    9797                        <p>
    98                             <label for="bbp_forum_mods"><?php esc_html_e( 'Forum Moderators:', 'bbpress' ); ?></label><br />
    99                             <input type="text" value="<?php bbp_form_forum_mods(); ?>" size="40" name="bbp_forum_mods" id="bbp_forum_mods" />
     98                            <label for="bbp_moderators"><?php esc_html_e( 'Forum Moderators:', 'bbpress' ); ?></label><br />
     99                            <input type="text" value="<?php bbp_form_forum_moderators(); ?>" size="40" name="bbp_moderators" id="bbp_moderators" />
    100100                        </p>
    101101
Note: See TracChangeset for help on using the changeset viewer.