bp_dtheme_register_actions

Register AJAX handlers for BP Default theme functionality.

Description

bp_dtheme_register_actions(); 

This function is registered to the after_setup_theme hook with priority 20 as this file is included in a function hooked to after_setup_theme at priority 10.


Usage

  1. if ( !function_exists( 'bp_dtheme_register_actions' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-themes/bp-default/_inc/ajax.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bp_dtheme_register_actions(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/bp-themes/bp-default/_inc/ajax.php  
  1. function bp_dtheme_register_actions() { 
  2. $actions = array( 
  3. // Directory filters 
  4. 'blogs_filter' => 'bp_dtheme_object_template_loader',  
  5. 'forums_filter' => 'bp_dtheme_object_template_loader',  
  6. 'groups_filter' => 'bp_dtheme_object_template_loader',  
  7. 'members_filter' => 'bp_dtheme_object_template_loader',  
  8. 'messages_filter' => 'bp_dtheme_messages_template_loader',  
  9.  
  10. // Friends 
  11. 'accept_friendship' => 'bp_dtheme_ajax_accept_friendship',  
  12. 'addremove_friend' => 'bp_dtheme_ajax_addremove_friend',  
  13. 'reject_friendship' => 'bp_dtheme_ajax_reject_friendship',  
  14.  
  15. // Activity 
  16. 'activity_get_older_updates' => 'bp_dtheme_activity_template_loader',  
  17. 'activity_mark_fav' => 'bp_dtheme_mark_activity_favorite',  
  18. 'activity_mark_unfav' => 'bp_dtheme_unmark_activity_favorite',  
  19. 'activity_widget_filter' => 'bp_dtheme_activity_template_loader',  
  20. 'delete_activity' => 'bp_dtheme_delete_activity',  
  21. 'delete_activity_comment' => 'bp_dtheme_delete_activity_comment',  
  22. 'get_single_activity_content' => 'bp_dtheme_get_single_activity_content',  
  23. 'new_activity_comment' => 'bp_dtheme_new_activity_comment',  
  24. 'post_update' => 'bp_dtheme_post_update',  
  25. 'bp_spam_activity' => 'bp_dtheme_spam_activity',  
  26. 'bp_spam_activity_comment' => 'bp_dtheme_spam_activity',  
  27.  
  28. // Groups 
  29. 'joinleave_group' => 'bp_dtheme_ajax_joinleave_group',  
  30.  
  31. // Messages 
  32. 'messages_autocomplete_results' => 'bp_dtheme_ajax_messages_autocomplete_results',  
  33. 'messages_close_notice' => 'bp_dtheme_ajax_close_notice',  
  34. 'messages_delete' => 'bp_dtheme_ajax_messages_delete',  
  35. 'messages_markread' => 'bp_dtheme_ajax_message_markread',  
  36. 'messages_markunread' => 'bp_dtheme_ajax_message_markunread',  
  37. 'messages_send_reply' => 'bp_dtheme_ajax_messages_send_reply',  
  38. ); 
  39.  
  40. /** 
  41. * Register all of these AJAX handlers 
  42. * The "wp_ajax_" action is used for logged in users, and "wp_ajax_nopriv_" 
  43. * executes for users that aren't logged in. This is for backpat with BP <1.6. 
  44. */ 
  45. foreach( $actions as $name => $function ) { 
  46. add_action( 'wp_ajax_' . $name, $function );