[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

/src/bp-xprofile/ -> bp-xprofile-notifications.php (source)

   1  <?php
   2  /**
   3   * BuddyPress XProfile Notifications.
   4   *
   5   * @package    BuddyPress
   6   * @subpackage XProfileSettings
   7   * @since 1.0.0
   8   */
   9  
  10  /** Notifications *************************************************************/
  11  
  12  /**
  13   * Format notifications for the extended profile (Xprofile) component.
  14   *
  15   * @since 2.4.0
  16   *
  17   * @param string $action            The kind of notification being rendered.
  18   * @param int    $item_id           The primary item ID.
  19   * @param int    $secondary_item_id The secondary item ID.
  20   * @param int    $total_items       The total number of messaging-related notifications
  21   *                                  waiting for the user.
  22   * @param string $format            'string' for BuddyBar-compatible notifications; 'array'
  23   *                                  for WP Toolbar. Default: 'string'.
  24   * @return string
  25   */
  26  function xprofile_format_notifications( $action, $item_id, $secondary_item_id, $total_items, $format = 'string' ) {
  27      switch ( $action ) {
  28          default:
  29  
  30              /**
  31               * Allows plugins to filter extended profile-related custom notifications.
  32               * Notifications must have a 'component_name' of 'xprofile' to be routed
  33               * to this function.
  34               *
  35               * @since 2.4.0
  36               *
  37               * @param string $notification      Null value.
  38               * @param int    $item_id           The primary item ID.
  39               * @param int    $secondary_item_id The secondary item ID.
  40               * @param int    $total_items       The total number of messaging-related notifications
  41               *                                  waiting for the user.
  42               * @param string $format            'string' for BuddyBar-compatible notifications;
  43               *                                  'array' for WP Toolbar.
  44               */
  45              $custom_action_notification = apply_filters( 'bp_xprofile_' . $action . '_notification', null, $item_id, $secondary_item_id, $total_items, $format );
  46  
  47              if ( ! is_null( $custom_action_notification ) ) {
  48                  return $custom_action_notification;
  49              }
  50  
  51              break;
  52      }
  53  
  54      return false;
  55  }


Generated: Mon Dec 9 01:01:38 2019 Cross-referenced by PHPXref 0.7.1