Changeset 5095 for trunk/bp-themes/bp-default/_inc/ajax.php
- Timestamp:
- 09/02/2011 10:45:02 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-themes/bp-default/_inc/ajax.php
r4937 r5095 84 84 /* This function will simply load the template loop for the current object. On an AJAX request */ 85 85 function bp_dtheme_object_template_loader() { 86 87 /** 88 * AJAX requests happen too early to be seen by bp_update_is_directory() 89 * so we do it manually here to ensure templates load with the correct 90 * context. Without this check, templates will load the 'single' version 91 * of themselves rather than the directory version. 92 */ 93 if ( !bp_current_action() ) 94 bp_update_is_directory( true, bp_current_component() ); 95 96 // Sanitize the post object 86 97 $object = esc_attr( $_POST['object'] ); 98 99 // Locate the object template 87 100 locate_template( array( "$object/$object-loop.php" ), true ); 88 101 } 89 102 add_action( 'wp_ajax_members_filter', 'bp_dtheme_object_template_loader' ); 90 add_action( 'wp_ajax_groups_filter', 'bp_dtheme_object_template_loader' );91 add_action( 'wp_ajax_blogs_filter', 'bp_dtheme_object_template_loader' );92 add_action( 'wp_ajax_forums_filter', 'bp_dtheme_object_template_loader' );103 add_action( 'wp_ajax_groups_filter', 'bp_dtheme_object_template_loader' ); 104 add_action( 'wp_ajax_blogs_filter', 'bp_dtheme_object_template_loader' ); 105 add_action( 'wp_ajax_forums_filter', 'bp_dtheme_object_template_loader' ); 93 106 94 107 // This function will load the activity loop template when activity is requested via AJAX
Note: See TracChangeset
for help on using the changeset viewer.