Skip to:
Content

bbPress.org


Ignore:
Timestamp:
12/06/2012 10:29:35 AM (14 years ago)
Author:
johnjamesjacoby
Message:

Introduce bbp_post_request() and bbp_get_request() sub-actions:

  • Update actions and sub-actions to use these new handlers.
  • Update new/edit forum/topic/reply handlers to use these.
  • Update phpdoc as needed.
  • Remove duplicate 'bp_actions' request hooks from BuddyPress group forums.
  • Does not include admin-side requests.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/core/sub-actions.php

    r4305 r4551  
    319319
    320320/**
     321 * The main action used for handling theme-side POST requests
     322 *
     323 * @since bbPress (r4550)
     324 * @uses do_action()
     325 */
     326function bbp_post_request() {
     327
     328        // Bail if not a POST action
     329        if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )
     330                return;
     331
     332        // Bail if action is not bbp-new-reply
     333        if ( empty( $_POST['action'] ) )
     334                return;
     335
     336        do_action( 'bbp_post_request', $_POST['action'] );
     337}
     338
     339/**
     340 * The main action used for handling theme-side GET requests
     341 *
     342 * @since bbPress (r4550)
     343 * @uses do_action()
     344 */
     345function bbp_get_request() {
     346
     347        // Bail if not a POST action
     348        if ( 'GET' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) )
     349                return;
     350
     351        // Bail if action is not bbp-new-reply
     352        if ( empty( $_GET['action'] ) )
     353                return;
     354
     355        do_action( 'bbp_get_request', $_GET['action'] );
     356}
     357
     358/** Filters *******************************************************************/
     359
     360/**
    321361 * Filter the plugin locale and domain.
    322362 *
    … …  
    329369        return apply_filters( 'bbp_plugin_locale', $locale, $domain );
    330370}
    331 
    332 /** Filters *******************************************************************/
    333371
    334372/**
Note: See TracChangeset for help on using the changeset viewer.