Skip to:
Content

bbPress.org


Ignore:
Timestamp:
11/14/2011 03:33:48 AM (13 years ago)
Author:
johnjamesjacoby
Message:

Introduce bbp_template_redirect() and use for checking various edit screens:

  • Introduce bbp_check_topic_edit() to check for topic edit
  • Introduce bbp_check_reply_edit() to check for reply edit
  • Introduce bbp_check_topic_tag_edit() to check for topic tag edit
  • Introduce bbp_check_user_edit() to check for user edit
  • Remove these checks from bbp_pre_get_posts() and only use it to setup query vars
  • See #1684
  • For 2.0 branch
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0/bbp-includes/bbp-core-hooks.php

    r3515 r3605  
    3737add_action( 'generate_rewrite_rules', 'bbp_generate_rewrite_rules', 10 );
    3838add_action( 'wp_enqueue_scripts',     'bbp_enqueue_scripts',        10 );
     39add_action( 'template_redirect',      'bbp_template_redirect',      10 );
    3940add_filter( 'template_include',       'bbp_template_include',       10 );
    4041
     
    228229add_action( 'bbp_activation',   'flush_rewrite_rules' );
    229230add_action( 'bbp_deactivation', 'flush_rewrite_rules' );
     231
     232// Redirect user if needed
     233add_action( 'bbp_template_redirect', 'bbp_check_user_edit',      10 );
     234add_action( 'bbp_template_redirect', 'bbp_check_topic_edit',     10 );
     235add_action( 'bbp_template_redirect', 'bbp_check_reply_edit',     10 );
     236add_action( 'bbp_template_redirect', 'bbp_check_topic_tag_edit', 10 );
    230237
    231238/**
     
    710717}
    711718
     719/** Theme Permissions *********************************************************/
     720
     721/**
     722 * The main action used for redirecting bbPress theme actions that are not
     723 * permitted by the current_user
     724 *
     725 * @since bbPress (r3605)
     726 *
     727 * @uses do_action()
     728 */
     729function bbp_template_redirect() {
     730    do_action( 'bbp_template_redirect' );
     731}
     732
    712733?>
Note: See TracChangeset for help on using the changeset viewer.