[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

/src/bp-core/classes/ -> class-bp-admin.php (source)

   1  <?php
   2  /**
   3   * Main BuddyPress Admin Class.
   4   *
   5   * @package BuddyPress
   6   * @subpackage CoreAdministration
   7   * @since 1.0.0
   8   */
   9  
  10  // Exit if accessed directly.
  11  defined( 'ABSPATH' ) || exit;
  12  
  13  if ( !class_exists( 'BP_Admin' ) ) :
  14  
  15  /**
  16   * Load BuddyPress plugin admin area.
  17   *
  18   * @todo Break this apart into each applicable Component.
  19   *
  20   * @since 1.6.0
  21   */
  22  class BP_Admin {
  23  
  24      /** Directory *************************************************************/
  25  
  26      /**
  27       * Path to the BuddyPress admin directory.
  28       *
  29       * @since 1.6.0
  30       * @var string $admin_dir
  31       */
  32      public $admin_dir = '';
  33  
  34      /** URLs ******************************************************************/
  35  
  36      /**
  37       * URL to the BuddyPress admin directory.
  38       *
  39       * @since 1.6.0
  40       * @var string $admin_url
  41       */
  42      public $admin_url = '';
  43  
  44      /**
  45       * URL to the BuddyPress images directory.
  46       *
  47       * @since 1.6.0
  48       * @var string $images_url
  49       */
  50      public $images_url = '';
  51  
  52      /**
  53       * URL to the BuddyPress admin CSS directory.
  54       *
  55       * @since 1.6.0
  56       * @var string $css_url
  57       */
  58      public $css_url = '';
  59  
  60      /**
  61       * URL to the BuddyPress admin JS directory.
  62       *
  63       * @since 1.6.0
  64       * @var string
  65       */
  66      public $js_url = '';
  67  
  68      /** Other *****************************************************************/
  69  
  70      /**
  71       * Notices used for user feedback, like saving settings.
  72       *
  73       * @since 1.9.0
  74       * @var array()
  75       */
  76      public $notices = array();
  77  
  78      /** Methods ***************************************************************/
  79  
  80      /**
  81       * The main BuddyPress admin loader.
  82       *
  83       * @since 1.6.0
  84       *
  85       */
  86  	public function __construct() {
  87          $this->setup_globals();
  88          $this->includes();
  89          $this->setup_actions();
  90      }
  91  
  92      /**
  93       * Set admin-related globals.
  94       *
  95       * @since 1.6.0
  96       */
  97  	private function setup_globals() {
  98          $bp = buddypress();
  99  
 100          // Paths and URLs
 101          $this->admin_dir  = trailingslashit( $bp->plugin_dir  . 'bp-core/admin' ); // Admin path.
 102          $this->admin_url  = trailingslashit( $bp->plugin_url  . 'bp-core/admin' ); // Admin url.
 103          $this->images_url = trailingslashit( $this->admin_url . 'images'        ); // Admin images URL.
 104          $this->css_url    = trailingslashit( $this->admin_url . 'css'           ); // Admin css URL.
 105          $this->js_url     = trailingslashit( $this->admin_url . 'js'            ); // Admin css URL.
 106  
 107          // Main settings page.
 108          $this->settings_page = bp_core_do_network_admin() ? 'settings.php' : 'options-general.php';
 109  
 110          // Main capability.
 111          $this->capability = bp_core_do_network_admin() ? 'manage_network_options' : 'manage_options';
 112      }
 113  
 114      /**
 115       * Include required files.
 116       *
 117       * @since 1.6.0
 118       */
 119  	private function includes() {
 120          require( $this->admin_dir . 'bp-core-admin-actions.php'    );
 121          require( $this->admin_dir . 'bp-core-admin-settings.php'   );
 122          require( $this->admin_dir . 'bp-core-admin-functions.php'  );
 123          require( $this->admin_dir . 'bp-core-admin-components.php' );
 124          require( $this->admin_dir . 'bp-core-admin-slugs.php'      );
 125          require( $this->admin_dir . 'bp-core-admin-tools.php'      );
 126      }
 127  
 128      /**
 129       * Set up the admin hooks, actions, and filters.
 130       *
 131       * @since 1.6.0
 132       *
 133       */
 134  	private function setup_actions() {
 135  
 136          /* General Actions ***************************************************/
 137  
 138          // Add some page specific output to the <head>.
 139          add_action( 'bp_admin_head',            array( $this, 'admin_head'  ), 999 );
 140  
 141          // Add menu item to settings menu.
 142          add_action( 'admin_menu',               array( $this, 'site_admin_menus' ), 5 );
 143          add_action( bp_core_admin_hook(),       array( $this, 'admin_menus' ), 5 );
 144  
 145          // Enqueue all admin JS and CSS.
 146          add_action( 'bp_admin_enqueue_scripts', array( $this, 'admin_register_styles' ), 1 );
 147          add_action( 'bp_admin_enqueue_scripts', array( $this, 'admin_register_scripts' ), 1 );
 148          add_action( 'bp_admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
 149  
 150          /* BuddyPress Actions ************************************************/
 151  
 152          // Load the BuddyPress metabox in the WP Nav Menu Admin UI.
 153          add_action( 'load-nav-menus.php', 'bp_admin_wp_nav_menu_meta_box' );
 154  
 155          // Add settings.
 156          add_action( 'bp_register_admin_settings', array( $this, 'register_admin_settings' ) );
 157  
 158          // Add a link to BuddyPress Hello in the admin bar.
 159          add_action( 'admin_bar_menu', array( $this, 'admin_bar_about_link' ), 100 );
 160  
 161          // Add a description of new BuddyPress tools in the available tools page.
 162          add_action( 'tool_box',            'bp_core_admin_available_tools_intro' );
 163          add_action( 'bp_network_tool_box', 'bp_core_admin_available_tools_intro' );
 164  
 165          // On non-multisite, catch.
 166          add_action( 'load-users.php', 'bp_core_admin_user_manage_spammers' );
 167  
 168          // Emails.
 169          add_filter( 'manage_' . bp_get_email_post_type() . '_posts_columns',       array( $this, 'emails_register_situation_column' ) );
 170          add_action( 'manage_' . bp_get_email_post_type() . '_posts_custom_column', array( $this, 'emails_display_situation_column_data' ), 10, 2 );
 171  
 172          // Privacy Policy.
 173          add_action( 'bp_admin_init', array( $this, 'add_privacy_policy_content' ) );
 174  
 175          // BuddyPress Hello.
 176          add_action( 'admin_footer', array( $this, 'about_screen' ) );
 177  
 178          // BuddyPress Types administration.
 179          add_action( 'load-edit-tags.php', array( 'BP_Admin_Types', 'register_types_admin' ) );
 180  
 181          /* Filters ***********************************************************/
 182  
 183          // Add link to settings page.
 184          add_filter( 'plugin_action_links',               array( $this, 'modify_plugin_action_links' ), 10, 2 );
 185          add_filter( 'network_admin_plugin_action_links', array( $this, 'modify_plugin_action_links' ), 10, 2 );
 186  
 187          // Add "Mark as Spam" row actions on users.php.
 188          add_filter( 'ms_user_row_actions', 'bp_core_admin_user_row_actions', 10, 2 );
 189          add_filter( 'user_row_actions',    'bp_core_admin_user_row_actions', 10, 2 );
 190  
 191          // Emails
 192          add_filter( 'bp_admin_menu_order', array( $this, 'emails_admin_menu_order' ), 20 );
 193      }
 194  
 195      /**
 196       * Register site- or network-admin nav menu elements.
 197       *
 198       * Contextually hooked to site or network-admin depending on current configuration.
 199       *
 200       * @since 1.6.0
 201       */
 202  	public function admin_menus() {
 203  
 204          // Bail if user cannot moderate.
 205          if ( ! bp_current_user_can( 'manage_options' ) ) {
 206              return;
 207          }
 208  
 209          $hooks = array();
 210  
 211          // Changed in BP 1.6 . See bp_core_admin_backpat_menu().
 212          $hooks[] = add_menu_page(
 213              __( 'BuddyPress', 'buddypress' ),
 214              __( 'BuddyPress', 'buddypress' ),
 215              $this->capability,
 216              'bp-general-settings',
 217              'bp_core_admin_backpat_menu',
 218              'div'
 219          );
 220  
 221          $hooks[] = add_submenu_page(
 222              'bp-general-settings',
 223              __( 'BuddyPress Help', 'buddypress' ),
 224              __( 'Help', 'buddypress' ),
 225              $this->capability,
 226              'bp-general-settings',
 227              'bp_core_admin_backpat_page'
 228          );
 229  
 230          // Add the option pages.
 231          $hooks[] = add_submenu_page(
 232              $this->settings_page,
 233              __( 'BuddyPress Components', 'buddypress' ),
 234              __( 'BuddyPress', 'buddypress' ),
 235              $this->capability,
 236              'bp-components',
 237              'bp_core_admin_components_settings'
 238          );
 239  
 240          $hooks[] = add_submenu_page(
 241              $this->settings_page,
 242              __( 'BuddyPress Pages', 'buddypress' ),
 243              __( 'BuddyPress Pages', 'buddypress' ),
 244              $this->capability,
 245              'bp-page-settings',
 246              'bp_core_admin_slugs_settings'
 247          );
 248  
 249          $hooks[] = add_submenu_page(
 250              $this->settings_page,
 251              __( 'BuddyPress Options', 'buddypress' ),
 252              __( 'BuddyPress Options', 'buddypress' ),
 253              $this->capability,
 254              'bp-settings',
 255              'bp_core_admin_settings'
 256          );
 257  
 258          // Credits.
 259          $hooks[] = add_submenu_page(
 260              $this->settings_page,
 261              __( 'BuddyPress Credits', 'buddypress' ),
 262              __( 'BuddyPress Credits', 'buddypress' ),
 263              $this->capability,
 264              'bp-credits',
 265              array( $this, 'credits_screen' )
 266          );
 267  
 268          // For consistency with non-Multisite, we add a Tools menu in
 269          // the Network Admin as a home for our Tools panel.
 270          if ( is_multisite() && bp_core_do_network_admin() ) {
 271              $tools_parent = 'network-tools';
 272  
 273              $hooks[] = add_menu_page(
 274                  __( 'Tools', 'buddypress' ),
 275                  __( 'Tools', 'buddypress' ),
 276                  $this->capability,
 277                  $tools_parent,
 278                  'bp_core_tools_top_level_item',
 279                  '',
 280                  24 // Just above Settings.
 281              );
 282  
 283              $hooks[] = add_submenu_page(
 284                  $tools_parent,
 285                  __( 'Available Tools', 'buddypress' ),
 286                  __( 'Available Tools', 'buddypress' ),
 287                  $this->capability,
 288                  'available-tools',
 289                  'bp_core_admin_available_tools_page'
 290              );
 291          } else {
 292              $tools_parent = 'tools.php';
 293          }
 294  
 295          $hooks[] = add_submenu_page(
 296              $tools_parent,
 297              __( 'BuddyPress Tools', 'buddypress' ),
 298              __( 'BuddyPress', 'buddypress' ),
 299              $this->capability,
 300              'bp-tools',
 301              'bp_core_admin_tools'
 302          );
 303  
 304          // For network-wide configs, add a link to (the root site's) Emails screen.
 305          if ( is_network_admin() && bp_is_network_activated() ) {
 306              $email_labels = bp_get_email_post_type_labels();
 307              $email_url    = get_admin_url( bp_get_root_blog_id(), 'edit.php?post_type=' . bp_get_email_post_type() );
 308  
 309              $hooks[] = add_menu_page(
 310                  $email_labels['name'],
 311                  $email_labels['menu_name'],
 312                  $this->capability,
 313                  '',
 314                  '',
 315                  'dashicons-email',
 316                  26
 317              );
 318  
 319              // Hack: change the link to point to the root site's admin, not the network admin.
 320              $GLOBALS['menu'][26][2] = esc_url_raw( $email_url );
 321          }
 322  
 323          foreach( $hooks as $hook ) {
 324              add_action( "admin_head-$hook", 'bp_core_modify_admin_menu_highlight' );
 325          }
 326      }
 327  
 328      /**
 329       * Register site-admin nav menu elements.
 330       *
 331       * @since 2.5.0
 332       */
 333  	public function site_admin_menus() {
 334          if ( ! bp_current_user_can( 'manage_options' ) ) {
 335              return;
 336          }
 337  
 338          $hooks = array();
 339  
 340          // Appearance > Emails.
 341          $hooks[] = add_theme_page(
 342              _x( 'Emails', 'screen heading', 'buddypress' ),
 343              _x( 'Emails', 'screen heading', 'buddypress' ),
 344              $this->capability,
 345              'bp-emails-customizer-redirect',
 346              'bp_email_redirect_to_customizer'
 347          );
 348  
 349          // Emails > Customize.
 350          $hooks[] = add_submenu_page(
 351              'edit.php?post_type=' . bp_get_email_post_type(),
 352              _x( 'Customize', 'email menu label', 'buddypress' ),
 353              _x( 'Customize', 'email menu label', 'buddypress' ),
 354              $this->capability,
 355              'bp-emails-customizer-redirect',
 356              'bp_email_redirect_to_customizer'
 357          );
 358  
 359          foreach( $hooks as $hook ) {
 360              add_action( "admin_head-$hook", 'bp_core_modify_admin_menu_highlight' );
 361          }
 362      }
 363  
 364      /**
 365       * Register the settings.
 366       *
 367       * @since 1.6.0
 368       *
 369       */
 370  	public function register_admin_settings() {
 371  
 372          /* Main Section ******************************************************/
 373  
 374          // Add the main section.
 375          add_settings_section( 'bp_main', __( 'Main Settings', 'buddypress' ), 'bp_admin_setting_callback_main_section', 'buddypress' );
 376  
 377          // Hide toolbar for logged out users setting.
 378          add_settings_field( 'hide-loggedout-adminbar', __( 'Toolbar', 'buddypress' ), 'bp_admin_setting_callback_admin_bar', 'buddypress', 'bp_main' );
 379          register_setting( 'buddypress', 'hide-loggedout-adminbar', 'intval' );
 380  
 381          // Only show 'switch to Toolbar' option if the user chose to retain the BuddyBar during the 1.6 upgrade.
 382          if ( (bool) bp_get_option( '_bp_force_buddybar', false ) ) {
 383              // Load deprecated code if not available.
 384              if ( ! function_exists( 'bp_admin_setting_callback_force_buddybar' ) ) {
 385                  require buddypress()->plugin_dir . 'bp-core/deprecated/2.1.php';
 386              }
 387  
 388              add_settings_field( '_bp_force_buddybar', __( 'Toolbar', 'buddypress' ), 'bp_admin_setting_callback_force_buddybar', 'buddypress', 'bp_main' );
 389              register_setting( 'buddypress', '_bp_force_buddybar', 'bp_admin_sanitize_callback_force_buddybar' );
 390          }
 391  
 392          // Allow account deletion.
 393          add_settings_field( 'bp-disable-account-deletion', __( 'Account Deletion', 'buddypress' ), 'bp_admin_setting_callback_account_deletion', 'buddypress', 'bp_main' );
 394          register_setting( 'buddypress', 'bp-disable-account-deletion', 'intval' );
 395  
 396          // Template pack picker.
 397          add_settings_field( '_bp_theme_package_id', __( 'Template Pack', 'buddypress' ), 'bp_admin_setting_callback_theme_package_id', 'buddypress', 'bp_main', array( 'label_for' => '_bp_theme_package_id' ) );
 398          register_setting( 'buddypress', '_bp_theme_package_id', 'sanitize_text_field' );
 399  
 400          /* Members Section  **************************************************/
 401  
 402          // Add the main section.
 403          add_settings_section( 'bp_members', _x( 'Members Settings', 'BuddyPress setting tab', 'buddypress' ), 'bp_admin_setting_callback_members_section', 'buddypress' );
 404  
 405          // Avatars.
 406          add_settings_field( 'bp-disable-avatar-uploads', __( 'Profile Photo Uploads', 'buddypress' ), 'bp_admin_setting_callback_avatar_uploads', 'buddypress', 'bp_members' );
 407          register_setting( 'buddypress', 'bp-disable-avatar-uploads', 'intval' );
 408  
 409          // Cover images.
 410          if ( bp_is_active( 'members', 'cover_image' ) ) {
 411              add_settings_field( 'bp-disable-cover-image-uploads', __( 'Cover Image Uploads', 'buddypress' ), 'bp_admin_setting_callback_cover_image_uploads', 'buddypress', 'bp_members' );
 412              register_setting( 'buddypress', 'bp-disable-cover-image-uploads', 'intval' );
 413          }
 414  
 415          /* XProfile Section **************************************************/
 416  
 417          if ( bp_is_active( 'xprofile' ) ) {
 418  
 419              // Add the main section.
 420              add_settings_section( 'bp_xprofile', _x( 'Profile Settings', 'BuddyPress setting tab', 'buddypress' ), 'bp_admin_setting_callback_xprofile_section', 'buddypress' );
 421  
 422              // Profile sync setting.
 423              add_settings_field( 'bp-disable-profile-sync',   __( 'Profile Syncing',  'buddypress' ), 'bp_admin_setting_callback_profile_sync', 'buddypress', 'bp_xprofile' );
 424              register_setting  ( 'buddypress', 'bp-disable-profile-sync', 'intval' );
 425          }
 426  
 427          /* Groups Section ****************************************************/
 428  
 429          if ( bp_is_active( 'groups' ) ) {
 430  
 431              // Add the main section.
 432              add_settings_section( 'bp_groups', __( 'Groups Settings',  'buddypress' ), 'bp_admin_setting_callback_groups_section', 'buddypress' );
 433  
 434              // Allow subscriptions setting.
 435              add_settings_field( 'bp_restrict_group_creation', __( 'Group Creation', 'buddypress' ), 'bp_admin_setting_callback_group_creation',   'buddypress', 'bp_groups' );
 436              register_setting( 'buddypress', 'bp_restrict_group_creation', 'intval' );
 437  
 438              // Allow group avatars.
 439              add_settings_field( 'bp-disable-group-avatar-uploads', __( 'Group Photo Uploads', 'buddypress' ), 'bp_admin_setting_callback_group_avatar_uploads', 'buddypress', 'bp_groups' );
 440              register_setting( 'buddypress', 'bp-disable-group-avatar-uploads', 'intval' );
 441  
 442              // Allow group cover images.
 443              if ( bp_is_active( 'groups', 'cover_image' ) ) {
 444                  add_settings_field( 'bp-disable-group-cover-image-uploads', __( 'Group Cover Image Uploads', 'buddypress' ), 'bp_admin_setting_callback_group_cover_image_uploads', 'buddypress', 'bp_groups' );
 445                  register_setting( 'buddypress', 'bp-disable-group-cover-image-uploads', 'intval' );
 446              }
 447          }
 448  
 449          /* Activity Section **************************************************/
 450  
 451          if ( bp_is_active( 'activity' ) ) {
 452  
 453              // Add the main section.
 454              add_settings_section( 'bp_activity', __( 'Activity Settings', 'buddypress' ), 'bp_admin_setting_callback_activity_section', 'buddypress' );
 455  
 456              // Activity commenting on post and comments.
 457              add_settings_field( 'bp-disable-blogforum-comments', __( 'Post Comments', 'buddypress' ), 'bp_admin_setting_callback_blogforum_comments', 'buddypress', 'bp_activity' );
 458              register_setting( 'buddypress', 'bp-disable-blogforum-comments', 'bp_admin_sanitize_callback_blogforum_comments' );
 459  
 460              // Activity Heartbeat refresh.
 461              add_settings_field( '_bp_enable_heartbeat_refresh', __( 'Activity auto-refresh', 'buddypress' ), 'bp_admin_setting_callback_heartbeat', 'buddypress', 'bp_activity' );
 462              register_setting( 'buddypress', '_bp_enable_heartbeat_refresh', 'intval' );
 463  
 464              // Allow activity akismet.
 465              if ( is_plugin_active( 'akismet/akismet.php' ) && defined( 'AKISMET_VERSION' ) ) {
 466                  add_settings_field( '_bp_enable_akismet', __( 'Akismet', 'buddypress' ), 'bp_admin_setting_callback_activity_akismet', 'buddypress', 'bp_activity' );
 467                  register_setting( 'buddypress', '_bp_enable_akismet', 'intval' );
 468              }
 469          }
 470      }
 471  
 472      /**
 473       * Add a link to BuddyPress Hello to the admin bar.
 474       *
 475       * @since 1.9.0
 476       * @since 3.0.0 Hooked at priority 100 (was 15).
 477       *
 478       * @param WP_Admin_Bar $wp_admin_bar
 479       */
 480  	public function admin_bar_about_link( $wp_admin_bar ) {
 481          if ( ! is_user_logged_in() ) {
 482              return;
 483          }
 484  
 485          $wp_admin_bar->add_node( array(
 486              'parent' => 'wp-logo',
 487              'id'     => 'bp-about',
 488              'title'  => esc_html_x( 'Hello, BuddyPress!', 'Colloquial alternative to "learn about BuddyPress"', 'buddypress' ),
 489              'href'   => bp_get_admin_url( '?hello=buddypress' ),
 490              'meta'   => array(
 491                  'class' => 'say-hello-buddypress',
 492              ),
 493          ) );
 494      }
 495  
 496      /**
 497       * Add Settings link to plugins area.
 498       *
 499       * @since 1.6.0
 500       *
 501       * @param array  $links Links array in which we would prepend our link.
 502       * @param string $file  Current plugin basename.
 503       * @return array Processed links.
 504       */
 505  	public function modify_plugin_action_links( $links, $file ) {
 506  
 507          // Return normal links if not BuddyPress.
 508          if ( plugin_basename( buddypress()->basename ) != $file ) {
 509              return $links;
 510          }
 511  
 512          // Add a few links to the existing links array.
 513          return array_merge( $links, array(
 514              'settings' => '<a href="' . esc_url( add_query_arg( array( 'page' => 'bp-components' ), bp_get_admin_url( $this->settings_page ) ) ) . '">' . esc_html__( 'Settings', 'buddypress' ) . '</a>',
 515              'about'    => '<a href="' . esc_url( bp_get_admin_url( '?hello=buddypress' ) ) . '">' . esc_html_x( 'Hello, BuddyPress!', 'Colloquial alternative to "learn about BuddyPress"', 'buddypress' ) . '</a>'
 516          ) );
 517      }
 518  
 519      /**
 520       * Add some general styling to the admin area.
 521       *
 522       * @since 1.6.0
 523       */
 524  	public function admin_head() {
 525  
 526          // Settings pages.
 527          remove_submenu_page( $this->settings_page, 'bp-page-settings' );
 528          remove_submenu_page( $this->settings_page, 'bp-settings'      );
 529          remove_submenu_page( $this->settings_page, 'bp-credits'       );
 530  
 531          // Network Admin Tools.
 532          remove_submenu_page( 'network-tools', 'network-tools' );
 533  
 534          // About and Credits pages.
 535          remove_submenu_page( 'index.php', 'bp-about'   );
 536          remove_submenu_page( 'index.php', 'bp-credits' );
 537      }
 538  
 539      /**
 540       * Add some general styling to the admin area.
 541       *
 542       * @since 1.6.0
 543       */
 544  	public function enqueue_scripts() {
 545          wp_enqueue_style( 'bp-admin-common-css' );
 546  
 547          // BuddyPress Hello.
 548          if ( 0 === strpos( get_current_screen()->id, 'dashboard' ) && ! empty( $_GET['hello'] ) && $_GET['hello'] === 'buddypress' ) {
 549              wp_enqueue_style( 'bp-hello-css' );
 550              wp_enqueue_script( 'bp-hello-js' );
 551              wp_localize_script( 'bp-hello-js', 'bpHelloStrings', array(
 552                  'pageNotFound' => __( 'Sorry, the page you requested was not found.', 'buddypress' ),
 553                  'modalLabel'   => __( 'Hello BuddyPress', 'buddypress' ),
 554              ) );
 555          }
 556      }
 557  
 558      /**
 559       * Registers BuddyPress's suggested privacy policy language.
 560       *
 561       * @since 4.0.0
 562       */
 563  	public function add_privacy_policy_content() {
 564          // Nothing to do if we're running < WP 4.9.6.
 565          if ( bp_is_running_wp( '4.9.6', '<' ) ) {
 566              return;
 567          }
 568  
 569          $suggested_text = '<strong class="privacy-policy-tutorial">' . esc_html__( 'Suggested text:', 'buddypress' ) . ' </strong>';
 570          $content = '';
 571  
 572          $content .= '<div class="wp-suggested-text">';
 573  
 574          $content .= '<h2>' . esc_html__( 'What personal data we collect and why we collect it', 'buddypress' ) . '</h2>';
 575          $content .= '<p class="privacy-policy-tutorial">' . esc_html__( 'Sites powered by BuddyPress rely heavily on user-provided data. In this section, you should note what data you collect, from both registered users and anonymous visitors.', 'buddypress' ) . '</p>';
 576  
 577          if ( bp_is_active( 'xprofile' ) ) {
 578              $content .= '<h3>' . esc_html__( 'Profile Data', 'buddypress' ) . '</h3>';
 579              $content .= '<p class="privacy-policy-tutorial">' . esc_html__( 'In this section you should note what information is collected on user profiles. The suggested text gives an overview of the kinds of profile data collected by BuddyPress.', 'buddypress' ) . '</p>';
 580  
 581              $content .= '<p>' . $suggested_text . esc_html__( 'When you register for the site, you may be asked to provide certain personal data for display on your profile. The "Name" field is required as well as public, and user profiles are visible to any site visitor. Other profile information may be required or optional, as configured by the site administrator.', 'buddypress' ) . '</p>';
 582              $content .= '<p>' . esc_html__( 'User information provided during account registration can be modified or removed on the Profile > Edit panel. In most cases, users also have control over who is able to view a particular piece of profile content, limiting visibility on a field-by-field basis to friends, logged-in users, or administrators only. Site administrators can read and edit all profile data for all users.', 'buddypress' ) . '</p>';
 583          }
 584  
 585          if ( bp_is_active( 'activity' ) ) {
 586              $content .= '<h3>' . esc_html__( 'Activity', 'buddypress' ) . '</h3>';
 587              $content .= '<p class="privacy-policy-tutorial">' . esc_html__( 'In this section you should describe the kinds of information collected in the activity stream, how and whether it can be edited or deleted, and to whom the activity is visible.', 'buddypress' ) . '</p>';
 588  
 589              $content .= '<p>' . $suggested_text . esc_html__( 'This site records certain user actions, in the form of "activity" data. Activity includes updates and comments posted directly to activity streams, as well as descriptions of other actions performed while using the site, such as new friendships, newly joined groups, and profile updates.', 'buddypress' ) . '</p>';
 590              $content .= '<p>' . esc_html__( 'The content of activity items obey the same privacy rules as the contexts in which the activity items are created. For example, activity updates created in a user\'s profile is publicly visible, while activity items generated in a private group are visible only to members of that group. Site administrators can view all activity items, regardless of context.', 'buddypress' ) . '</p>';
 591              $content .= '<p>' . esc_html__( 'Activity items may be deleted at any time by users who created them. Site administrators can edit all activity items.', 'buddypress' ) . '</p>';
 592          }
 593  
 594          if ( bp_is_active( 'messages' ) ) {
 595              $content .= '<h3>' . esc_html__( 'Messages', 'buddypress' ) . '</h3>';
 596              $content .= '<p class="privacy-policy-tutorial">' . esc_html__( 'In this section you should describe any personal data related to private messages.', 'buddypress' ) . '</p>';
 597  
 598              $content .= '<p>' . $suggested_text . esc_html__( 'The content of private messages is visible only to the sender and the recipients of the message. With the exception of site administrators, who can read all private messages, private message content is never visible to other users or site visitors. Site administrators may delete the content of any message.', 'buddypress' ) . '</p>';
 599          }
 600  
 601          $content .= '<h3>' . esc_html__( 'Cookies', 'buddypress' ) . '</h3>';
 602          $content .= '<p class="privacy-policy-tutorial">' . esc_html__( 'In this section you should describe the BuddyPress-specific cookies that your site collects. The suggested text describes the default cookies.', 'buddypress' ) . '</p>';
 603  
 604          $content .= '<p>' . $suggested_text . esc_html__( 'We use a cookie to show success and failure messages to logged-in users, in response to certain actions, like joining a group. These cookies contain no personal data, and are deleted immediately after the next page load.', 'buddypress' ) . '</p>';
 605  
 606          $content .= '<p>' . esc_html__( 'We use cookies on group, member, and activity directories to keep track of a user\'s browsing preferences. These preferences include the last-selected values of the sort and filter dropdowns, as well as pagination information. These cookies contain no personal data, and are deleted after 24 hours.', 'buddypress' ) . '</p>';
 607  
 608          if ( bp_is_active( 'groups' ) ) {
 609              $content .= '<p>' . esc_html__( 'When a logged-in user creates a new group, we use a number of cookies to keep track of the group creation process. These cookies contain no personal data, and are deleted either upon the successful creation of the group or after 24 hours.', 'buddypress' ) . '</p>';
 610          }
 611  
 612          $content .= '</div><!-- .wp-suggested-text -->';
 613  
 614          wp_add_privacy_policy_content(
 615              'BuddyPress',
 616              wp_kses_post( wpautop( $content, false ) )
 617          );
 618      }
 619  
 620      /** About *****************************************************************/
 621  
 622      /**
 623       * Output the BuddyPress Hello template.
 624       *
 625       * @since 1.7.0 Screen content.
 626       * @since 3.0.0 Now outputs BuddyPress Hello template.
 627       */
 628  	public function about_screen() {
 629          if ( 0 !== strpos( get_current_screen()->id, 'dashboard' ) || empty( $_GET['hello'] ) || $_GET['hello'] !== 'buddypress' ) {
 630              return;
 631          }
 632  
 633          // Get BuddyPress stable version.
 634          $version      =  self::display_version();
 635          $version_slug = 'version-' . str_replace( '.', '-', $version );
 636      ?>
 637  
 638          <div id="bp-hello-container">
 639              <div id="plugin-information-scrollable" role="document">
 640                  <div id='plugin-information-title' class="with-banner">
 641                      <div class='vignette'></div>
 642                      <h1>
 643                          <?php printf(
 644                              /* translators: %s is the placeholder for the BuddyPress version number. */
 645                              esc_html__( 'BuddyPress %s', 'buddypress' ),
 646                              $version
 647                          ); ?>
 648                      </h1>
 649                  </div>
 650                  <div id="plugin-information-tabs">
 651                      <a name="whats-new" href="#whats-new" class="current"><?php esc_html_e( 'What\'s new?', 'buddypress' ); ?></a>
 652                      <a name="changelog" href="#changelog" class="dynamic" data-slug="<?php echo esc_attr( $version_slug ); ?>" data-endpoint="https://codex.buddypress.org/wp-json/wp/v2/pages"><?php esc_html_e( 'Changelog', 'buddypress' ); ?></a>
 653                      <a name="get-involved" href="#get-involved" class="dynamic" data-slug="participate-and-contribute" data-endpoint="https://codex.buddypress.org/wp-json/wp/v2/pages"><?php esc_html_e( 'Get involved', 'buddypress' ); ?></a>
 654                  </div>
 655  
 656                  <div class="bp-hello-content">
 657                      <div id="dynamic-content"></div>
 658                      <div id="top-features">
 659                          <h2><?php esc_html_e( 'Manage Member Types and Group Types right from your WordPress Dashboard.', 'buddypress' ); ?></h2>
 660                          <figure class="bp-hello-aligncenter">
 661                              <img src="<?php echo esc_url( buddypress()->plugin_url . 'bp-core/images/bp-types-illustration.png' ); ?>" alt="<?php esc_attr_e( 'Illustration showing how to access to the BP Types Admin areas.', 'buddypress' ); ?>" />
 662                          </figure>
 663                          <p>
 664                              <?php esc_html_e( 'Playing with BP Types just became much easier! The Member Types and Group Types were primarily introduced in BuddyPress as features for advanced users, just like the WordPress Custom Post Type feature.', 'buddypress' ); ?>
 665                              <?php printf(
 666                                  /* translators: %s is the placeholder for the link to the BP Types Admin developer note. */
 667                                  esc_html__( 'Thanks to the two new %s, adding, editing and deleting Member & Group Types has never been so easy!', 'buddypress' ),
 668                                  sprintf(
 669                                      '<a href="%1$s">%2$s</a>',
 670                                      esc_url( 'https://bpdevel.wordpress.com/2020/09/21/bp-types-admin-ui/' ),
 671                                      esc_html__( 'WordPress Administration Screens', 'buddypress' )
 672                                  )
 673                              ); ?>
 674                              <?php esc_html_e( 'Now you can set up BP Types using custom code or by simply using the Administration interfaces.', 'buddypress' ); ?>
 675                          </p>
 676                          <h3><?php esc_html_e( 'Multiple Member Type assignment.', 'buddypress' ); ?></h3>
 677                          <p>
 678                              <?php printf(
 679                                  /* translators: %s is the placeholder for the link to the BP Types Admin developer note. */
 680                                  esc_html__( 'As we were pretty hot on the subject, we also improved Member Types assignment. You can now %s to users from their extended profile in the WordPress Dashboard.', 'buddypress' ),
 681                                  sprintf(
 682                                      '<a href="%1$s">%2$s</a>',
 683                                      esc_url( 'https://bpdevel.wordpress.com/2020/10/26/assigning-multiple-member-types-to-a-user/' ),
 684                                      esc_html__( 'add more than one member type', 'buddypress' )
 685                                  )
 686                              ); ?>
 687                          </p>
 688  
 689                          <hr class="bp-hello-divider"/>
 690  
 691                          <h2><?php esc_html_e( 'The BP Blocks category now includes 5 blocks!', 'buddypress' ); ?></h2>
 692                          <figure class="bp-hello-aligncenter">
 693                              <img src="<?php echo esc_url( buddypress()->plugin_url . 'bp-core/images/bp-new-blocks.png' ); ?>" alt="<?php esc_attr_e( 'Illustration showing the BuddyPress Blocks category inside the Block Editor Inserter.', 'buddypress' ); ?>" />
 694                          </figure>
 695                          <p>
 696                              <?php esc_html_e( '3 new BP Blocks are now available via your WordPress Editor.', 'buddypress' ); ?>
 697                              <?php esc_html_e( 'From the BuddyPress blocks category of the WordPress Block Inserter, you can pick a BP Block to feature a list of members, a list of groups or embed a public BuddyPress Activity into your post or page.', 'buddypress' ); ?>
 698                              <?php printf(
 699                                  /* translators: %s is the placeholder for the link to the BP Blocks developer note. */
 700                                  esc_html__( 'Read more about it in this %s.', 'buddypress' ),
 701                                  sprintf(
 702                                      '<a href="%1$s">%2$s</a>',
 703                                      esc_url( 'https://bpdevel.wordpress.com/2020/10/14/three-new-blocks-to-expect-in-buddypress-7-0-0/' ),
 704                                      esc_html__( 'development note', 'buddypress' )
 705                                  )
 706                              ); ?>
 707                          </p>
 708  
 709                          <hr class="bp-hello-divider"/>
 710  
 711                          <h2><?php esc_html_e( 'Get the best of the BP REST API improvements!', 'buddypress' ); ?></h2>
 712                          <figure class="bp-hello-alignright">
 713                              <div class="dashicons dashicons-rest-api big"></div>
 714                          </figure>
 715                          <p>
 716                              <?php printf(
 717                                  /* translators: %s is the placeholder for the link to the BP REST API documentation. */
 718                                  esc_html__( 'The %s has been updated according to the latest improvements we’ve brought to the BuddyPress REST API.', 'buddypress' ),
 719                                  sprintf(
 720                                      '<a href="%1$s">%2$s</a>',
 721                                      esc_url( 'https://developer.buddypress.org/bp-rest-api/' ),
 722                                      esc_html__( 'Developer documentation', 'buddypress' )
 723                                  )
 724                              ); ?>
 725                          </p>
 726                          <p>
 727                              <?php esc_html_e( 'To name two: get the groups the logged in user is a member of, and create a blog when BuddyPress is activated on a network of WordPress sites.', 'buddypress' ); ?>
 728                              <?php printf(
 729                                  /* translators: %s is the placeholder for the link to the BP REST API developer note. */
 730                                  esc_html__( 'Read this %s to learn about all the others.', 'buddypress' ),
 731                                  sprintf(
 732                                      '<a href="%1$s">%2$s</a>',
 733                                      esc_url( 'https://bpdevel.wordpress.com/2020/11/14/buddypress-rest-api-whats-new-in-7-0-0/' ),
 734                                      esc_html__( 'development note', 'buddypress' )
 735                                  )
 736                              ); ?>
 737                          </p>
 738  
 739                          <hr class="bp-hello-divider"/>
 740  
 741                          <h2><?php esc_html_e( 'BP Nouveau is ready for Twenty Twenty-One', 'buddypress' ); ?></h2>
 742                          <p>
 743                              <?php esc_html_e( 'You love the latest default WordPress Theme, so do we!', 'buddypress' ); ?>
 744                              <?php esc_html_e( 'It’s important for us to make sure the BP Nouveau template pack looks great in the default themes included in the WordPress package.', 'buddypress' ); ?>
 745                              <?php esc_html_e( 'This is the first of the many improvements we are bringing to our default Template Pack.', 'buddypress' ); ?>
 746                          </p>
 747                          <figure class="bp-hello-aligncenter">
 748                              <img src="<?php echo esc_url( buddypress()->plugin_url . 'bp-core/images/bp-nouveau-2021.png' ); ?>" alt="<?php esc_attr_e( 'Screenshot of the BuddyPress Members directory', 'buddypress' ); ?>" />
 749                          </figure>
 750  
 751                          <hr class="bp-hello-divider"/>
 752  
 753                          <h2><?php esc_html_e( 'Improved support for WP CLI.', 'buddypress' ); ?></h2>
 754                          <figure class="bp-hello-alignleft">
 755                              <div class="dashicons dashicons-arrow-right-alt2 big"></div>
 756                          </figure>
 757                          <p>
 758                              <?php esc_html_e( 'WP-CLI is the command-line interface for WordPress. You can update plugins, configure multisite installs, and much more, all without using a web browser.', 'buddypress' ); ?>
 759                              <?php esc_html_e( 'In 7.0.0, you will be able to use new BuddyPress CLI commands to manage BuddyPress Group Meta, BuddyPress Activity Meta, activate or deactivate the BuddyPress signup feature and create BuddyPress-specific testing code for plugins.', 'buddypress' ); ?>
 760                          </p>
 761                          <p>
 762                              <?php printf(
 763                                  /* translators: %s is the placeholder for the link to the WP BP CLI developer note. */
 764                                  esc_html__( 'Discover more about it from this %s.', 'buddypress' ),
 765                                  sprintf(
 766                                      '<a href="%1$s">%2$s</a>',
 767                                      esc_url( 'https://bpdevel.wordpress.com/2020/10/09/wp-cli-buddypress-2-0/' ),
 768                                      esc_html__( 'developer note', 'buddypress' )
 769                                  )
 770                              ); ?>
 771                          </p>
 772  
 773                          <hr class="bp-hello-divider"/>
 774  
 775                          <h2><?php esc_html_e( 'Under the hood', 'buddypress' ); ?></h2>
 776                          <p>
 777                              <?php esc_html_e( '7.0.0 includes more than 65 changes to improve your BuddyPress experience as users, and as contributors to our project; click on the “Changelog” tab to discover them all!', 'buddypress' ); ?>
 778                          </p>
 779                          <figure class="bp-hello-aligncenter">
 780                              <div class="dashicons dashicons-buddicons-buddypress-logo big"></div>
 781                          </figure>
 782  
 783                          <hr class="bp-hello-divider"/>
 784  
 785                          <h2><?php echo esc_html( _x( 'Your feedback', 'screen heading', 'buddypress' ) ); ?></h2>
 786                          <p>
 787                              <?php esc_html_e( 'How are you using BuddyPress? Receiving your feedback and suggestions for future versions of BuddyPress genuinely motivates and encourages our contributors.', 'buddypress' ); ?>
 788                              <?php
 789                              printf(
 790                                  /* translators: %s is the placeholder for the link to BuddyPress support forums. */
 791                                  esc_html__( 'Please %s about this version of BuddyPress on our website.', 'buddypress' ),
 792                                  sprintf(
 793                                      '<a href="%1$s">%2$s</a>',
 794                                      esc_url( 'https://buddypress.org/support/' ),
 795                                      esc_html__( 'share your feedback', 'buddypress' )
 796                                  )
 797                              );
 798                              ?>
 799                          </p>
 800                          <p><?php esc_html_e( 'Thank you for using BuddyPress! 😊', 'buddypress' ); ?></p>
 801  
 802                          <br /><br />
 803                      </div>
 804                  </div>
 805              </div>
 806              <div id="plugin-information-footer">
 807                  <div class="bp-hello-social-cta">
 808                      <p>
 809                          <?php
 810                          printf(
 811                              /* translators: 1: heart dashicons. 2: BP Credits screen url. 3: number of BuddyPress contributors to this version. */
 812                              _n( 'Built with %1$s by <a href="%2$s">%3$d volunteer</a>.', 'Built with %1$s by <a href="%2$s">%3$d volunteers</a>.', 37, 'buddypress' ),
 813                              '<span class="dashicons dashicons-heart"></span>',
 814                              esc_url( bp_get_admin_url( 'admin.php?page=bp-credits' ) ),
 815                              number_format_i18n( 37 )
 816                          );
 817                          ?>
 818                      </p>
 819                  </div>
 820  
 821                  <div class="bp-hello-social-links">
 822                      <ul class="bp-hello-social">
 823                          <li>
 824                              <?php
 825                              printf(
 826                                  '<a class="twitter bp-tooltip" data-bp-tooltip="%1$s" href="%2$s"><span class="screen-reader-text">%3$s</span></a>',
 827                                  esc_attr__( 'Follow BuddyPress on Twitter', 'buddypress' ),
 828                                  esc_url( 'https://twitter.com/buddypress' ),
 829                                  esc_html__( 'Follow BuddyPress on Twitter', 'buddypress' )
 830                              );
 831                              ?>
 832                          </li>
 833  
 834                          <li>
 835                              <?php
 836                              printf(
 837                                  '<a class="support bp-tooltip" data-bp-tooltip="%1$s" href="%2$s"><span class="screen-reader-text">%3$s</span></a>',
 838                                  esc_attr__( 'Visit the Support Forums', 'buddypress' ),
 839                                  esc_url( 'https://buddypress.org/support/' ),
 840                                  esc_html__( 'Visit the Support Forums', 'buddypress' )
 841                              );
 842                              ?>
 843                          </li>
 844                      </ul>
 845                  </div>
 846              </div>
 847          </div>
 848  
 849          <?php
 850      }
 851  
 852      /**
 853       * Output the credits screen.
 854       *
 855       * Hardcoding this in here is pretty janky. It's fine for now, but we'll
 856       * want to leverage api.wordpress.org eventually.
 857       *
 858       * @since 1.7.0
 859       */
 860  	public function credits_screen() {
 861      ?>
 862  
 863          <div class="wrap bp-about-wrap">
 864  
 865          <h1 class="wp-heading-inline"><?php esc_html_e( 'BuddyPress Settings', 'buddypress' ); ?></h1>
 866          <hr class="wp-header-end">
 867  
 868          <h2 class="nav-tab-wrapper"><?php bp_core_admin_tabs( esc_html__( 'Credits', 'buddypress' ) ); ?></h2>
 869  
 870              <p class="about-description"><?php esc_html_e( 'Meet the contributors behind BuddyPress:', 'buddypress' ); ?></p>
 871  
 872              <h3 class="wp-people-group"><?php esc_html_e( 'Project Leaders', 'buddypress' ); ?></h3>
 873              <ul class="wp-people-group " id="wp-people-group-project-leaders">
 874                  <li class="wp-person" id="wp-person-johnjamesjacoby">
 875                      <a class="web" href="https://profiles.wordpress.org/johnjamesjacoby"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/7a2644fb53ae2f7bfd7143b504af396c?s=120">
 876                      John James Jacoby</a>
 877                      <span class="title"><?php esc_html_e( 'Project Lead', 'buddypress' ); ?></span>
 878                  </li>
 879                  <li class="wp-person" id="wp-person-boonebgorges">
 880                      <a class="web" href="https://profiles.wordpress.org/boonebgorges"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/9cf7c4541a582729a5fc7ae484786c0c?s=120">
 881                      Boone B. Gorges</a>
 882                      <span class="title"><?php esc_html_e( 'Lead Developer', 'buddypress' ); ?></span>
 883                  </li>
 884                  <li class="wp-person" id="wp-person-djpaul">
 885                      <a class="web" href="https://profiles.wordpress.org/djpaul"><img alt="" class="gravatar" src="https://avatars2.githubusercontent.com/u/1275914?s=120">
 886                      Paul Gibbs</a>
 887                      <span class="title"><?php esc_html_e( 'Lead Developer', 'buddypress' ); ?></span>
 888                  </li>
 889                  <li class="wp-person" id="wp-person-r-a-y">
 890                      <a class="web" href="https://profiles.wordpress.org/r-a-y"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/3bfa556a62b5bfac1012b6ba5f42ebfa?s=120">
 891                      Ray</a>
 892                      <span class="title"><?php esc_html_e( 'Lead Developer', 'buddypress' ); ?></span>
 893                  </li>
 894                  <li class="wp-person" id="wp-person-imath">
 895                      <a class="web" href="https://profiles.wordpress.org/imath"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/8b208ca408dad63888253ee1800d6a03?s=120">
 896                      Mathieu Viet</a>
 897                      <span class="title"><?php esc_html_e( 'Lead Developer', 'buddypress' ); ?></span>
 898                  </li>
 899                  <li class="wp-person" id="wp-person-mercime">
 900                      <a class="web" href="https://profiles.wordpress.org/mercime"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/fae451be6708241627983570a1a1817a?s=120">
 901                      Mercime</a>
 902                      <span class="title"><?php esc_html_e( 'Lead Developer', 'buddypress' ); ?></span>
 903                  </li>
 904              </ul>
 905  
 906              <h3 class="wp-people-group"><?php esc_html_e( 'BuddyPress Team', 'buddypress' ); ?></h3>
 907              <ul class="wp-people-group " id="wp-people-group-core-team">
 908                  <li class="wp-person" id="wp-person-hnla">
 909                      <a class="web" href="https://profiles.wordpress.org/hnla"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/3860c955aa3f79f13b92826ae47d07fe?s=120">
 910                      Hugo Ashmore</a>
 911                      <span class="title"><?php esc_html_e( 'Core Developer', 'buddypress' ); ?></span>
 912                  </li>
 913                  <li class="wp-person" id="wp-person-dcavins">
 914                      <a class="web" href="https://profiles.wordpress.org/dcavins"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/a5fa7e83d59cb45ebb616235a176595a?s=120">
 915                      David Cavins</a>
 916                      <span class="title"><?php esc_html_e( 'Core Developer', 'buddypress' ); ?></span>
 917                  </li>
 918                  <li class="wp-person" id="wp-person-tw2113">
 919                      <a class="web" href="https://profiles.wordpress.org/tw2113"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/a5d7c934621fa1c025b83ee79bc62366?s=120">
 920                      Michael Beckwith</a>
 921                      <span class="title"><?php esc_html_e( 'Core Developer', 'buddypress' ); ?></span>
 922                  </li>
 923                  <li class="wp-person" id="wp-person-henry-wright">
 924                      <a class="web" href="https://profiles.wordpress.org/henry.wright"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/0da2f1a9340d6af196b870f6c107a248?s=120">
 925                      Henry Wright</a>
 926                      <span class="title"><?php esc_html_e( 'Community Support', 'buddypress' ); ?></span>
 927                  </li>
 928                  <li class="wp-person" id="wp-person-danbp">
 929                      <a class="web" href="https://profiles.wordpress.org/danbp"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/0deae2e7003027fbf153500cd3fa5501?s=120">
 930                      danbp</a>
 931                      <span class="title"><?php esc_html_e( 'Community Support', 'buddypress' ); ?></span>
 932                  </li>
 933                  <li class="wp-person" id="wp-person-shanebp">
 934                      <a class="web" href="https://profiles.wordpress.org/shanebp"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/ffd294ab5833ba14aaf175f9acc71cc4?s=120">
 935                      shanebp</a>
 936                      <span class="title"><?php esc_html_e( 'Community Support', 'buddypress' ); ?></span>
 937                  </li>
 938                  <li class="wp-person" id="wp-person-slaffik">
 939                      <a class="web" href="https://profiles.wordpress.org/r-a-y"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/61fb07ede3247b63f19015f200b3eb2c?s=120">
 940                      Slava Abakumov</a>
 941                      <span class="title"><?php esc_html_e( 'Core Developer', 'buddypress' ); ?></span>
 942                  </li>
 943                  <li class="wp-person" id="wp-person-offereins">
 944                      <a class="web" href="https://profiles.wordpress.org/Offereins"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/2404ed0a35bb41aedefd42b0a7be61c1?s=120">
 945                      Laurens Offereins</a>
 946                      <span class="title"><?php esc_html_e( 'Core Developer', 'buddypress' ); ?></span>
 947                  </li>
 948                  <li class="wp-person" id="wp-person-netweb">
 949                      <a class="web" href="https://profiles.wordpress.org/netweb"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/97e1620b501da675315ba7cfb740e80f?s=120">
 950                      Stephen Edgar</a>
 951                      <span class="title"><?php esc_html_e( 'Core Developer', 'buddypress' ); ?></span>
 952                  </li>
 953                  <li class="wp-person" id="wp-person-espellcaste">
 954                      <a class="web" href="https://profiles.wordpress.org/espellcaste"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/b691e67be0ba5cad6373770656686bc3?s=120">
 955                      Renato Alves</a>
 956                      <span class="title"><?php esc_html_e( 'Core Developer', 'buddypress' ); ?></span>
 957                  </li>
 958                  <li class="wp-person" id="wp-person-venutius">
 959                      <a class="web" href="https://profiles.wordpress.org/venutius"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/6a7c42a77fd94b82b217a7a97afdddbc?s=120">
 960                      Venutius</a>
 961                      <span class="title"><?php esc_html_e( 'Community Support', 'buddypress' ); ?></span>
 962                  </li>
 963              </ul>
 964  
 965              <h3 class="wp-people-group">
 966                  <?php
 967                  printf(
 968                      /* translators: %s: BuddyPress version number */
 969                      esc_html__( 'Noteworthy Contributors to %s', 'buddypress' ),
 970                      self::display_version()
 971                  );
 972                  ?>
 973              </h3>
 974              <ul class="wp-people-group " id="wp-people-group-noteworthy">
 975                  <li class="wp-person" id="wp-person-oztaser">
 976                      <a class="web" href="https://profiles.wordpress.org/oztaser/"><img alt="" class="gravatar" src="//gravatar.com/avatar/06eb4dd13c0113bf826968ae16a13e52?s=120">
 977                      Adil Oztaser</a>
 978                  </li>
 979                  <li class="wp-person" id="wp-person-iamthewebb">
 980                      <a class="web" href="https://profiles.wordpress.org/iamthewebb/"><img alt="" class="gravatar" src="//gravatar.com/avatar/990bac871caf6d6e179b2753226d8f4a?s=120&d=mm">
 981                      IAmTheWebb</a>
 982                  </li>
 983                  <li class="wp-person" id="wp-person-vapvarun">
 984                      <a class="web" href="https://profiles.wordpress.org/vapvarun"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/78a3bf7eb3a1132fc667f96f2631e448?s=120">
 985                      Varun Dubey</a>
 986                  </li>
 987              </ul>
 988  
 989              <h3 class="wp-people-group">
 990                  <?php
 991                  printf(
 992                      /* translators: %s: BuddyPress version number */
 993                      esc_html__( 'All Contributors to BuddyPress %s', 'buddypress' ),
 994                      self::display_version()
 995                  );
 996                  ?>
 997              </h3>
 998              <p class="wp-credits-list">
 999                  <a href="https://profiles.wordpress.org/oztaser/">Adil Oztaser (oztaser)</a>,
1000                  <a href="https://profiles.wordpress.org/boonebgorges/">Boone B Gorges (boonebgorges)</a>,
1001                  <a href="https://profiles.wordpress.org/corsky/">corsky</a>,
1002                  <a href="https://profiles.wordpress.org/sbrajesh/">Brajesh Singh (sbrajesh)</a>,
1003                  <a href="https://profiles.wordpress.org/dcavins/">David Cavins (dcavins)</a>,
1004                  <a href="https://profiles.wordpress.org/devnik/">devnik</a>,
1005                  <a href="https://profiles.wordpress.org/dilipbheda/">Dilip Bheda</a>,
1006                  <a href="https://profiles.wordpress.org/dd32/">Dion Hulse (dd32)</a>,
1007                  <a href="https://profiles.wordpress.org/dragoeco/">dragoeco</a>,
1008                  <a href="https://profiles.wordpress.org/etatus/">etatus</a>,
1009                  <a href="https://github.com/ExoGeek/">Didier Saintes (ExoGeek)</a>,
1010                  <a href="https://profiles.wordpress.org/mamaduka/">George Mamadashvili</a>,
1011                  <a href="https://profiles.wordpress.org/hareesh-pillai/">Hareesh</a>,
1012                  <a href="https://profiles.wordpress.org/johnjamesjacoby/">John James Jacoby (johnjamesjacoby)</a>,
1013                  <a href="https://profiles.wordpress.org/k3690/">k3690</a>,
1014                  <a href="https://profiles.wordpress.org/laxman-prajapati/">Laxman Prajapati</a>,
1015                  <a href="https://profiles.wordpress.org/iamthewebb/">iamthewebb</a>,
1016                  <a href="https://github.com/geckse/">Marcel Claus (geckse)</a>,
1017                  <a href="https://profiles.wordpress.org/marioshtika/">marioshtika</a>
1018                  <a href="https://profiles.wordpress.org/imath/">Mathieu Viet (imath)</a>,
1019                  <a href="https://profiles.wordpress.org/mercime/">mercime</a>,
1020                  <a href="https://profiles.wordpress.org/immeet94/">Meet Makadia</a>,
1021                  <a href="https://profiles.wordpress.org/tw2113/">Michael Beckwith</a>,
1022                  <a href="https://profiles.wordpress.org/man4toman/">Morteza Geransayeh (man4toman)</a>,
1023                  <a href="https://profiles.wordpress.org/n33d/">N33D</a>,
1024                  <a href="https://profiles.wordpress.org/oddev56/">oddev56</a>,
1025                  <a href="https://profiles.wordpress.org/DJPaul/">Paul Gibbs (DJPaul)</a>,
1026                  <a href="https://profiles.wordpress.org/r-a-y/">r-a-y</a>,
1027                  <a href="https://profiles.wordpress.org/espellcaste/">Renato Alves (espellcaste)</a>,
1028                  <a href="https://profiles.wordpress.org/scipi/">scipi</a>,
1029                  <a href="https://profiles.wordpress.org/scottopolis/">Scott Bolinger (scottopolis)</a>,
1030                  <a href="https://profiles.wordpress.org/shanebp/">shanebp</a>,
1031                  <a href="https://profiles.wordpress.org/shawfactor/">shawfactor</a>,
1032                  <a href="https://profiles.wordpress.org/sjregan/">sjregan</a>,
1033                  <a href="https://profiles.wordpress.org/netweb/">Stephen Edgar (netweb)</a>,
1034                  <a href="https://profiles.wordpress.org/tharsheblows/">tharsheblows</a>,
1035                  <a href="https://profiles.wordpress.org/vapvarun/">Varun Dubey (vapvarun)</a>.
1036              </p>
1037  
1038              <h3 class="wp-people-group"><?php esc_html_e( 'With our thanks to these Open Source projects', 'buddypress' ); ?></h3>
1039              <p class="wp-credits-list">
1040                  <a href="https://github.com/ichord/At.js">At.js</a>,
1041                  <a href="https://bbpress.org">bbPress</a>,
1042                  <a href="https://github.com/ichord/Caret.js">Caret.js</a>,
1043                  <a href="https://tedgoas.github.io/Cerberus/">Cerberus</a>,
1044                  <a href="https://ionicons.com/">Ionicons</a>,
1045                  <a href="https://github.com/carhartl/jquery-cookie">jquery.cookie</a>,
1046                  <a href="https://mattbradley.github.io/livestampjs/">Livestamp.js</a>,
1047                  <a href="https://www.mediawiki.org/wiki/MediaWiki">MediaWiki</a>,
1048                  <a href="https://momentjs.com/">Moment.js</a>,
1049                  <a href="https://wordpress.org">WordPress</a>.
1050              </p>
1051  
1052              <h3 class="wp-people-group"><?php esc_html_e( 'Contributor Emeriti', 'buddypress' ); ?></h3>
1053              <ul class="wp-people-group " id="wp-people-group-emeriti">
1054                  <li class="wp-person" id="wp-person-apeatling">
1055                      <a class="web" href="https://profiles.wordpress.org/johnjamesjacoby"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/bb29d699b5cba218c313b61aa82249da?s=120">
1056                      Andy Peatling</a>
1057                      <span class="title"><?php esc_html_e( 'Project Founder', 'buddypress' ); ?></span>
1058                  </li>
1059                  <li class="wp-person" id="wp-person-burtadsit">
1060                      <a class="web" href="https://profiles.wordpress.org/burtadsit"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/185e1d3e2d653af9d49a4e8e4fc379df?s=120">
1061                      Burt Adsit</a>
1062                  </li>
1063                  <li class="wp-person" id="wp-person-dimensionmedia">
1064                      <a class="web" href="https://profiles.wordpress.org/dimensionmedia"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/7735aada1ec39d0c1118bd92ed4551f1?s=120">
1065                      David Bisset</a>
1066                  </li>
1067                  <li class="wp-person" id="wp-person-jeffsayre">
1068                      <a class="web" href="https://profiles.wordpress.org/jeffsayre"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/8e009a84ff5d245c22a69c7df6ab45f7?s=120">
1069                      Jeff Sayre</a>
1070                  </li>
1071                  <li class="wp-person" id="wp-person-karmatosed">
1072                      <a class="web" href="https://profiles.wordpress.org/karmatosed"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/ca7d4273a689cdbf524d8332771bb1ca?s=120">
1073                      Tammie Lister</a>
1074                  </li>
1075                  <li class="wp-person" id="wp-person-modemlooper">
1076                      <a class="web" href="https://profiles.wordpress.org/modemlooper"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/1c07be1016e845de514931477c939307?s=120">
1077                      modemlooper</a>
1078                  </li>
1079              </ul>
1080          </div>
1081  
1082          <?php
1083      }
1084  
1085      /** Emails ****************************************************************/
1086  
1087      /**
1088       * Registers 'Situations' column on Emails dashboard page.
1089       *
1090       * @since 2.6.0
1091       *
1092       * @param array $columns Current column data.
1093       * @return array
1094       */
1095  	public function emails_register_situation_column( $columns = array() ) {
1096          $situation = array(
1097              'situation' => _x( 'Situations', 'Email post type', 'buddypress' )
1098          );
1099  
1100          // Inject our 'Situations' column just before the last 'Date' column.
1101          return array_slice( $columns, 0, -1, true ) + $situation + array_slice( $columns, -1, null, true );
1102      }
1103  
1104      /**
1105       * Output column data for our custom 'Situations' column.
1106       *
1107       * @since 2.6.0
1108       *
1109       * @param string $column  Current column name.
1110       * @param int    $post_id Current post ID.
1111       */
1112  	public function emails_display_situation_column_data( $column = '', $post_id = 0 ) {
1113          if ( 'situation' !== $column ) {
1114              return;
1115          }
1116  
1117          // Grab email situations for the current post.
1118          $situations = wp_list_pluck( get_the_terms( $post_id, bp_get_email_tax_type() ), 'description' );
1119  
1120          // Output each situation as a list item.
1121          echo '<ul><li>';
1122          echo implode( '</li><li>', $situations );
1123          echo '</li></ul>';
1124      }
1125  
1126      /** Helpers ***************************************************************/
1127  
1128      /**
1129       * Return true/false based on whether a query argument is set.
1130       *
1131       * @see bp_do_activation_redirect()
1132       *
1133       * @since 2.2.0
1134       *
1135       * @return bool
1136       */
1137  	public static function is_new_install() {
1138          return (bool) isset( $_GET['is_new_install'] );
1139      }
1140  
1141      /**
1142       * Return a user-friendly version-number string, for use in translations.
1143       *
1144       * @since 2.2.0
1145       *
1146       * @return string
1147       */
1148  	public static function display_version() {
1149  
1150          // Use static variable to prevent recalculations.
1151          static $display = '';
1152  
1153          // Only calculate on first run.
1154          if ( '' === $display ) {
1155  
1156              // Get current version.
1157              $version = bp_get_version();
1158  
1159              // Check for prerelease hyphen.
1160              $pre     = strpos( $version, '-' );
1161  
1162              // Strip prerelease suffix.
1163              $display = ( false !== $pre )
1164                  ? substr( $version, 0, $pre )
1165                  : $version;
1166          }
1167  
1168          // Done!
1169          return $display;
1170      }
1171  
1172      /**
1173       * Add Emails menu item to custom menus array.
1174       *
1175       * Several BuddyPress components have top-level menu items in the Dashboard,
1176       * which all appear together in the middle of the Dashboard menu. This function
1177       * adds the Emails screen to the array of these menu items.
1178       *
1179       * @since 2.4.0
1180       *
1181       * @param array $custom_menus The list of top-level BP menu items.
1182       * @return array $custom_menus List of top-level BP menu items, with Emails added.
1183       */
1184  	public function emails_admin_menu_order( $custom_menus = array() ) {
1185          array_push( $custom_menus, 'edit.php?post_type=' . bp_get_email_post_type() );
1186  
1187          if ( is_network_admin() && bp_is_network_activated() ) {
1188              array_push(
1189                  $custom_menus,
1190                  get_admin_url( bp_get_root_blog_id(), 'edit.php?post_type=' . bp_get_email_post_type() )
1191              );
1192          }
1193  
1194          return $custom_menus;
1195      }
1196  
1197      /**
1198       * Register styles commonly used by BuddyPress wp-admin screens.
1199       *
1200       * @since 2.5.0
1201       */
1202  	public function admin_register_styles() {
1203          $min = bp_core_get_minified_asset_suffix();
1204          $url = $this->css_url;
1205  
1206          /**
1207           * Filters the BuddyPress Core Admin CSS file path.
1208           *
1209           * @since 1.6.0
1210           *
1211           * @param string $file File path for the admin CSS.
1212           */
1213          $common_css = apply_filters( 'bp_core_admin_common_css', "{$url}common{$min}.css" );
1214  
1215          /**
1216           * Filters the BuddyPress admin stylesheet files to register.
1217           *
1218           * @since 2.5.0
1219           *
1220           * @param array $value Array of admin stylesheet file information to register.
1221           */
1222          $styles = apply_filters( 'bp_core_admin_register_styles', array(
1223              // Legacy.
1224              'bp-admin-common-css' => array(
1225                  'file'         => $common_css,
1226                  'dependencies' => array(),
1227              ),
1228  
1229              // 2.5
1230              'bp-customizer-controls' => array(
1231                  'file'         => "{$url}customizer-controls{$min}.css",
1232                  'dependencies' => array(),
1233              ),
1234  
1235              // 3.0
1236              'bp-hello-css' => array(
1237                  'file'         => "{$url}hello{$min}.css",
1238                  'dependencies' => array( 'bp-admin-common-css', 'thickbox' ),
1239              ),
1240          ) );
1241  
1242          $version = bp_get_version();
1243  
1244          foreach ( $styles as $id => $style ) {
1245              wp_register_style( $id, $style['file'], $style['dependencies'], $version );
1246              wp_style_add_data( $id, 'rtl', 'replace' );
1247  
1248              if ( $min ) {
1249                  wp_style_add_data( $id, 'suffix', $min );
1250              }
1251          }
1252      }
1253  
1254      /**
1255       * Register JS commonly used by BuddyPress wp-admin screens.
1256       *
1257       * @since 2.5.0
1258       */
1259  	public function admin_register_scripts() {
1260          $min = bp_core_get_minified_asset_suffix();
1261          $url = $this->js_url;
1262  
1263          /**
1264           * Filters the BuddyPress admin JS files to register.
1265           *
1266           * @since 2.5.0
1267           *
1268           * @param array $value Array of admin JS file information to register.
1269           */
1270          $scripts = apply_filters( 'bp_core_admin_register_scripts', array(
1271              // 2.5
1272              'bp-customizer-controls' => array(
1273                  'file'         => "{$url}customizer-controls{$min}.js",
1274                  'dependencies' => array( 'jquery' ),
1275                  'footer'       => true,
1276              ),
1277  
1278              // 3.0
1279              'bp-hello-js' => array(
1280                  'file'         => "{$url}hello{$min}.js",
1281                  'dependencies' => array( 'thickbox', 'bp-api-request' ),
1282                  'footer'       => true,
1283              ),
1284          ) );
1285  
1286          $version = bp_get_version();
1287  
1288          foreach ( $scripts as $id => $script ) {
1289              wp_register_script( $id, $script['file'], $script['dependencies'], $version, $script['footer'] );
1290          }
1291      }
1292  }
1293  endif; // End class_exists check.


Generated: Sat Nov 28 01:01:39 2020 Cross-referenced by PHPXref 0.7.1