[ 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          /* Filters ***********************************************************/
 179  
 180          // Add link to settings page.
 181          add_filter( 'plugin_action_links',               array( $this, 'modify_plugin_action_links' ), 10, 2 );
 182          add_filter( 'network_admin_plugin_action_links', array( $this, 'modify_plugin_action_links' ), 10, 2 );
 183  
 184          // Add "Mark as Spam" row actions on users.php.
 185          add_filter( 'ms_user_row_actions', 'bp_core_admin_user_row_actions', 10, 2 );
 186          add_filter( 'user_row_actions',    'bp_core_admin_user_row_actions', 10, 2 );
 187  
 188          // Emails
 189          add_filter( 'bp_admin_menu_order', array( $this, 'emails_admin_menu_order' ), 20 );
 190      }
 191  
 192      /**
 193       * Register site- or network-admin nav menu elements.
 194       *
 195       * Contextually hooked to site or network-admin depending on current configuration.
 196       *
 197       * @since 1.6.0
 198       */
 199  	public function admin_menus() {
 200  
 201          // Bail if user cannot moderate.
 202          if ( ! bp_current_user_can( 'manage_options' ) ) {
 203              return;
 204          }
 205  
 206          $hooks = array();
 207  
 208          // Changed in BP 1.6 . See bp_core_admin_backpat_menu().
 209          $hooks[] = add_menu_page(
 210              __( 'BuddyPress', 'buddypress' ),
 211              __( 'BuddyPress', 'buddypress' ),
 212              $this->capability,
 213              'bp-general-settings',
 214              'bp_core_admin_backpat_menu',
 215              'div'
 216          );
 217  
 218          $hooks[] = add_submenu_page(
 219              'bp-general-settings',
 220              __( 'BuddyPress Help', 'buddypress' ),
 221              __( 'Help', 'buddypress' ),
 222              $this->capability,
 223              'bp-general-settings',
 224              'bp_core_admin_backpat_page'
 225          );
 226  
 227          // Add the option pages.
 228          $hooks[] = add_submenu_page(
 229              $this->settings_page,
 230              __( 'BuddyPress Components', 'buddypress' ),
 231              __( 'BuddyPress', 'buddypress' ),
 232              $this->capability,
 233              'bp-components',
 234              'bp_core_admin_components_settings'
 235          );
 236  
 237          $hooks[] = add_submenu_page(
 238              $this->settings_page,
 239              __( 'BuddyPress Pages', 'buddypress' ),
 240              __( 'BuddyPress Pages', 'buddypress' ),
 241              $this->capability,
 242              'bp-page-settings',
 243              'bp_core_admin_slugs_settings'
 244          );
 245  
 246          $hooks[] = add_submenu_page(
 247              $this->settings_page,
 248              __( 'BuddyPress Options', 'buddypress' ),
 249              __( 'BuddyPress Options', 'buddypress' ),
 250              $this->capability,
 251              'bp-settings',
 252              'bp_core_admin_settings'
 253          );
 254  
 255          // Credits.
 256          $hooks[] = add_submenu_page(
 257              $this->settings_page,
 258              __( 'BuddyPress Credits', 'buddypress' ),
 259              __( 'BuddyPress Credits', 'buddypress' ),
 260              $this->capability,
 261              'bp-credits',
 262              array( $this, 'credits_screen' )
 263          );
 264  
 265          // For consistency with non-Multisite, we add a Tools menu in
 266          // the Network Admin as a home for our Tools panel.
 267          if ( is_multisite() && bp_core_do_network_admin() ) {
 268              $tools_parent = 'network-tools';
 269  
 270              $hooks[] = add_menu_page(
 271                  __( 'Tools', 'buddypress' ),
 272                  __( 'Tools', 'buddypress' ),
 273                  $this->capability,
 274                  $tools_parent,
 275                  'bp_core_tools_top_level_item',
 276                  '',
 277                  24 // Just above Settings.
 278              );
 279  
 280              $hooks[] = add_submenu_page(
 281                  $tools_parent,
 282                  __( 'Available Tools', 'buddypress' ),
 283                  __( 'Available Tools', 'buddypress' ),
 284                  $this->capability,
 285                  'available-tools',
 286                  'bp_core_admin_available_tools_page'
 287              );
 288          } else {
 289              $tools_parent = 'tools.php';
 290          }
 291  
 292          $hooks[] = add_submenu_page(
 293              $tools_parent,
 294              __( 'BuddyPress Tools', 'buddypress' ),
 295              __( 'BuddyPress', 'buddypress' ),
 296              $this->capability,
 297              'bp-tools',
 298              'bp_core_admin_tools'
 299          );
 300  
 301          // For network-wide configs, add a link to (the root site's) Emails screen.
 302          if ( is_network_admin() && bp_is_network_activated() ) {
 303              $email_labels = bp_get_email_post_type_labels();
 304              $email_url    = get_admin_url( bp_get_root_blog_id(), 'edit.php?post_type=' . bp_get_email_post_type() );
 305  
 306              $hooks[] = add_menu_page(
 307                  $email_labels['name'],
 308                  $email_labels['menu_name'],
 309                  $this->capability,
 310                  '',
 311                  '',
 312                  'dashicons-email',
 313                  26
 314              );
 315  
 316              // Hack: change the link to point to the root site's admin, not the network admin.
 317              $GLOBALS['menu'][26][2] = esc_url_raw( $email_url );
 318          }
 319  
 320          foreach( $hooks as $hook ) {
 321              add_action( "admin_head-$hook", 'bp_core_modify_admin_menu_highlight' );
 322          }
 323      }
 324  
 325      /**
 326       * Register site-admin nav menu elements.
 327       *
 328       * @since 2.5.0
 329       */
 330  	public function site_admin_menus() {
 331          if ( ! bp_current_user_can( 'manage_options' ) ) {
 332              return;
 333          }
 334  
 335          $hooks = array();
 336  
 337          // Appearance > Emails.
 338          $hooks[] = add_theme_page(
 339              _x( 'Emails', 'screen heading', 'buddypress' ),
 340              _x( 'Emails', 'screen heading', 'buddypress' ),
 341              $this->capability,
 342              'bp-emails-customizer-redirect',
 343              'bp_email_redirect_to_customizer'
 344          );
 345  
 346          // Emails > Customize.
 347          $hooks[] = add_submenu_page(
 348              'edit.php?post_type=' . bp_get_email_post_type(),
 349              _x( 'Customize', 'email menu label', 'buddypress' ),
 350              _x( 'Customize', 'email menu label', 'buddypress' ),
 351              $this->capability,
 352              'bp-emails-customizer-redirect',
 353              'bp_email_redirect_to_customizer'
 354          );
 355  
 356          foreach( $hooks as $hook ) {
 357              add_action( "admin_head-$hook", 'bp_core_modify_admin_menu_highlight' );
 358          }
 359      }
 360  
 361      /**
 362       * Register the settings.
 363       *
 364       * @since 1.6.0
 365       *
 366       */
 367  	public function register_admin_settings() {
 368  
 369          /* Main Section ******************************************************/
 370  
 371          // Add the main section.
 372          add_settings_section( 'bp_main', __( 'Main Settings', 'buddypress' ), 'bp_admin_setting_callback_main_section', 'buddypress' );
 373  
 374          // Hide toolbar for logged out users setting.
 375          add_settings_field( 'hide-loggedout-adminbar', __( 'Toolbar', 'buddypress' ), 'bp_admin_setting_callback_admin_bar', 'buddypress', 'bp_main' );
 376          register_setting( 'buddypress', 'hide-loggedout-adminbar', 'intval' );
 377  
 378          // Only show 'switch to Toolbar' option if the user chose to retain the BuddyBar during the 1.6 upgrade.
 379          if ( (bool) bp_get_option( '_bp_force_buddybar', false ) ) {
 380              // Load deprecated code if not available.
 381              if ( ! function_exists( 'bp_admin_setting_callback_force_buddybar' ) ) {
 382                  require buddypress()->plugin_dir . 'bp-core/deprecated/2.1.php';
 383              }
 384  
 385              add_settings_field( '_bp_force_buddybar', __( 'Toolbar', 'buddypress' ), 'bp_admin_setting_callback_force_buddybar', 'buddypress', 'bp_main' );
 386              register_setting( 'buddypress', '_bp_force_buddybar', 'bp_admin_sanitize_callback_force_buddybar' );
 387          }
 388  
 389          // Allow account deletion.
 390          add_settings_field( 'bp-disable-account-deletion', __( 'Account Deletion', 'buddypress' ), 'bp_admin_setting_callback_account_deletion', 'buddypress', 'bp_main' );
 391          register_setting( 'buddypress', 'bp-disable-account-deletion', 'intval' );
 392  
 393          // Template pack picker.
 394          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' ) );
 395          register_setting( 'buddypress', '_bp_theme_package_id', 'sanitize_text_field' );
 396  
 397          /* XProfile Section **************************************************/
 398  
 399          if ( bp_is_active( 'xprofile' ) ) {
 400  
 401              // Add the main section.
 402              add_settings_section( 'bp_xprofile', _x( 'Profile Settings', 'BuddyPress setting tab', 'buddypress' ), 'bp_admin_setting_callback_xprofile_section', 'buddypress' );
 403  
 404              // Avatars.
 405              add_settings_field( 'bp-disable-avatar-uploads', __( 'Profile Photo Uploads', 'buddypress' ), 'bp_admin_setting_callback_avatar_uploads', 'buddypress', 'bp_xprofile' );
 406              register_setting( 'buddypress', 'bp-disable-avatar-uploads', 'intval' );
 407  
 408              // Cover images.
 409              if ( bp_is_active( 'xprofile', 'cover_image' ) ) {
 410                  add_settings_field( 'bp-disable-cover-image-uploads', __( 'Cover Image Uploads', 'buddypress' ), 'bp_admin_setting_callback_cover_image_uploads', 'buddypress', 'bp_xprofile' );
 411                  register_setting( 'buddypress', 'bp-disable-cover-image-uploads', 'intval' );
 412              }
 413  
 414              // Profile sync setting.
 415              add_settings_field( 'bp-disable-profile-sync',   __( 'Profile Syncing',  'buddypress' ), 'bp_admin_setting_callback_profile_sync', 'buddypress', 'bp_xprofile' );
 416              register_setting  ( 'buddypress', 'bp-disable-profile-sync', 'intval' );
 417          }
 418  
 419          /* Groups Section ****************************************************/
 420  
 421          if ( bp_is_active( 'groups' ) ) {
 422  
 423              // Add the main section.
 424              add_settings_section( 'bp_groups', __( 'Groups Settings',  'buddypress' ), 'bp_admin_setting_callback_groups_section', 'buddypress' );
 425  
 426              // Allow subscriptions setting.
 427              add_settings_field( 'bp_restrict_group_creation', __( 'Group Creation', 'buddypress' ), 'bp_admin_setting_callback_group_creation',   'buddypress', 'bp_groups' );
 428              register_setting( 'buddypress', 'bp_restrict_group_creation', 'intval' );
 429  
 430              // Allow group avatars.
 431              add_settings_field( 'bp-disable-group-avatar-uploads', __( 'Group Photo Uploads', 'buddypress' ), 'bp_admin_setting_callback_group_avatar_uploads', 'buddypress', 'bp_groups' );
 432              register_setting( 'buddypress', 'bp-disable-group-avatar-uploads', 'intval' );
 433  
 434              // Allow group cover images.
 435              if ( bp_is_active( 'groups', 'cover_image' ) ) {
 436                  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' );
 437                  register_setting( 'buddypress', 'bp-disable-group-cover-image-uploads', 'intval' );
 438              }
 439          }
 440  
 441          /* Activity Section **************************************************/
 442  
 443          if ( bp_is_active( 'activity' ) ) {
 444  
 445              // Add the main section.
 446              add_settings_section( 'bp_activity', __( 'Activity Settings', 'buddypress' ), 'bp_admin_setting_callback_activity_section', 'buddypress' );
 447  
 448              // Activity commenting on post and comments.
 449              add_settings_field( 'bp-disable-blogforum-comments', __( 'Post Comments', 'buddypress' ), 'bp_admin_setting_callback_blogforum_comments', 'buddypress', 'bp_activity' );
 450              register_setting( 'buddypress', 'bp-disable-blogforum-comments', 'bp_admin_sanitize_callback_blogforum_comments' );
 451  
 452              // Activity Heartbeat refresh.
 453              add_settings_field( '_bp_enable_heartbeat_refresh', __( 'Activity auto-refresh', 'buddypress' ), 'bp_admin_setting_callback_heartbeat', 'buddypress', 'bp_activity' );
 454              register_setting( 'buddypress', '_bp_enable_heartbeat_refresh', 'intval' );
 455  
 456              // Allow activity akismet.
 457              if ( is_plugin_active( 'akismet/akismet.php' ) && defined( 'AKISMET_VERSION' ) ) {
 458                  add_settings_field( '_bp_enable_akismet', __( 'Akismet', 'buddypress' ), 'bp_admin_setting_callback_activity_akismet', 'buddypress', 'bp_activity' );
 459                  register_setting( 'buddypress', '_bp_enable_akismet', 'intval' );
 460              }
 461          }
 462      }
 463  
 464      /**
 465       * Add a link to BuddyPress Hello to the admin bar.
 466       *
 467       * @since 1.9.0
 468       * @since 3.0.0 Hooked at priority 100 (was 15).
 469       *
 470       * @param WP_Admin_Bar $wp_admin_bar
 471       */
 472  	public function admin_bar_about_link( $wp_admin_bar ) {
 473          if ( ! is_user_logged_in() ) {
 474              return;
 475          }
 476  
 477          $wp_admin_bar->add_menu( array(
 478              'parent' => 'wp-logo',
 479              'id'     => 'bp-about',
 480              'title'  => esc_html_x( 'Hello, BuddyPress!', 'Colloquial alternative to "learn about BuddyPress"', 'buddypress' ),
 481              'href'   => bp_get_admin_url( '?hello=buddypress' ),
 482              'meta'   => array(
 483                  'class' => 'say-hello-buddypress',
 484              ),
 485          ) );
 486      }
 487  
 488      /**
 489       * Add Settings link to plugins area.
 490       *
 491       * @since 1.6.0
 492       *
 493       * @param array  $links Links array in which we would prepend our link.
 494       * @param string $file  Current plugin basename.
 495       * @return array Processed links.
 496       */
 497  	public function modify_plugin_action_links( $links, $file ) {
 498  
 499          // Return normal links if not BuddyPress.
 500          if ( plugin_basename( buddypress()->basename ) != $file ) {
 501              return $links;
 502          }
 503  
 504          // Add a few links to the existing links array.
 505          return array_merge( $links, array(
 506              'settings' => '<a href="' . esc_url( add_query_arg( array( 'page' => 'bp-components' ), bp_get_admin_url( $this->settings_page ) ) ) . '">' . esc_html__( 'Settings', 'buddypress' ) . '</a>',
 507              'about'    => '<a href="' . esc_url( bp_get_admin_url( '?hello=buddypress' ) ) . '">' . esc_html_x( 'Hello, BuddyPress!', 'Colloquial alternative to "learn about BuddyPress"', 'buddypress' ) . '</a>'
 508          ) );
 509      }
 510  
 511      /**
 512       * Add some general styling to the admin area.
 513       *
 514       * @since 1.6.0
 515       */
 516  	public function admin_head() {
 517  
 518          // Settings pages.
 519          remove_submenu_page( $this->settings_page, 'bp-page-settings' );
 520          remove_submenu_page( $this->settings_page, 'bp-settings'      );
 521          remove_submenu_page( $this->settings_page, 'bp-credits'       );
 522  
 523          // Network Admin Tools.
 524          remove_submenu_page( 'network-tools', 'network-tools' );
 525  
 526          // About and Credits pages.
 527          remove_submenu_page( 'index.php', 'bp-about'   );
 528          remove_submenu_page( 'index.php', 'bp-credits' );
 529      }
 530  
 531      /**
 532       * Add some general styling to the admin area.
 533       *
 534       * @since 1.6.0
 535       */
 536  	public function enqueue_scripts() {
 537          wp_enqueue_style( 'bp-admin-common-css' );
 538  
 539          // BuddyPress Hello
 540          if ( 0 === strpos( get_current_screen()->id, 'dashboard' ) && ! empty( $_GET['hello'] ) && $_GET['hello'] === 'buddypress' ) {
 541              wp_enqueue_style( 'bp-hello-css' );
 542              wp_enqueue_script( 'bp-hello-js' );
 543          }
 544      }
 545  
 546      /**
 547       * Registers BuddyPress's suggested privacy policy language.
 548       *
 549       * @since 3.x.y
 550       */
 551  	public function add_privacy_policy_content() {
 552          // Nothing to do if we're running < WP 4.9.6.
 553          if ( version_compare( $GLOBALS['wp_version'], '4.9.6', '<' ) ) {
 554              return;
 555          }
 556  
 557          $suggested_text = '<strong class="privacy-policy-tutorial">' . esc_html__( 'Suggested text:', 'buddypress' ) . ' </strong>';
 558          $content = '';
 559  
 560          $content .= '<div class="wp-suggested-text">';
 561  
 562          $content .= '<h2>' . esc_html__( 'What personal data we collect and why we collect it', 'buddypress' ) . '</h2>';
 563          $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>';
 564  
 565          if ( bp_is_active( 'xprofile' ) ) {
 566              $content .= '<h3>' . esc_html__( 'Profile Data', 'buddypress' ) . '</h3>';
 567              $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>';
 568  
 569              $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>';
 570              $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>';
 571          }
 572  
 573          if ( bp_is_active( 'activity' ) ) {
 574              $content .= '<h3>' . esc_html__( 'Activity', 'buddypress' ) . '</h3>';
 575              $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>';
 576  
 577              $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>';
 578              $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>';
 579              $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>';
 580          }
 581  
 582          if ( bp_is_active( 'messages' ) ) {
 583              $content .= '<h3>' . esc_html__( 'Messages', 'buddypress' ) . '</h3>';
 584              $content .= '<p class="privacy-policy-tutorial">' . esc_html__( 'In this section you should describe any personal data related to private messages.', 'buddypress' ) . '</p>';
 585  
 586              $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>';
 587          }
 588  
 589          $content .= '<h3>' . esc_html__( 'Cookies', 'buddypress' ) . '</h3>';
 590          $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>';
 591  
 592          $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>';
 593  
 594          $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>';
 595  
 596          if ( bp_is_active( 'groups' ) ) {
 597              $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>';
 598          }
 599  
 600          $content .= '</div><!-- .wp-suggested-text -->';
 601  
 602          wp_add_privacy_policy_content(
 603              'BuddyPress',
 604              wp_kses_post( wpautop( $content, false ) )
 605          );
 606      }
 607  
 608      /** About *****************************************************************/
 609  
 610      /**
 611       * Output the BuddyPress Hello template.
 612       *
 613       * @since 1.7.0 Screen content.
 614       * @since 3.0.0 Now outputs BuddyPress Hello template.
 615       */
 616  	public function about_screen() {
 617          if ( 0 !== strpos( get_current_screen()->id, 'dashboard' ) || empty( $_GET['hello'] ) || $_GET['hello'] !== 'buddypress' ) {
 618              return;
 619          }
 620      ?>
 621  
 622          <div id="bp-hello-backdrop" style="display: none;">
 623          </div>
 624  
 625          <div id="bp-hello-container" role="dialog" aria-labelledby="bp-hello-title" style="display: none;">
 626              <div class="bp-hello-header" role="document">
 627                  <div class="bp-hello-close">
 628                      <button type="button" class="close-modal button bp-tooltip" data-bp-tooltip="<?php esc_attr_e( 'Close pop-up', 'buddypress' ); ?>">
 629                          <span class="screen-reader-text"><?php esc_html_e( 'Close pop-up', 'buddypress' ); ?></span>
 630                      </button>
 631                  </div>
 632  
 633                  <div class="bp-hello-title">
 634                      <h1 id="bp-hello-title" tabindex="-1"><?php echo esc_html( _x( 'New in BuddyPress', 'section heading', 'buddypress' ) ); ?></h1>
 635                  </div>
 636              </div>
 637  
 638              <div class="bp-hello-content">
 639                  <h2><?php esc_html_e( 'New tools for data control and privacy', 'buddypress' ); ?></h2>
 640                  <p>
 641                      <?php esc_html_e( 'BuddyPress boasts a proud history of letting community members and managers control their data, independent of third-party, commercial entities. In this spirit, as well as the spirit of recent regulations like the EU\'s General Data Protection Regulation (GDPR), BuddyPress 4.0 introduces a suite of tools allowing users and site admins to manage member data and privacy.', 'buddypress' ); ?>
 642                  </p>
 643  
 644                  <figure class="bp-hello-alignright">
 645                      <img class="bp-hello-img-border" src="<?php echo esc_url( buddypress()->plugin_url . 'bp-core/images/data-export.png' ); ?>" alt="<?php esc_attr_e( 'Screenshot of Export Data settings panel', 'buddypress' ); ?>" />
 646                      <figcaption>
 647                          <?php esc_html_e( 'Improved user control over data exports', 'buddypress' ); ?>
 648                      </figcaption>
 649                  </figure>
 650  
 651                  <p><?php esc_html_e( 'The new "Export Data" Settings panel lets users request an export of all BuddyPress data they\'ve created. BuddyPress integrates seamlessly with the data export functionality introduced in WordPress 4.9.8, and BP data is included in exports that are initiated either from the Export Data panel or via WP\'s Tools > Export Personal Data interface.', 'buddypress' ); ?></p>
 652  
 653                  <p><?php esc_html_e( 'BuddyPress 4.0 also integrates with WordPress 4.9.8\'s Privacy Policy tools. When you create or update your Privacy Policy, BP will suggest text that\'s specifically tailored to the kinds of social data generated on a BuddyPress site. And will prompt registering users to agree to the Privacy Policy, if your theme supports it.', 'buddypress' ); ?></p>
 654  
 655                  <h2><?php esc_html_e( 'Nouveau template improvements', 'buddypress' ); ?></h2>
 656                  <p><?php esc_html_e( 'BuddyPress 3.0 introduced a new set of default templates, which we call "Nouveau". In 4.0, we\'ve fixed bugs and smoothed the edges in these templates, including more accessible markup and improved appearance on mobile devices.', 'buddypress' ); ?></p>
 657  
 658                  <h2><?php esc_html_e( "BuddyPress: leaner, faster, stronger", 'buddypress' ); ?></h2>
 659                  <p><?php esc_html_e( 'With every BuddyPress version, we strive to make internal improvements to performance and code quality in addition to introducing new features and fixes. In BuddyPress 4.0, we\'ve improved PHP compatibility both in our codebase and in our automated testing tools; we\'ve reworked some automated tests for faster performance; we\'ve ensured compatibility with upcoming changes in WordPress; and we\'ve fixed a number of bugs in the formatting and sending of emails.', 'buddypress' ); ?></p>
 660  
 661                  <p><em>
 662                      <?php
 663                      printf(
 664                          __( 'To read the full list of features, fixes, and changes in this version of BuddyPress, <a href="%s">visit Trac</a>.', 'buddypress' ),
 665                          esc_url( 'https://buddypress.trac.wordpress.org/query?group=status&milestone=4.0' )
 666                      );
 667                      ?>
 668                  </em></p>
 669  
 670                  <h2><?php echo esc_html( _x( 'Your feedback', 'screen heading', 'buddypress' ) ); ?></h2>
 671                  <p>
 672                      <?php
 673                      printf(
 674                          __( ' How are you using BuddyPress? Receiving your feedback and suggestions for future versions of BuddyPress genuinely motivates and encourages our contributors. Please <a href="%s">share your feedback</a> about this version of BuddyPress on our website. ', 'buddypress' ),
 675                          esc_url( 'https://buddypress.org/support/' )
 676                      );
 677                      ?>
 678                  </p>
 679                  <p><?php esc_html_e( 'Thank you for using BuddyPress! 😊', 'buddypress' ); ?></p>
 680  
 681                  <br /><br />
 682              </div>
 683  
 684              <div class="bp-hello-footer">
 685                  <div class="bp-hello-social-cta">
 686                      <p>
 687                          <?php
 688                          printf(
 689                              _n( 'Built by <a href="%s">%s volunteer</a>.', 'Built by <a href="%s">%s volunteers</a>.', 35, 'buddypress' ),
 690                              esc_url( bp_get_admin_url( 'admin.php?page=bp-credits' ) ),
 691                              number_format_i18n( 35 )
 692                          );
 693                          ?>
 694                      </p>
 695                  </div>
 696  
 697                  <div class="bp-hello-social-links">
 698                      <ul class="bp-hello-social">
 699                          <li>
 700                              <?php
 701                              printf(
 702                                  '<a class="twitter bp-tooltip" data-bp-tooltip="%1$s" href="%2$s"><span class="screen-reader-text">%3$s</span></a>',
 703                                  esc_attr( 'Follow BuddyPress on Twitter', 'buddypress' ),
 704                                  esc_url( 'https://twitter.com/buddypress' ),
 705                                  esc_html( 'Follow BuddyPress on Twitter', 'buddypress' )
 706                              );
 707                              ?>
 708                          </li>
 709  
 710                          <li>
 711                              <?php
 712                              printf(
 713                                  '<a class="support bp-tooltip" data-bp-tooltip="%1$s" href="%2$s"><span class="screen-reader-text">%3$s</span></a>',
 714                                  esc_attr( 'Visit the Support Forums', 'buddypress' ),
 715                                  esc_url( 'https://buddypress.org/support/' ),
 716                                  esc_html( 'Visit the Support Forums', 'buddypress' )
 717                              );
 718                              ?>
 719                          </li>
 720                      </ul>
 721                  </div>
 722              </div>
 723          </div>
 724  
 725          <?php
 726      }
 727  
 728      /**
 729       * Output the credits screen.
 730       *
 731       * Hardcoding this in here is pretty janky. It's fine for now, but we'll
 732       * want to leverage api.wordpress.org eventually.
 733       *
 734       * @since 1.7.0
 735       */
 736  	public function credits_screen() {
 737      ?>
 738  
 739          <div class="wrap bp-about-wrap">
 740  
 741          <h1><?php _e( 'BuddyPress Settings', 'buddypress' ); ?> </h1>
 742  
 743          <h2 class="nav-tab-wrapper"><?php bp_core_admin_tabs( __( 'Credits', 'buddypress' ) ); ?></h2>
 744  
 745              <p class="about-description"><?php _e( 'Meet the contributors behind BuddyPress:', 'buddypress' ); ?></p>
 746  
 747              <h3 class="wp-people-group"><?php _e( 'Project Leaders', 'buddypress' ); ?></h3>
 748              <ul class="wp-people-group " id="wp-people-group-project-leaders">
 749                  <li class="wp-person" id="wp-person-johnjamesjacoby">
 750                      <a class="web" href="https://profiles.wordpress.org/johnjamesjacoby"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/7a2644fb53ae2f7bfd7143b504af396c?s=120">
 751                      John James Jacoby</a>
 752                      <span class="title"><?php _e( 'Project Lead', 'buddypress' ); ?></span>
 753                  </li>
 754                  <li class="wp-person" id="wp-person-boonebgorges">
 755                      <a class="web" href="https://profiles.wordpress.org/boonebgorges"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/9cf7c4541a582729a5fc7ae484786c0c?s=120">
 756                      Boone B. Gorges</a>
 757                      <span class="title"><?php _e( 'Lead Developer', 'buddypress' ); ?></span>
 758                  </li>
 759                  <li class="wp-person" id="wp-person-djpaul">
 760                      <a class="web" href="https://profiles.wordpress.org/djpaul"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/3bc9ab796299d67ce83dceb9554f75df?s=120">
 761                      Paul Gibbs</a>
 762                      <span class="title"><?php _e( 'Lead Developer', 'buddypress' ); ?></span>
 763                  </li>
 764              </ul>
 765  
 766              <h3 class="wp-people-group"><?php _e( 'BuddyPress Team', 'buddypress' ); ?></h3>
 767              <ul class="wp-people-group " id="wp-people-group-core-team">
 768                  <li class="wp-person" id="wp-person-r-a-y">
 769                      <a class="web" href="https://profiles.wordpress.org/r-a-y"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/3bfa556a62b5bfac1012b6ba5f42ebfa?s=120">
 770                      Ray</a>
 771                      <span class="title"><?php _e( 'Core Developer', 'buddypress' ); ?></span>
 772                  </li>
 773                  <li class="wp-person" id="wp-person-hnla">
 774                      <a class="web" href="https://profiles.wordpress.org/hnla"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/3860c955aa3f79f13b92826ae47d07fe?s=120">
 775                      Hugo Ashmore</a>
 776                      <span class="title"><?php _e( 'Core Developer', 'buddypress' ); ?></span>
 777                  </li>
 778                  <li class="wp-person" id="wp-person-imath">
 779                      <a class="web" href="https://profiles.wordpress.org/imath"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/8b208ca408dad63888253ee1800d6a03?s=120">
 780                      Mathieu Viet</a>
 781                      <span class="title"><?php _e( 'Core Developer', 'buddypress' ); ?></span>
 782                  </li>
 783                  <li class="wp-person" id="wp-person-mercime">
 784                      <a class="web" href="https://profiles.wordpress.org/mercime"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/fae451be6708241627983570a1a1817a?s=120">
 785                      Mercime</a>
 786                      <span class="title"><?php _e( 'Navigator', 'buddypress' ); ?></span>
 787                  </li>
 788                  <li class="wp-person" id="wp-person-dcavins">
 789                      <a class="web" href="https://profiles.wordpress.org/dcavins"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/a5fa7e83d59cb45ebb616235a176595a?s=120">
 790                      David Cavins</a>
 791                      <span class="title"><?php _e( 'Core Developer', 'buddypress' ); ?></span>
 792                  </li>
 793                  <li class="wp-person" id="wp-person-tw2113">
 794                      <a class="web" href="https://profiles.wordpress.org/tw2113"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/a5d7c934621fa1c025b83ee79bc62366?s=120">
 795                      Michael Beckwith</a>
 796                      <span class="title"><?php _e( 'Core Developer', 'buddypress' ); ?></span>
 797                  </li>
 798                  <li class="wp-person" id="wp-person-henry-wright">
 799                      <a class="web" href="https://profiles.wordpress.org/henry.wright"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/0da2f1a9340d6af196b870f6c107a248?s=120">
 800                      Henry Wright</a>
 801                      <span class="title"><?php _e( 'Community Support', 'buddypress' ); ?></span>
 802                  </li>
 803                  <li class="wp-person" id="wp-person-danbp">
 804                      <a class="web" href="https://profiles.wordpress.org/danbp"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/0deae2e7003027fbf153500cd3fa5501?s=120">
 805                      danbp</a>
 806                      <span class="title"><?php _e( 'Community Support', 'buddypress' ); ?></span>
 807                  </li>
 808                  <li class="wp-person" id="wp-person-shanebp">
 809                      <a class="web" href="https://profiles.wordpress.org/shanebp"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/ffd294ab5833ba14aaf175f9acc71cc4?s=120">
 810                      shanebp</a>
 811                      <span class="title"><?php _e( 'Community Support', 'buddypress' ); ?></span>
 812                  </li>
 813                  <li class="wp-person" id="wp-person-slaffik">
 814                      <a class="web" href="https://profiles.wordpress.org/r-a-y"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/61fb07ede3247b63f19015f200b3eb2c?s=120">
 815                      Slava Abakumov</a>
 816                      <span class="title"><?php _e( 'Core Developer', 'buddypress' ); ?></span>
 817                  </li>
 818                  <li class="wp-person" id="wp-person-offereins">
 819                      <a class="web" href="https://profiles.wordpress.org/Offereins"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/2404ed0a35bb41aedefd42b0a7be61c1?s=120">
 820                      Laurens Offereins</a>
 821                      <span class="title"><?php _e( 'Core Developer', 'buddypress' ); ?></span>
 822                  </li>
 823                  <li class="wp-person" id="wp-person-netweb">
 824                      <a class="web" href="https://profiles.wordpress.org/netweb"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/97e1620b501da675315ba7cfb740e80f?s=120">
 825                      Stephen Edgar</a>
 826                      <span class="title"><?php _e( 'Core Developer', 'buddypress' ); ?></span>
 827                  </li>
 828                  <li class="wp-person" id="wp-person-espellcaste">
 829                      <a class="web" href="https://profiles.wordpress.org/espellcaste"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/b691e67be0ba5cad6373770656686bc3?s=120">
 830                      Renato Alves</a>
 831                      <span class="title"><?php _e( 'Core Developer', 'buddypress' ); ?></span>
 832                  </li>
 833                  <li class="wp-person" id="wp-person-venutius">
 834                      <a class="web" href="https://profiles.wordpress.org/venutius"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/6a7c42a77fd94b82b217a7a97afdddbc?s=120">
 835                      Venutius</a>
 836                      <span class="title"><?php _e( 'Community Support', 'buddypress' ); ?></span>
 837                  </li>
 838              </ul>
 839  
 840              <h3 class="wp-people-group"><?php _e( 'Recent Rockstars', 'buddypress' ); ?></h3>
 841              <ul class="wp-people-group " id="wp-people-group-rockstars">
 842                  <li class="wp-person" id="wp-person-dimensionmedia">
 843                      <a class="web" href="https://profiles.wordpress.org/dimensionmedia"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/7735aada1ec39d0c1118bd92ed4551f1?s=120">
 844                      David Bisset</a>
 845                  </li>
 846                  <li class="wp-person" id="wp-person-garrett-eclipse">
 847                      <a class="web" href="https://profiles.wordpress.org/garrett-eclipse"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/7f68f24441c61514d5d0e1451bb5bc9d?s=120">
 848                      Garrett Hyder</a>
 849                  </li>
 850                  <li class="wp-person" id="wp-person-thebrandonallen">
 851                      <a class="web" href="https://profiles.wordpress.org/thebrandonallen"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/6d3f77bf3c9ca94c406dea401b566950?s=120">
 852                      Brandon Allen</a>
 853                  </li>
 854                  <li class="wp-person" id="wp-person-ramiy">
 855                      <a class="web" href="https://profiles.wordpress.org/ramiy"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/ce2a269e424156d79cb0c4e1d4d82db1?s=120">
 856                      Rami Yushuvaev</a>
 857                  </li>
 858                  <li class="wp-person" id="wp-person-vapvarun">
 859                      <a class="web" href="https://profiles.wordpress.org/vapvarun"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/78a3bf7eb3a1132fc667f96f2631e448?s=120">
 860                      Vapvarun</a>
 861                  </li>
 862              </ul>
 863  
 864              <h3 class="wp-people-group"><?php printf( esc_html__( 'Contributors to BuddyPress %s', 'buddypress' ), self::display_version() ); ?></h3>
 865              <p class="wp-credits-list">
 866                  <a href="https://profiles.wordpress.org/xknown/">Alex Concha (xknown)</a>,
 867                  <a href="https://profiles.wordpress.org/ankit-k-gupta/">Ankit K Gupta (ankit-k-gupta)</a>,
 868                  <a href="https://profiles.wordpress.org/boonebgorges/">Boone B Gorges (boonebgorges)</a>,
 869                  <a href="https://profiles.wordpress.org/sbrajesh/">Brajesh Singh (sbrajesh)</a>,
 870                  <a href="https://profiles.wordpress.org/brianbws/">Brian Cruikshank (brianbws)</a>,
 871                  <a href="https://profiles.wordpress.org/needle/">Christian Wach (needle)</a>,
 872                  <a href="https://profiles.wordpress.org/cyberwani/">Dinesh Kesarwani (cyberwani)</a>,
 873                  <a href="https://profiles.wordpress.org/dipesh.kakadipa/">dipeshkakadiya</a>,
 874                  <a href="https://profiles.wordpress.org/drywallbmb/">drywallbmb</a>,
 875                  <a href="https://profiles.wordpress.org/dullowl/">dullowl</a>,
 876                  <a href="https://profiles.wordpress.org/eric01/">Eric (eric01)</a>,
 877                  <a href="https://profiles.wordpress.org/garrett-eclipse/">Garrett Hyder (garrett-eclipse)</a>,
 878                  <a href="https://profiles.wordpress.org/harshall/">Harshal Limaye (harshall)</a>,
 879                  <a href="https://profiles.wordpress.org/hnla/">Hugo (hnla)</a>,
 880                  <a href="https://profiles.wordpress.org/johnjamesjacoby/">John James Jacoby (johnjamesjacoby)</a>,
 881                  <a href="https://profiles.wordpress.org/marcella1981/">Marcella (marcella1981)</a>,
 882                  <a href="https://profiles.wordpress.org/imath/">Mathieu Viet (imath)</a>,
 883                  <a href="https://profiles.wordpress.org/mercime/">mercime</a>,
 884                  <a href="https://profiles.wordpress.org/MorgunovVit/">MorgunovVit</a>,
 885                  <a href="https://profiles.wordpress.org/n0barcode/">n0barcode</a>,
 886                  <a href="https://profiles.wordpress.org/pareshradadiya/">paresh.radadiya (pareshradadiya)</a>,
 887                  <a href="https://profiles.wordpress.org/DJPaul/">Paul Gibbs (DJPaul)</a>,
 888                  <a href="https://profiles.wordpress.org/pooja1210/">Pooja N Muchandikar (pooja1210)</a>,
 889                  <a href="https://profiles.wordpress.org/r-a-y/">r-a-y</a>,
 890                  <a href="https://profiles.wordpress.org/espellcaste/">Renato Alves (espellcaste)</a>,
 891                  <a href="https://profiles.wordpress.org/RT77/">RT77</a>,
 892                  <a href="https://profiles.wordpress.org/cyclic/">Ryan Williams (cyclic)</a>,
 893                  <a href="https://profiles.wordpress.org/elhardoum/">Samuel Elh (elhardoum)</a>,
 894                  <a href="https://profiles.wordpress.org/shubh14/">shubh14</a>,
 895                  <a href="https://profiles.wordpress.org/spdustin/">spdustin</a>,
 896                  <a href="https://profiles.wordpress.org/suvikki/">suvikki</a>,
 897                  <a href="https://profiles.wordpress.org/netweb/">Stephen Edgar (netweb)</a>,
 898                  <a href="https://profiles.wordpress.org/thejimmy/">thejimmy</a>,
 899                  <a href="https://profiles.wordpress.org/vapvarun/">vapvarun</a>,
 900                  <a href="https://profiles.wordpress.org/wbcomdesigns/">Wbcom Designs (wbcomdesigns)</a>,
 901                  <a href="https://profiles.wordpress.org/yahil/">Yahil Madakiya (yahil)</a>
 902              </p>
 903  
 904              <h3 class="wp-people-group"><?php _e( 'With our thanks to these Open Source projects', 'buddypress' ); ?></h3>
 905              <p class="wp-credits-list">
 906                  <a href="https://github.com/ichord/At.js">At.js</a>,
 907                  <a href="https://bbpress.org">bbPress</a>,
 908                  <a href="https://github.com/ichord/Caret.js">Caret.js</a>,
 909                  <a href="https://tedgoas.github.io/Cerberus/">Cerberus</a>,
 910                  <a href="https://ionicons.com/">Ionicons</a>,
 911                  <a href="https://github.com/carhartl/jquery-cookie">jquery.cookie</a>,
 912                  <a href="https://mattbradley.github.io/livestampjs/">Livestamp.js</a>,
 913                  <a href="https://www.mediawiki.org/wiki/MediaWiki">MediaWiki</a>,
 914                  <a href="https://momentjs.com/">Moment.js</a>,
 915                  <a href="https://wordpress.org">WordPress</a>.
 916              </p>
 917  
 918              <h3 class="wp-people-group"><?php _e( 'Contributor Emeriti', 'buddypress' ); ?></h3>
 919              <ul class="wp-people-group " id="wp-people-group-emeriti">
 920                  <li class="wp-person" id="wp-person-apeatling">
 921                      <a class="web" href="https://profiles.wordpress.org/johnjamesjacoby"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/bb29d699b5cba218c313b61aa82249da?s=120">
 922                      Andy Peatling</a>
 923                      <span class="title"><?php _e( 'Project Founder', 'buddypress' ); ?></span>
 924                  </li>
 925                  <li class="wp-person" id="wp-person-burtadsit">
 926                      <a class="web" href="https://profiles.wordpress.org/burtadsit"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/185e1d3e2d653af9d49a4e8e4fc379df?s=120">
 927                      Burt Adsit</a>
 928                  </li>
 929                  <li class="wp-person" id="wp-person-jeffsayre">
 930                      <a class="web" href="https://profiles.wordpress.org/jeffsayre"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/8e009a84ff5d245c22a69c7df6ab45f7?s=120">
 931                      Jeff Sayre</a>
 932                  </li>
 933                  <li class="wp-person" id="wp-person-karmatosed">
 934                      <a class="web" href="https://profiles.wordpress.org/karmatosed"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/ca7d4273a689cdbf524d8332771bb1ca?s=120">
 935                      Tammie Lister</a>
 936                  </li>
 937                  <li class="wp-person" id="wp-person-modemlooper">
 938                      <a class="web" href="https://profiles.wordpress.org/modemlooper"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/1c07be1016e845de514931477c939307?s=120">
 939                      modemlooper</a>
 940                  </li>
 941              </ul>
 942          </div>
 943  
 944          <?php
 945      }
 946  
 947      /** Emails ****************************************************************/
 948  
 949      /**
 950       * Registers 'Situations' column on Emails dashboard page.
 951       *
 952       * @since 2.6.0
 953       *
 954       * @param array $columns Current column data.
 955       * @return array
 956       */
 957  	public function emails_register_situation_column( $columns = array() ) {
 958          $situation = array(
 959              'situation' => _x( 'Situations', 'Email post type', 'buddypress' )
 960          );
 961  
 962          // Inject our 'Situations' column just before the last 'Date' column.
 963          return array_slice( $columns, 0, -1, true ) + $situation + array_slice( $columns, -1, null, true );
 964      }
 965  
 966      /**
 967       * Output column data for our custom 'Situations' column.
 968       *
 969       * @since 2.6.0
 970       *
 971       * @param string $column  Current column name.
 972       * @param int    $post_id Current post ID.
 973       */
 974  	public function emails_display_situation_column_data( $column = '', $post_id = 0 ) {
 975          if ( 'situation' !== $column ) {
 976              return;
 977          }
 978  
 979          // Grab email situations for the current post.
 980          $situations = wp_list_pluck( get_the_terms( $post_id, bp_get_email_tax_type() ), 'description' );
 981  
 982          // Output each situation as a list item.
 983          echo '<ul><li>';
 984          echo implode( '</li><li>', $situations );
 985          echo '</li></ul>';
 986      }
 987  
 988      /** Helpers ***************************************************************/
 989  
 990      /**
 991       * Return true/false based on whether a query argument is set.
 992       *
 993       * @see bp_do_activation_redirect()
 994       *
 995       * @since 2.2.0
 996       *
 997       * @return bool
 998       */
 999  	public static function is_new_install() {
1000          return (bool) isset( $_GET['is_new_install'] );
1001      }
1002  
1003      /**
1004       * Return a user-friendly version-number string, for use in translations.
1005       *
1006       * @since 2.2.0
1007       *
1008       * @return string
1009       */
1010  	public static function display_version() {
1011  
1012          // Use static variable to prevent recalculations.
1013          static $display = '';
1014  
1015          // Only calculate on first run.
1016          if ( '' === $display ) {
1017  
1018              // Get current version.
1019              $version = bp_get_version();
1020  
1021              // Check for prerelease hyphen.
1022              $pre     = strpos( $version, '-' );
1023  
1024              // Strip prerelease suffix.
1025              $display = ( false !== $pre )
1026                  ? substr( $version, 0, $pre )
1027                  : $version;
1028          }
1029  
1030          // Done!
1031          return $display;
1032      }
1033  
1034      /**
1035       * Add Emails menu item to custom menus array.
1036       *
1037       * Several BuddyPress components have top-level menu items in the Dashboard,
1038       * which all appear together in the middle of the Dashboard menu. This function
1039       * adds the Emails screen to the array of these menu items.
1040       *
1041       * @since 2.4.0
1042       *
1043       * @param array $custom_menus The list of top-level BP menu items.
1044       * @return array $custom_menus List of top-level BP menu items, with Emails added.
1045       */
1046  	public function emails_admin_menu_order( $custom_menus = array() ) {
1047          array_push( $custom_menus, 'edit.php?post_type=' . bp_get_email_post_type() );
1048  
1049          if ( is_network_admin() && bp_is_network_activated() ) {
1050              array_push(
1051                  $custom_menus,
1052                  get_admin_url( bp_get_root_blog_id(), 'edit.php?post_type=' . bp_get_email_post_type() )
1053              );
1054          }
1055  
1056          return $custom_menus;
1057      }
1058  
1059      /**
1060       * Register styles commonly used by BuddyPress wp-admin screens.
1061       *
1062       * @since 2.5.0
1063       */
1064  	public function admin_register_styles() {
1065          $min = bp_core_get_minified_asset_suffix();
1066          $url = $this->css_url;
1067  
1068          /**
1069           * Filters the BuddyPress Core Admin CSS file path.
1070           *
1071           * @since 1.6.0
1072           *
1073           * @param string $file File path for the admin CSS.
1074           */
1075          $common_css = apply_filters( 'bp_core_admin_common_css', "{$url}common{$min}.css" );
1076  
1077          /**
1078           * Filters the BuddyPress admin stylesheet files to register.
1079           *
1080           * @since 2.5.0
1081           *
1082           * @param array $value Array of admin stylesheet file information to register.
1083           */
1084          $styles = apply_filters( 'bp_core_admin_register_styles', array(
1085              // Legacy.
1086              'bp-admin-common-css' => array(
1087                  'file'         => $common_css,
1088                  'dependencies' => array(),
1089              ),
1090  
1091              // 2.5
1092              'bp-customizer-controls' => array(
1093                  'file'         => "{$url}customizer-controls{$min}.css",
1094                  'dependencies' => array(),
1095              ),
1096  
1097              // 3.0
1098              'bp-hello-css' => array(
1099                  'file'         => "{$url}hello{$min}.css",
1100                  'dependencies' => array( 'bp-admin-common-css' ),
1101              ),
1102          ) );
1103  
1104          $version = bp_get_version();
1105  
1106          foreach ( $styles as $id => $style ) {
1107              wp_register_style( $id, $style['file'], $style['dependencies'], $version );
1108              wp_style_add_data( $id, 'rtl', 'replace' );
1109  
1110              if ( $min ) {
1111                  wp_style_add_data( $id, 'suffix', $min );
1112              }
1113          }
1114      }
1115  
1116      /**
1117       * Register JS commonly used by BuddyPress wp-admin screens.
1118       *
1119       * @since 2.5.0
1120       */
1121  	public function admin_register_scripts() {
1122          $min = bp_core_get_minified_asset_suffix();
1123          $url = $this->js_url;
1124  
1125          /**
1126           * Filters the BuddyPress admin JS files to register.
1127           *
1128           * @since 2.5.0
1129           *
1130           * @param array $value Array of admin JS file information to register.
1131           */
1132          $scripts = apply_filters( 'bp_core_admin_register_scripts', array(
1133              // 2.5
1134              'bp-customizer-controls' => array(
1135                  'file'         => "{$url}customizer-controls{$min}.js",
1136                  'dependencies' => array( 'jquery' ),
1137                  'footer'       => true,
1138              ),
1139  
1140              // 3.0
1141              'bp-hello-js' => array(
1142                  'file'         => "{$url}hello{$min}.js",
1143                  'dependencies' => array(),
1144                  'footer'       => true,
1145              ),
1146          ) );
1147  
1148          $version = bp_get_version();
1149  
1150          foreach ( $scripts as $id => $script ) {
1151              wp_register_script( $id, $script['file'], $script['dependencies'], $version, $script['footer'] );
1152          }
1153      }
1154  }
1155  endif; // End class_exists check.


Generated: Mon Jul 22 01:01:43 2019 Cross-referenced by PHPXref 0.7.1