[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

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

   1  <?php
   2  /**
   3   * Deprecated functions.
   4   *
   5   * @deprecated 3.0.0
   6   */
   7  
   8  // Exit if accessed directly.
   9  defined( 'ABSPATH' ) || exit;
  10  
  11  /**
  12   * Check whether bbPress plugin-powered Group Forums are enabled.
  13   *
  14   * @since 1.6.0
  15   * @since 3.0.0 $default argument's default value changed from true to false.
  16   * @deprecated 3.0.0 No longer used in core, but supported for third-party code.
  17   *
  18   * @param bool $default Optional. Fallback value if not found in the database.
  19   *                      Default: false.
  20   * @return bool True if group forums are active, otherwise false.
  21   */
  22  function bp_is_group_forums_active( $default = false ) {
  23      _deprecated_function( __FUNCTION__, '3.0', 'groups_get_group( $id )->enable_forum' );
  24  
  25      $is_active = function_exists( 'bbp_is_group_forums_active' ) ? bbp_is_group_forums_active( $default ) : $default;
  26  
  27      /**
  28       * Filters whether or not bbPress plugin-powered Group Forums are enabled.
  29       *
  30       * @since 1.6.0
  31       * @deprecated 3.0.0 No longer used in core, but supported for third-party code.
  32       *
  33       * @param bool $value Whether or not bbPress plugin-powered Group Forums are enabled.
  34       */
  35      return (bool) apply_filters( 'bp_is_group_forums_active', $is_active );
  36  }
  37  
  38  /**
  39   * Is this a user's forums page?
  40   *
  41   * Eg http://example.com/members/joe/forums/ (or a subpage thereof).
  42   *
  43   * @since 1.5.0
  44   * @deprecated 3.0.0 No longer used in core, but supported for third-party code.
  45   *
  46   * @return false
  47   */
  48  function bp_is_user_forums() {
  49      _deprecated_function( __FUNCTION__, '3.0', 'legacy forum support removed' );
  50      return false;
  51  }
  52  
  53  /**
  54   * Is the current page a group's (legacy bbPress) forum page?
  55   *
  56   * @since 1.1.0
  57   * @since 3.0.0 Always returns false.
  58   * @deprecated 3.0.0 No longer used in core, but supported for custom theme templates.
  59   *
  60   * @return bool
  61   */
  62  function bp_is_group_forum() {
  63      _deprecated_function( __FUNCTION__, '3.0', 'legacy forum support removed' );
  64      return false;
  65  }
  66  
  67  
  68  /**
  69   * Output a 'New Topic' button for a group.
  70   *
  71   * @since 1.2.7
  72   * @deprecated 3.0.0 No longer used in core, but supported for third-party code.
  73   *
  74   * @param BP_Groups_Group|bool $group The BP Groups_Group object if passed, boolean false if not passed.
  75   */
  76  function bp_group_new_topic_button( $group = false ) {
  77      _deprecated_function( __FUNCTION__, '3.0', 'legacy forum support removed' );
  78  }
  79  
  80      /**
  81       * Return a 'New Topic' button for a group.
  82       *
  83       * @since 1.2.7
  84       * @deprecated 3.0.0 No longer used in core, but supported for third-party code.
  85       *
  86       * @param BP_Groups_Group|bool $group The BP Groups_Group object if passed, boolean false if not passed.
  87       *
  88       * @return false
  89       */
  90  	function bp_get_group_new_topic_button( $group = false ) {
  91          _deprecated_function( __FUNCTION__, '3.0', 'legacy forum support removed' );
  92          return false;
  93      }
  94  
  95  /**
  96   * Catch a "Mark as Spammer/Not Spammer" click from the toolbar.
  97   *
  98   * When a site admin selects "Mark as Spammer/Not Spammer" from the admin menu
  99   * this action will fire and mark or unmark the user and their blogs as spam.
 100   * Must be a site admin for this function to run.
 101   *
 102   * Note: no longer used in the current state. See the Settings component.
 103   *
 104   * @since 1.1.0
 105   * @since 1.6.0 No longer used, unhooked.
 106   * @since 3.0.0 Formally marked as deprecated.
 107   *
 108   * @param int $user_id Optional. User ID to mark as spam. Defaults to displayed user.
 109   */
 110  function bp_core_action_set_spammer_status( $user_id = 0 ) {
 111      _deprecated_function( __FUNCTION__, '3.0' );
 112  
 113      // Only super admins can currently spam users (but they can't spam
 114      // themselves).
 115      if ( ! is_super_admin() || bp_is_my_profile() ) {
 116          return;
 117      }
 118  
 119      // Use displayed user if it's not yourself.
 120      if ( empty( $user_id ) )
 121          $user_id = bp_displayed_user_id();
 122  
 123      if ( bp_is_current_component( 'admin' ) && ( in_array( bp_current_action(), array( 'mark-spammer', 'unmark-spammer' ) ) ) ) {
 124  
 125          // Check the nonce.
 126          check_admin_referer( 'mark-unmark-spammer' );
 127  
 128          // To spam or not to spam.
 129          $status = bp_is_current_action( 'mark-spammer' ) ? 'spam' : 'ham';
 130  
 131          // The heavy lifting.
 132          bp_core_process_spammer_status( $user_id, $status );
 133  
 134          // Add feedback message. @todo - Error reporting.
 135          if ( 'spam' == $status ) {
 136              bp_core_add_message( __( 'User marked as spammer. Spam users are visible only to site admins.', 'buddypress' ) );
 137          } else {
 138              bp_core_add_message( __( 'User removed as spammer.', 'buddypress' ) );
 139          }
 140  
 141          // Deprecated. Use bp_core_process_spammer_status.
 142          $is_spam = 'spam' == $status;
 143          do_action( 'bp_core_action_set_spammer_status', bp_displayed_user_id(), $is_spam );
 144  
 145          // Redirect back to where we came from.
 146          bp_core_redirect( wp_get_referer() );
 147      }
 148  }
 149  
 150  /**
 151   * Process user deletion requests.
 152   *
 153   * Note: no longer used in the current state. See the Settings component.
 154   *
 155   * @since 1.1.0
 156   * @since 1.6.0 No longer used, unhooked.
 157   * @since 3.0.0 Formally marked as deprecated.
 158   */
 159  function bp_core_action_delete_user() {
 160      _deprecated_function( __FUNCTION__, '3.0' );
 161  
 162      if ( !bp_current_user_can( 'bp_moderate' ) || bp_is_my_profile() || !bp_displayed_user_id() )
 163          return false;
 164  
 165      if ( bp_is_current_component( 'admin' ) && bp_is_current_action( 'delete-user' ) ) {
 166  
 167          // Check the nonce.
 168          check_admin_referer( 'delete-user' );
 169  
 170          $errors = false;
 171          do_action( 'bp_core_before_action_delete_user', $errors );
 172  
 173          if ( bp_core_delete_account( bp_displayed_user_id() ) ) {
 174              bp_core_add_message( sprintf( __( '%s has been deleted from the system.', 'buddypress' ), bp_get_displayed_user_fullname() ) );
 175          } else {
 176              bp_core_add_message( sprintf( __( 'There was an error deleting %s from the system. Please try again.', 'buddypress' ), bp_get_displayed_user_fullname() ), 'error' );
 177              $errors = true;
 178          }
 179  
 180          do_action( 'bp_core_action_delete_user', $errors );
 181  
 182          if ( $errors )
 183              bp_core_redirect( bp_displayed_user_domain() );
 184          else
 185              bp_core_redirect( bp_loggedin_user_domain() );
 186      }
 187  }


Generated: Tue Jul 23 01:01:40 2019 Cross-referenced by PHPXref 0.7.1