[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

/src/bp-core/deprecated/ -> 1.6.php (source)

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


Generated: Sun Dec 22 01:00:54 2024 Cross-referenced by PHPXref 0.7.1