Changeset 4548
- Timestamp:
- 12/06/2012 09:36:18 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bbpress.php
r4514 r4548 288 288 289 289 // Common 290 require( $this->includes_dir . 'common/ajax.php' ); 290 291 require( $this->includes_dir . 'common/classes.php' ); 291 292 require( $this->includes_dir . 'common/functions.php' ); -
trunk/includes/common/functions.php
r4543 r4548 1688 1688 $wp_query->set_404(); 1689 1689 } 1690 1691 /**1692 * Helper method to return JSON response for the ajax calls1693 *1694 * @since bbPress (r4542)1695 *1696 * @param bool $success1697 * @param string $content1698 * @param array $extras1699 */1700 function bbp_ajax_response( $success = false, $content = '', $status = -1, $extras = array() ) {1701 1702 // Set status to 200 if setting response as successful1703 if ( ( true === $success ) && ( -1 === $status ) )1704 $status = 200;1705 1706 // Setup the response array1707 $response = array(1708 'success' => $success,1709 'status' => $status,1710 'content' => $content1711 );1712 1713 // Merge extra response parameters in1714 if ( !empty( $extras ) && is_array( $extras ) ) {1715 $response = array_merge( $response, $extras );1716 }1717 1718 // Send back the JSON1719 header( 'Content-type: application/json' );1720 echo json_encode( $response );1721 die();1722 }
Note: See TracChangeset
for help on using the changeset viewer.