Changeset 7542
- Timestamp:
- 11/09/2013 01:30:04 PM (13 years ago)
- Location:
- trunk/bp-core
- Files:
-
- 3 edited
-
bp-core-actions.php (modified) (1 diff)
-
bp-core-dependency.php (modified) (1 diff)
-
bp-core-functions.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-actions.php
r7433 r7542 85 85 * v---Load order 86 86 */ 87 add_action( 'bp_template_redirect', 'bp_redirect_canonical', 2 ); 88 add_action( 'bp_template_redirect', 'bp_actions', 4 ); 89 add_action( 'bp_template_redirect', 'bp_screens', 6 ); 87 add_action( 'bp_template_redirect', 'bp_redirect_canonical', 2 ); 88 add_action( 'bp_template_redirect', 'bp_actions', 4 ); 89 add_action( 'bp_template_redirect', 'bp_screens', 6 ); 90 add_action( 'bp_template_redirect', 'bp_post_request', 10 ); 91 add_action( 'bp_template_redirect', 'bp_get_request', 10 ); 90 92 91 93 /** -
trunk/bp-core/bp-core-dependency.php
r7446 r7542 339 339 return apply_filters( 'bp_allowed_themes', $themes ); 340 340 } 341 342 /** Requests ******************************************************************/ 343 344 /** 345 * The main action used for handling theme-side POST requests 346 * 347 * @since BuddyPress (1.9.0) 348 * @uses do_action() 349 */ 350 function bp_post_request() { 351 352 // Bail if not a POST action 353 if ( ! bp_is_post_request() ) 354 return; 355 356 // Bail if no action 357 if ( empty( $_POST['action'] ) ) 358 return; 359 360 // This dynamic action is probably the one you want to use. It narrows down 361 // the scope of the 'action' without needing to check it in your function. 362 do_action( 'bp_post_request_' . $_POST['action'] ); 363 364 // Use this static action if you don't mind checking the 'action' yourself. 365 do_action( 'bp_post_request', $_POST['action'] ); 366 } 367 368 /** 369 * The main action used for handling theme-side GET requests 370 * 371 * @since BuddyPress (1.9.0) 372 * @uses do_action() 373 */ 374 function bp_get_request() { 375 376 // Bail if not a POST action 377 if ( ! bp_is_get_request() ) 378 return; 379 380 // Bail if no action 381 if ( empty( $_GET['action'] ) ) 382 return; 383 384 // This dynamic action is probably the one you want to use. It narrows down 385 // the scope of the 'action' without needing to check it in your function. 386 do_action( 'bp_get_request_' . $_GET['action'] ); 387 388 // Use this static action if you don't mind checking the 'action' yourself. 389 do_action( 'bp_get_request', $_GET['action'] ); 390 } -
trunk/bp-core/bp-core-functions.php
r7541 r7542 1472 1472 } 1473 1473 1474 /** Requests ******************************************************************/ 1475 1476 /** 1477 * Return true|false if this is a POST request 1478 * 1479 * @since BuddyPress (1.9.0) 1480 * @return bool 1481 */ 1482 function bp_is_post_request() { 1483 return (bool) ( 'POST' === strtoupper( $_SERVER['REQUEST_METHOD'] ) ); 1484 } 1485 1486 /** 1487 * Return true|false if this is a GET request 1488 * 1489 * @since BuddyPress (1.9.0) 1490 * @return bool 1491 */ 1492 function bp_is_get_request() { 1493 return (bool) ( 'GET' === strtoupper( $_SERVER['REQUEST_METHOD'] ) ); 1494 } 1495 1496 1474 1497 /** Miscellaneous hooks *******************************************************/ 1475 1498
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)