/bp-core/deprecated/1.6.php

  1. <?php 
  2. /** 
  3. * Deprecated Functions 
  4. * 
  5. * @package BuddyPress 
  6. * @subpackage Core 
  7. * @deprecated 1.6.0 
  8. */ 
  9.  
  10. // Exit if accessed directly 
  11. defined( 'ABSPATH' ) || exit; 
  12.  
  13. /** Toolbar functions *********************************************************/ 
  14.  
  15. /** 
  16. * @deprecated 1.6.0 
  17. */ 
  18. function bp_admin_bar_remove_wp_menus() { 
  19. _deprecated_function( __FUNCTION__, '1.6' ); 
  20.  
  21. /** 
  22. * @deprecated 1.6.0 
  23. */ 
  24. function bp_admin_bar_root_site() { 
  25. _deprecated_function( __FUNCTION__, '1.6' ); 
  26.  
  27. /** 
  28. * @deprecated 1.6.0 
  29. */ 
  30. function bp_admin_bar_my_sites_menu() { 
  31. _deprecated_function( __FUNCTION__, '1.6' ); 
  32.  
  33. /** 
  34. * @deprecated 1.6.0 
  35. */ 
  36. function bp_admin_bar_comments_menu( $wp_admin_bar = '' ) { 
  37. _deprecated_function( __FUNCTION__, '1.6' ); 
  38.  
  39. /** 
  40. * @deprecated 1.6.0 
  41. */ 
  42. function bp_admin_bar_appearance_menu() { 
  43. _deprecated_function( __FUNCTION__, '1.6' ); 
  44.  
  45. /** 
  46. * @deprecated 1.6.0 
  47. */ 
  48. function bp_admin_bar_updates_menu() { 
  49. _deprecated_function( __FUNCTION__, '1.6' ); 
  50.  
  51. /** 
  52. * @deprecated 1.6.0 
  53. */ 
  54. function bp_members_admin_bar_my_account_logout() { 
  55. _deprecated_function( __FUNCTION__, '1.6' ); 
  56.  
  57. /** 
  58. * @deprecated 1.6.0 
  59. */ 
  60. function bp_core_is_user_deleted( $user_id = 0 ) { 
  61. _deprecated_function( __FUNCTION__, '1.6' ); 
  62. bp_is_user_deleted( $user_id ); 
  63.  
  64. /** 
  65. * @deprecated 1.6.0 
  66. */ 
  67. function bp_core_is_user_spammer( $user_id = 0 ) { 
  68. _deprecated_function( __FUNCTION__, '1.6' ); 
  69. bp_is_user_spammer( $user_id ); 
  70.  
  71.  
  72. /** 
  73. * Blogs functions 
  74. */ 
  75.  
  76. /** 
  77. * @deprecated 1.6.0 
  78. * @deprecated No longer used; see bp_activity_transition_post_type_comment_status() 
  79. */ 
  80. function bp_blogs_manage_comment( $comment_id, $comment_status ) { 
  81. _deprecated_function( __FUNCTION__, '1.6', 'No longer used' ); 
  82.  
  83. /** 
  84. * Core functions 
  85. */ 
  86.  
  87. /** 
  88. * @deprecated 1.6.0 
  89. * @deprecated No longer used; see BP_Admin::admin_menus() 
  90. */ 
  91. function bp_core_add_admin_menu() { 
  92. _deprecated_function( __FUNCTION__, '1.6', 'No longer used' ); 
  93.  
  94. /** 
  95. * @deprecated 1.6.0 
  96. * @deprecated No longer used. We do ajax properly now. 
  97. */ 
  98. function bp_core_add_ajax_hook() { 
  99. _deprecated_function( __FUNCTION__, '1.6', 'No longer used' ); 
  100.  
  101. /** 
  102. * Friends functions 
  103. */ 
  104.  
  105. /** 
  106. * Displays Friends header tabs 
  107. * 
  108. * @deprecated 1.6.0 
  109. * @deprecated No longer used 
  110. */ 
  111. function bp_friends_header_tabs() { 
  112. _deprecated_function( __FUNCTION__, '1.6', 'Since BuddyPress 1.2, BP has not supported ordering of friend lists by URL parameters.' ); 
  113. ?> 
  114.  
  115. <li<?php if ( !bp_action_variable( 0 ) || bp_is_action_variable( 'recently-active', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_displayed_user_domain() . bp_get_friends_slug() . '/my-friends/recently-active' ) ?>"><?php _e( 'Recently Active', 'buddypress' ) ?></a></li> 
  116. <li<?php if ( bp_is_action_variable( 'newest', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_displayed_user_domain() . bp_get_friends_slug() . '/my-friends/newest' ) ?>"><?php _e( 'Newest', 'buddypress' ) ?></a></li> 
  117. <li<?php if ( bp_is_action_variable( 'alphabetically', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_displayed_user_domain() . bp_get_friends_slug() . '/my-friends/alphabetically' ) ?>"><?php _e( 'Alphabetically', 'buddypress' ) ?></a></li> 
  118.  
  119. <?php 
  120. do_action( 'friends_header_tabs' ); 
  121.  
  122. /** 
  123. * Filters the title for the Friends component 
  124. * 
  125. * @deprecated 1.6.0 
  126. * @deprecated No longer used 
  127. */ 
  128. function bp_friends_filter_title() { 
  129. _deprecated_function( __FUNCTION__, '1.6', 'Since BuddyPress 1.2, BP has not supported ordering of friend lists by URL parameters.' ); 
  130.  
  131. $current_filter = bp_action_variable( 0 ); 
  132.  
  133. switch ( $current_filter ) { 
  134. case 'recently-active': default: 
  135. _e( 'Recently Active', 'buddypress' ); 
  136. break; 
  137. case 'newest': 
  138. _e( 'Newest', 'buddypress' ); 
  139. break; 
  140. case 'alphabetically': 
  141. _e( 'Alphabetically', 'buddypress' ); 
  142. break; 
  143.  
  144.  
  145. /** Groups functions **********************************************************/ 
  146.  
  147. /** 
  148. * @deprecated 1.6.0 
  149. * @deprecated Renamed to groups_get_id() for greater consistency 
  150. */ 
  151. function groups_check_group_exists( $group_slug ) { 
  152. _deprecated_function( __FUNCTION__, '1.6', 'groups_get_id()' ); 
  153. return groups_get_id( $group_slug ); 
  154.  
  155. /** Admin functions ***********************************************************/ 
  156.  
  157. /** 
  158. * Loads admin panel styles and scripts. 
  159. * 
  160. * @deprecated 1.6.0 
  161. */ 
  162. function bp_core_add_admin_menu_styles() { 
  163. _deprecated_function( __FUNCTION__, '1.6' ); 
  164.  
  165. /** Activity functions ********************************************************/ 
  166.  
  167. /** 
  168. * @deprecated 1.6.0 
  169. */ 
  170. function updates_register_activity_actions() { 
  171. _deprecated_function( __FUNCTION__, '1.6' ); 
  172.  
  173. /** 
  174. * Sets the "From" address in emails sent 
  175. * 
  176. * @deprecated 1.6.0 
  177. * @return string email address 
  178. */ 
  179. function bp_core_email_from_address_filter() { 
  180. _deprecated_function( __FUNCTION__, '1.6' ); 
  181.  
  182. $domain = (array) explode( '/', site_url() ); 
  183. return apply_filters( 'bp_core_email_from_address_filter', 'noreply@' . $domain[2] ); 
  184.  
  185. /** 
  186. * Backward compatibility for AJAX callbacks that do not die() on their own 
  187. * 
  188. * In BuddyPress 1.6, BP was altered so that it uses admin-ajax.php (instead of wp-load.php) for 
  189. * AJAX requests. admin-ajax.php dies with an output of '0' (to signify an error), so that if an 
  190. * AJAX callback does not kill PHP execution, a '0' character will be erroneously appended to the 
  191. * output. All bp-default AJAX callbacks (/bp-themes/bp-default/_inc/ajax.php) have been updated 
  192. * for BP 1.6 so that they die() properly; any theme that dynamically includes this file will 
  193. * inherit the fixes. However, any theme that contains a copy of BP's pre-1.5 ajax.php file will 
  194. * continue to witness the 'trailing "0"' problem. 
  195. * 
  196. * This function provides a backward compatible workaround for these themes, by hooking to the 
  197. * BP wp_ajax_ actions that were problematic prior to BP 1.6, and killing PHP execution with die(). 
  198. * 
  199. * Note that this hack only runs if the function bp_dtheme_register_actions() is not found (this 
  200. * function was introduced in BP 1.6 for related backward compatibility reasons). 
  201. * 
  202. * @deprecated 1.6.0 
  203. */ 
  204. if ( !function_exists( 'bp_dtheme_register_actions' ) ) : 
  205. function bp_die_legacy_ajax_callbacks() { 
  206.  
  207. // This is a list of the BP wp_ajax_ hook suffixes whose associated functions did 
  208. // not die properly before BP 1.6 
  209. $actions = array( 
  210. // Directory template loaders 
  211. 'members_filter',  
  212. 'groups_filter',  
  213. 'blogs_filter',  
  214. 'forums_filter',  
  215. 'messages_filter',  
  216.  
  217. // Activity 
  218. 'activity_widget_filter',  
  219. 'activity_get_older_updates',  
  220. 'post_update',  
  221. 'new_activity_comment',  
  222. 'delete_activity',  
  223. 'delete_activity_comment',  
  224. 'spam_activity',  
  225. 'spam_activity_comment',  
  226. 'activity_mark_fav',  
  227. 'activity_mark_unfav',  
  228.  
  229. // Groups 
  230. 'groups_invite_user',  
  231. 'joinleave_group',  
  232.  
  233. // Members 
  234. 'addremove_friend',  
  235. 'accept_friendship',  
  236. 'reject_friendship',  
  237.  
  238. // Messages 
  239. 'messages_close_notice',  
  240. 'messages_send_reply',  
  241. 'messages_markunread',  
  242. 'messages_markread',  
  243. 'messages_delete',  
  244. 'messages_autocomplete_results' 
  245. ); 
  246.  
  247. // For each of the problematic hooks, exit at the very end of execution 
  248. foreach( $actions as $action ) { 
  249. add_action( 'wp_ajax_' . $action, create_function( '', 'exit;' ), 9999 ); 
  250. add_action( 'wp_ajax_nopriv_' . $action, create_function( '', 'exit;' ), 9999 ); 
  251. add_action( 'after_setup_theme', 'bp_die_legacy_ajax_callbacks', 20 ); 
  252. endif; 
.