Skip to:
Content

bbPress.org

Changeset 5023


Ignore:
Timestamp:
07/10/2013 05:15:11 PM (12 years ago)
Author:
johnjamesjacoby
Message:

Add dynamic actions to bbp_get_request() and bbp_post_request(). We'll likely move to using them in 2.5.

File:
1 edited

Legend:

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

    r4929 r5023  
    362362        return;
    363363
    364     do_action( 'bbp_post_request', $_POST['action'] );
     364    // This dynamic action is probably the one you want to use. It narrows down
     365    // the scope of the 'action' without needing to check it in your function.
     366    do_action( 'bbp_post_request_' . $_POST['action'] );
     367
     368    // Use this static action if you don't mind checking the 'action' yourself.
     369    do_action( 'bbp_post_request',   $_POST['action'] );
    365370}
    366371
     
    381386        return;
    382387
    383     do_action( 'bbp_get_request', $_GET['action'] );
     388    // This dynamic action is probably the one you want to use. It narrows down
     389    // the scope of the 'action' without needing to check it in your function.
     390    do_action( 'bbp_get_request_' . $_GET['action'] );
     391
     392    // Use this static action if you don't mind checking the 'action' yourself.
     393    do_action( 'bbp_get_request',   $_GET['action'] );
    384394}
    385395
Note: See TracChangeset for help on using the changeset viewer.