/bp-core/classes/class-bp-admin.php

  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. * Set admin-related globals. 
  93. * 
  94. * @since 1.6.0 
  95. */ 
  96. private function setup_globals() { 
  97. $bp = buddypress(); 
  98.  
  99. // Paths and URLs 
  100. $this->admin_dir = trailingslashit( $bp->plugin_dir . 'bp-core/admin' ); // Admin path. 
  101. $this->admin_url = trailingslashit( $bp->plugin_url . 'bp-core/admin' ); // Admin url. 
  102. $this->images_url = trailingslashit( $this->admin_url . 'images' ); // Admin images URL. 
  103. $this->css_url = trailingslashit( $this->admin_url . 'css' ); // Admin css URL. 
  104. $this->js_url = trailingslashit( $this->admin_url . 'js' ); // Admin css URL. 
  105.  
  106. // Main settings page. 
  107. $this->settings_page = bp_core_do_network_admin() ? 'settings.php' : 'options-general.php'; 
  108.  
  109. // Main capability. 
  110. $this->capability = bp_core_do_network_admin() ? 'manage_network_options' : 'manage_options'; 
  111.  
  112. /** 
  113. * Include required files. 
  114. * 
  115. * @since 1.6.0 
  116. */ 
  117. private function includes() { 
  118. require( $this->admin_dir . 'bp-core-admin-actions.php' ); 
  119. require( $this->admin_dir . 'bp-core-admin-settings.php' ); 
  120. require( $this->admin_dir . 'bp-core-admin-functions.php' ); 
  121. require( $this->admin_dir . 'bp-core-admin-components.php' ); 
  122. require( $this->admin_dir . 'bp-core-admin-slugs.php' ); 
  123. require( $this->admin_dir . 'bp-core-admin-tools.php' ); 
  124.  
  125. /** 
  126. * Set up the admin hooks, actions, and filters. 
  127. * 
  128. * @since 1.6.0 
  129. * 
  130. */ 
  131. private function setup_actions() { 
  132.  
  133. /** General Actions ***************************************************/ 
  134.  
  135. // Add some page specific output to the <head>. 
  136. add_action( 'bp_admin_head', array( $this, 'admin_head' ), 999 ); 
  137.  
  138. // Add menu item to settings menu. 
  139. add_action( 'admin_menu', array( $this, 'site_admin_menus' ), 5 ); 
  140. add_action( bp_core_admin_hook(), array( $this, 'admin_menus' ), 5 ); 
  141.  
  142. // Enqueue all admin JS and CSS. 
  143. add_action( 'bp_admin_enqueue_scripts', array( $this, 'admin_register_styles' ), 1 ); 
  144. add_action( 'bp_admin_enqueue_scripts', array( $this, 'admin_register_scripts' ), 1 ); 
  145. add_action( 'bp_admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); 
  146.  
  147. /** BuddyPress Actions ************************************************/ 
  148.  
  149. // Load the BuddyPress metabox in the WP Nav Menu Admin UI. 
  150. add_action( 'load-nav-menus.php', 'bp_admin_wp_nav_menu_meta_box' ); 
  151.  
  152. // Add settings. 
  153. add_action( 'bp_register_admin_settings', array( $this, 'register_admin_settings' ) ); 
  154.  
  155. // Add a link to BuddyPress About page to the admin bar. 
  156. add_action( 'admin_bar_menu', array( $this, 'admin_bar_about_link' ), 15 ); 
  157.  
  158. // Add a description of new BuddyPress tools in the available tools page. 
  159. add_action( 'tool_box', 'bp_core_admin_available_tools_intro' ); 
  160. add_action( 'bp_network_tool_box', 'bp_core_admin_available_tools_intro' ); 
  161.  
  162. // On non-multisite, catch. 
  163. add_action( 'load-users.php', 'bp_core_admin_user_manage_spammers' ); 
  164.  
  165. // Emails. 
  166. add_filter( 'manage_' . bp_get_email_post_type() . '_posts_columns', array( $this, 'emails_register_situation_column' ) ); 
  167. add_action( 'manage_' . bp_get_email_post_type() . '_posts_custom_column', array( $this, 'emails_display_situation_column_data' ), 10, 2 ); 
  168.  
  169. /** Filters ***********************************************************/ 
  170.  
  171. // Add link to settings page. 
  172. add_filter( 'plugin_action_links', array( $this, 'modify_plugin_action_links' ), 10, 2 ); 
  173. add_filter( 'network_admin_plugin_action_links', array( $this, 'modify_plugin_action_links' ), 10, 2 ); 
  174.  
  175. // Add "Mark as Spam" row actions on users.php. 
  176. add_filter( 'ms_user_row_actions', 'bp_core_admin_user_row_actions', 10, 2 ); 
  177. add_filter( 'user_row_actions', 'bp_core_admin_user_row_actions', 10, 2 ); 
  178.  
  179. // Emails 
  180. add_filter( 'bp_admin_menu_order', array( $this, 'emails_admin_menu_order' ), 20 ); 
  181.  
  182. /** 
  183. * Register site- or network-admin nav menu elements. 
  184. * 
  185. * Contextually hooked to site or network-admin depending on current configuration. 
  186. * 
  187. * @since 1.6.0 
  188. */ 
  189. public function admin_menus() { 
  190.  
  191. // Bail if user cannot moderate. 
  192. if ( ! bp_current_user_can( 'manage_options' ) ) { 
  193. return; 
  194.  
  195. // About. 
  196. add_dashboard_page( 
  197. __( 'Welcome to BuddyPress', 'buddypress' ),  
  198. __( 'Welcome to BuddyPress', 'buddypress' ),  
  199. 'manage_options',  
  200. 'bp-about',  
  201. array( $this, 'about_screen' ) 
  202. ); 
  203.  
  204. // Credits. 
  205. add_dashboard_page( 
  206. __( 'Welcome to BuddyPress', 'buddypress' ),  
  207. __( 'Welcome to BuddyPress', 'buddypress' ),  
  208. 'manage_options',  
  209. 'bp-credits',  
  210. array( $this, 'credits_screen' ) 
  211. ); 
  212.  
  213. $hooks = array(); 
  214.  
  215. // Changed in BP 1.6 . See bp_core_admin_backpat_menu(). 
  216. $hooks[] = add_menu_page( 
  217. __( 'BuddyPress', 'buddypress' ),  
  218. __( 'BuddyPress', 'buddypress' ),  
  219. $this->capability,  
  220. 'bp-general-settings',  
  221. 'bp_core_admin_backpat_menu',  
  222. 'div' 
  223. ); 
  224.  
  225. $hooks[] = add_submenu_page( 
  226. 'bp-general-settings',  
  227. __( 'BuddyPress Help', 'buddypress' ),  
  228. __( 'Help', 'buddypress' ),  
  229. $this->capability,  
  230. 'bp-general-settings',  
  231. 'bp_core_admin_backpat_page' 
  232. ); 
  233.  
  234. // Add the option pages. 
  235. $hooks[] = add_submenu_page( 
  236. $this->settings_page,  
  237. __( 'BuddyPress Components', 'buddypress' ),  
  238. __( 'BuddyPress', 'buddypress' ),  
  239. $this->capability,  
  240. 'bp-components',  
  241. 'bp_core_admin_components_settings' 
  242. ); 
  243.  
  244. $hooks[] = add_submenu_page( 
  245. $this->settings_page,  
  246. __( 'BuddyPress Pages', 'buddypress' ),  
  247. __( 'BuddyPress Pages', 'buddypress' ),  
  248. $this->capability,  
  249. 'bp-page-settings',  
  250. 'bp_core_admin_slugs_settings' 
  251. ); 
  252.  
  253. $hooks[] = add_submenu_page( 
  254. $this->settings_page,  
  255. __( 'BuddyPress Options', 'buddypress' ),  
  256. __( 'BuddyPress Options', 'buddypress' ),  
  257. $this->capability,  
  258. 'bp-settings',  
  259. 'bp_core_admin_settings' 
  260. ); 
  261.  
  262. // For consistency with non-Multisite, we add a Tools menu in 
  263. // the Network Admin as a home for our Tools panel. 
  264. if ( is_multisite() && bp_core_do_network_admin() ) { 
  265. $tools_parent = 'network-tools'; 
  266.  
  267. $hooks[] = add_menu_page( 
  268. __( 'Tools', 'buddypress' ),  
  269. __( 'Tools', 'buddypress' ),  
  270. $this->capability,  
  271. $tools_parent,  
  272. 'bp_core_tools_top_level_item',  
  273. '',  
  274. 24 // Just above Settings. 
  275. ); 
  276.  
  277. $hooks[] = add_submenu_page( 
  278. $tools_parent,  
  279. __( 'Available Tools', 'buddypress' ),  
  280. __( 'Available Tools', 'buddypress' ),  
  281. $this->capability,  
  282. 'available-tools',  
  283. 'bp_core_admin_available_tools_page' 
  284. ); 
  285. } else { 
  286. $tools_parent = 'tools.php'; 
  287.  
  288. $hooks[] = add_submenu_page( 
  289. $tools_parent,  
  290. __( 'BuddyPress Tools', 'buddypress' ),  
  291. __( 'BuddyPress', 'buddypress' ),  
  292. $this->capability,  
  293. 'bp-tools',  
  294. 'bp_core_admin_tools' 
  295. ); 
  296.  
  297. // For network-wide configs, add a link to (the root site's) Emails screen. 
  298. if ( is_network_admin() && bp_is_network_activated() ) { 
  299. $email_labels = bp_get_email_post_type_labels(); 
  300. $email_url = get_admin_url( bp_get_root_blog_id(), 'edit.php?post_type=' . bp_get_email_post_type() ); 
  301.  
  302. $hooks[] = add_menu_page( 
  303. $email_labels['name'],  
  304. $email_labels['menu_name'],  
  305. $this->capability,  
  306. '',  
  307. '',  
  308. 'dashicons-email',  
  309. 26 
  310. ); 
  311.  
  312. // Hack: change the link to point to the root site's admin, not the network admin. 
  313. $GLOBALS['menu'][26][2] = esc_url_raw( $email_url ); 
  314.  
  315. foreach( $hooks as $hook ) { 
  316. add_action( "admin_head-$hook", 'bp_core_modify_admin_menu_highlight' ); 
  317.  
  318. /** 
  319. * Register site-admin nav menu elements. 
  320. * 
  321. * @since 2.5.0 
  322. */ 
  323. public function site_admin_menus() { 
  324. if ( ! bp_current_user_can( 'manage_options' ) ) { 
  325. return; 
  326.  
  327. $hooks = array(); 
  328.  
  329. // Require WP 4.0+. 
  330. if ( bp_is_root_blog() && version_compare( $GLOBALS['wp_version'], '4.0', '>=' ) ) { 
  331. // Appearance > Emails. 
  332. $hooks[] = add_theme_page( 
  333. _x( 'Emails', 'screen heading', 'buddypress' ),  
  334. _x( 'Emails', 'screen heading', 'buddypress' ),  
  335. $this->capability,  
  336. 'bp-emails-customizer-redirect',  
  337. 'bp_email_redirect_to_customizer' 
  338. ); 
  339.  
  340. // Emails > Customize. 
  341. $hooks[] = add_submenu_page( 
  342. 'edit.php?post_type=' . bp_get_email_post_type(),  
  343. _x( 'Customize', 'email menu label', 'buddypress' ),  
  344. _x( 'Customize', 'email menu label', 'buddypress' ),  
  345. $this->capability,  
  346. 'bp-emails-customizer-redirect',  
  347. 'bp_email_redirect_to_customizer' 
  348. ); 
  349.  
  350. foreach( $hooks as $hook ) { 
  351. add_action( "admin_head-$hook", 'bp_core_modify_admin_menu_highlight' ); 
  352.  
  353. /** 
  354. * Register the settings. 
  355. * 
  356. * @since 1.6.0 
  357. * 
  358. */ 
  359. public function register_admin_settings() { 
  360.  
  361. /** Main Section ******************************************************/ 
  362.  
  363. // Add the main section. 
  364. add_settings_section( 'bp_main', __( 'Main Settings', 'buddypress' ), 'bp_admin_setting_callback_main_section', 'buddypress' ); 
  365.  
  366. // Hide toolbar for logged out users setting. 
  367. add_settings_field( 'hide-loggedout-adminbar', __( 'Toolbar', 'buddypress' ), 'bp_admin_setting_callback_admin_bar', 'buddypress', 'bp_main' ); 
  368. register_setting( 'buddypress', 'hide-loggedout-adminbar', 'intval' ); 
  369.  
  370. // Only show 'switch to Toolbar' option if the user chose to retain the BuddyBar during the 1.6 upgrade. 
  371. if ( (bool) bp_get_option( '_bp_force_buddybar', false ) ) { 
  372. // Load deprecated code if not available. 
  373. if ( ! function_exists( 'bp_admin_setting_callback_force_buddybar' ) ) { 
  374. require buddypress()->plugin_dir . 'bp-core/deprecated/2.1.php'; 
  375.  
  376. add_settings_field( '_bp_force_buddybar', __( 'Toolbar', 'buddypress' ), 'bp_admin_setting_callback_force_buddybar', 'buddypress', 'bp_main' ); 
  377. register_setting( 'buddypress', '_bp_force_buddybar', 'bp_admin_sanitize_callback_force_buddybar' ); 
  378.  
  379. // Allow account deletion. 
  380. add_settings_field( 'bp-disable-account-deletion', __( 'Account Deletion', 'buddypress' ), 'bp_admin_setting_callback_account_deletion', 'buddypress', 'bp_main' ); 
  381. register_setting( 'buddypress', 'bp-disable-account-deletion', 'intval' ); 
  382.  
  383. /** XProfile Section **************************************************/ 
  384.  
  385. if ( bp_is_active( 'xprofile' ) ) { 
  386.  
  387. // Add the main section. 
  388. add_settings_section( 'bp_xprofile', _x( 'Profile Settings', 'BuddyPress setting tab', 'buddypress' ), 'bp_admin_setting_callback_xprofile_section', 'buddypress' ); 
  389.  
  390. // Avatars. 
  391. add_settings_field( 'bp-disable-avatar-uploads', __( 'Profile Photo Uploads', 'buddypress' ), 'bp_admin_setting_callback_avatar_uploads', 'buddypress', 'bp_xprofile' ); 
  392. register_setting( 'buddypress', 'bp-disable-avatar-uploads', 'intval' ); 
  393.  
  394. // Cover images. 
  395. if ( bp_is_active( 'xprofile', 'cover_image' ) ) { 
  396. add_settings_field( 'bp-disable-cover-image-uploads', __( 'Cover Image Uploads', 'buddypress' ), 'bp_admin_setting_callback_cover_image_uploads', 'buddypress', 'bp_xprofile' ); 
  397. register_setting( 'buddypress', 'bp-disable-cover-image-uploads', 'intval' ); 
  398.  
  399. // Profile sync setting. 
  400. add_settings_field( 'bp-disable-profile-sync', __( 'Profile Syncing', 'buddypress' ), 'bp_admin_setting_callback_profile_sync', 'buddypress', 'bp_xprofile' ); 
  401. register_setting ( 'buddypress', 'bp-disable-profile-sync', 'intval' ); 
  402.  
  403. /** Groups Section ****************************************************/ 
  404.  
  405. if ( bp_is_active( 'groups' ) ) { 
  406.  
  407. // Add the main section. 
  408. add_settings_section( 'bp_groups', __( 'Groups Settings', 'buddypress' ), 'bp_admin_setting_callback_groups_section', 'buddypress' ); 
  409.  
  410. // Allow subscriptions setting. 
  411. add_settings_field( 'bp_restrict_group_creation', __( 'Group Creation', 'buddypress' ), 'bp_admin_setting_callback_group_creation', 'buddypress', 'bp_groups' ); 
  412. register_setting( 'buddypress', 'bp_restrict_group_creation', 'intval' ); 
  413.  
  414. // Allow group avatars. 
  415. add_settings_field( 'bp-disable-group-avatar-uploads', __( 'Group Photo Uploads', 'buddypress' ), 'bp_admin_setting_callback_group_avatar_uploads', 'buddypress', 'bp_groups' ); 
  416. register_setting( 'buddypress', 'bp-disable-group-avatar-uploads', 'intval' ); 
  417.  
  418. // Allow group cover images. 
  419. if ( bp_is_active( 'groups', 'cover_image' ) ) { 
  420. 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' ); 
  421. register_setting( 'buddypress', 'bp-disable-group-cover-image-uploads', 'intval' ); 
  422.  
  423. /** Forums ************************************************************/ 
  424.  
  425. if ( bp_is_active( 'forums' ) ) { 
  426.  
  427. // Add the main section. 
  428. add_settings_section( 'bp_forums', __( 'Legacy Group Forums', 'buddypress' ), 'bp_admin_setting_callback_bbpress_section', 'buddypress' ); 
  429.  
  430. // Allow subscriptions setting. 
  431. add_settings_field( 'bb-config-location', __( 'bbPress Configuration', 'buddypress' ), 'bp_admin_setting_callback_bbpress_configuration', 'buddypress', 'bp_forums' ); 
  432. register_setting( 'buddypress', 'bb-config-location', '' ); 
  433.  
  434. /** Activity Section **************************************************/ 
  435.  
  436. if ( bp_is_active( 'activity' ) ) { 
  437.  
  438. // Add the main section. 
  439. add_settings_section( 'bp_activity', __( 'Activity Settings', 'buddypress' ), 'bp_admin_setting_callback_activity_section', 'buddypress' ); 
  440.  
  441. // Activity commenting on blog and forum posts. 
  442. add_settings_field( 'bp-disable-blogforum-comments', __( 'Blog & Forum Comments', 'buddypress' ), 'bp_admin_setting_callback_blogforum_comments', 'buddypress', 'bp_activity' ); 
  443. register_setting( 'buddypress', 'bp-disable-blogforum-comments', 'bp_admin_sanitize_callback_blogforum_comments' ); 
  444.  
  445. // Activity Heartbeat refresh. 
  446. add_settings_field( '_bp_enable_heartbeat_refresh', __( 'Activity auto-refresh', 'buddypress' ), 'bp_admin_setting_callback_heartbeat', 'buddypress', 'bp_activity' ); 
  447. register_setting( 'buddypress', '_bp_enable_heartbeat_refresh', 'intval' ); 
  448.  
  449. // Allow activity akismet. 
  450. if ( is_plugin_active( 'akismet/akismet.php' ) && defined( 'AKISMET_VERSION' ) ) { 
  451. add_settings_field( '_bp_enable_akismet', __( 'Akismet', 'buddypress' ), 'bp_admin_setting_callback_activity_akismet', 'buddypress', 'bp_activity' ); 
  452. register_setting( 'buddypress', '_bp_enable_akismet', 'intval' ); 
  453.  
  454. /** 
  455. * Add a link to BuddyPress About page to the admin bar. 
  456. * 
  457. * @since 1.9.0 
  458. * 
  459. * @param WP_Admin_Bar $wp_admin_bar As passed to 'admin_bar_menu'. 
  460. */ 
  461. public function admin_bar_about_link( $wp_admin_bar ) { 
  462. if ( is_user_logged_in() ) { 
  463. $wp_admin_bar->add_menu( array( 
  464. 'parent' => 'wp-logo',  
  465. 'id' => 'bp-about',  
  466. 'title' => esc_html__( 'About BuddyPress', 'buddypress' ),  
  467. 'href' => add_query_arg( array( 'page' => 'bp-about' ), bp_get_admin_url( 'index.php' ) ),  
  468. ) ); 
  469.  
  470. /** 
  471. * Add Settings link to plugins area. 
  472. * 
  473. * @since 1.6.0 
  474. * 
  475. * @param array $links Links array in which we would prepend our link. 
  476. * @param string $file Current plugin basename. 
  477. * @return array Processed links. 
  478. */ 
  479. public function modify_plugin_action_links( $links, $file ) { 
  480.  
  481. // Return normal links if not BuddyPress. 
  482. if ( plugin_basename( buddypress()->basename ) != $file ) { 
  483. return $links; 
  484.  
  485. // Add a few links to the existing links array. 
  486. return array_merge( $links, array( 
  487. 'settings' => '<a href="' . esc_url( add_query_arg( array( 'page' => 'bp-components' ), bp_get_admin_url( $this->settings_page ) ) ) . '">' . esc_html__( 'Settings', 'buddypress' ) . '</a>',  
  488. 'about' => '<a href="' . esc_url( add_query_arg( array( 'page' => 'bp-about' ), bp_get_admin_url( 'index.php' ) ) ) . '">' . esc_html__( 'About', 'buddypress' ) . '</a>' 
  489. ) ); 
  490.  
  491. /** 
  492. * Add some general styling to the admin area. 
  493. * 
  494. * @since 1.6.0 
  495. */ 
  496. public function admin_head() { 
  497.  
  498. // Settings pages. 
  499. remove_submenu_page( $this->settings_page, 'bp-page-settings' ); 
  500. remove_submenu_page( $this->settings_page, 'bp-settings' ); 
  501.  
  502. // Network Admin Tools. 
  503. remove_submenu_page( 'network-tools', 'network-tools' ); 
  504.  
  505. // About and Credits pages. 
  506. remove_submenu_page( 'index.php', 'bp-about' ); 
  507. remove_submenu_page( 'index.php', 'bp-credits' ); 
  508.  
  509. /** 
  510. * Add some general styling to the admin area. 
  511. * 
  512. * @since 1.6.0 
  513. */ 
  514. public function enqueue_scripts() { 
  515. wp_enqueue_style( 'bp-admin-common-css' ); 
  516.  
  517. /** About *****************************************************************/ 
  518.  
  519. /** 
  520. * Output the about screen. 
  521. * 
  522. * @since 1.7.0 
  523. */ 
  524. public function about_screen() { 
  525. ?> 
  526.  
  527. <div class="wrap about-wrap"> 
  528.  
  529. <?php self::welcome_text(); ?> 
  530.  
  531. <?php self::tab_navigation( __METHOD__ ); ?> 
  532.  
  533. <?php if ( self::is_new_install() ) : ?> 
  534.  
  535. <div id="welcome-panel" class="welcome-panel"> 
  536. <div class="welcome-panel-content"> 
  537. <h3 style="margin:0"><?php _e( 'Getting Started with BuddyPress', 'buddypress' ); ?></h3> 
  538. <div class="welcome-panel-column-container"> 
  539. <div class="welcome-panel-column"> 
  540. <h4><?php _e( 'Configure BuddyPress', 'buddypress' ); ?></h4> 
  541. <ul> 
  542. <li><?php printf( 
  543. '<a href="%s" class="welcome-icon welcome-edit-page">' . __( 'Set Up Components', 'buddypress' ) . '</a>', esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-components' ), $this->settings_page ) ) ) 
  544. ); ?></li> 
  545. <li><?php printf( 
  546. '<a href="%s" class="welcome-icon welcome-edit-page">' . __( 'Assign Components to Pages', 'buddypress' ) . '</a>', esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-page-settings' ), $this->settings_page ) ) ) 
  547. ); ?></li> 
  548. <li><?php printf( 
  549. '<a href="%s" class="welcome-icon welcome-edit-page">' . __( 'Customize Settings', 'buddypress' ) . '</a>', esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-settings' ), $this->settings_page ) ) ) 
  550. ); ?></li> 
  551. </ul> 
  552. <a class="button button-primary button-hero" style="margin-bottom:20px;margin-top:0;" href="<?php echo esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-components' ), $this->settings_page ) ) ); ?>"><?php _e( 'Get Started', 'buddypress' ); ?></a> 
  553. </div> 
  554. <div class="welcome-panel-column"> 
  555. <h4><?php _e( 'Administration Tools', 'buddypress' ); ?></h4> 
  556. <ul> 
  557. <?php if ( bp_is_active( 'members' ) ) : ?> 
  558. <li><?php printf( '<a href="%s" class="welcome-icon welcome-add-page">' . __( 'Add User Profile Fields', 'buddypress' ) . '</a>', esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-profile-setup' ), 'users.php' ) ) ) ); ?></li> 
  559. <?php endif; ?> 
  560. <li><?php printf( '<a href="%s" class="welcome-icon welcome-add-page">' . __( 'Manage User Signups', 'buddypress' ) . '</a>', esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-signups' ), 'users.php' ) ) ) ); ?></li> 
  561. <?php if ( bp_is_active( 'activity' ) ) : ?> 
  562. <li><?php printf( '<a href="%s" class="welcome-icon welcome-add-page">' . __( 'Moderate Activity Streams', 'buddypress' ) . '</a>', esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-activity' ), 'admin.php' ) ) ) ); ?></li> 
  563. <?php endif; ?> 
  564. <?php if ( bp_is_active( 'groups' ) ) : ?> 
  565. <li><?php printf( '<a href="%s" class="welcome-icon welcome-add-page">' . __( 'Manage Groups', 'buddypress' ) . '</a>', esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-groups' ), 'admin.php' ) ) ) ); ?></li> 
  566. <?php endif; ?> 
  567. <li><?php printf( '<a href="%s" class="welcome-icon welcome-add-page">' . __( 'Repair Data', 'buddypress' ) . '</a>', esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-tools' ), 'tools.php' ) ) ) ); ?> 
  568. </li> 
  569. </ul> 
  570. </div> 
  571. <div class="welcome-panel-column welcome-panel-last"> 
  572. <h4><?php _e( 'Community and Support', 'buddypress' ); ?></h4> 
  573. <p class="welcome-icon welcome-learn-more" style="margin-right:10px"><?php _e( 'Looking for help? The <a href="https://codex.buddypress.org/">BuddyPress Codex</a> has you covered.', 'buddypress' ) ?></p> 
  574. <p class="welcome-icon welcome-learn-more" style="margin-right:10px"><?php _e( 'Can’t find what you need? Stop by <a href="https://buddypress.org/support/">our support forums</a>, where active BuddyPress users and developers are waiting to share tips and more.', 'buddypress' ) ?></p> 
  575. </div> 
  576. </div> 
  577. </div> 
  578. </div> 
  579.  
  580. <?php endif; ?> 
  581.  
  582. <div class="bp-headline-feature"> 
  583. <div class="bp-headline"> 
  584. <h3 class="headline-title"><?php esc_html_e( 'Modernizing the Codebase', 'buddypress' ); ?></h3> 
  585. <p class="introduction"><?php 
  586. /** translators: 1: BP REST API, 2: Link to Codex article */ 
  587. printf( __( 'To continue the migration of legacy code to modern standards and techniques necessary for the %1$s project and other new features moving forward, <a href="%2$s">BuddyPress 2.8 requires at least PHP 5.3</a>. This will allow us to build better, robust, and secure code, benefitting developers and users now and in the future.', 'buddypress'),  
  588. '<code>BP REST API</code>',  
  589. 'https://codex.buddypress.org/getting-started/buddypress-2-8-will-require-php-5-3/' ); 
  590. ?></p> 
  591. </div> 
  592. </div> 
  593.  
  594. <div class="bp-features-section"> 
  595.  
  596. <h3 class="headline-title"><?php esc_html_e( 'For Developers & Site Builders', 'buddypress' ); ?></h3> 
  597.  
  598. <div class="bp-feature-with-images"> 
  599.  
  600. <div class="bp-feature-imaged"> 
  601. <h4 class="feature-title"><?php esc_html_e( 'More helpful "Activate Pending Accounts" screen', 'buddypress' ); ?></h4> 
  602. <img src="<?php echo esc_url( buddypress()->plugin_url . 'bp-core/admin/images/pending-accounts.png' ); ?>" alt="<?php esc_attr_e( 'The improved pending account screen.', 'buddypress' ); ?>"> 
  603. <p><?php esc_html_e( 'When you click on the username on the "Users > Manage Signups" page, you can now view profile data entered by the user at the time of registration.', 'buddypress' ); ?></p> 
  604. </div> 
  605.  
  606. <div class="bp-feature-imaged anon"> 
  607. <h4 class="feature-title"><?php 
  608. /** translators: %s: List-Unsubscribe */ 
  609. printf( __( 'Support for %s header in emails', 'buddypress' ),  
  610. '<code>List-Unsubscribe</code>' ); 
  611. ?></h4> 
  612. <img src="<?php echo esc_url( buddypress()->plugin_url . 'bp-core/admin/images/list-unsubscribe.png' ); ?>" alt="<?php esc_attr_e( 'Email header showing the list-unsubscribe feature.', 'buddypress' ); ?>"> 
  613. <p><?php esc_html_e( 'Allow users to unsubscribe from BuddyPress email notifications in some email clients such as Gmail (web), when properly configured.', 'buddypress' ); ?></p> 
  614. </div> 
  615.  
  616. <div class="bp-feature-imaged"> 
  617. <h4 class="feature-title"><?php esc_html_e( 'Twenty Seventeen Companion Stylesheet', 'buddypress' ); ?></h4> 
  618. <p><?php esc_html_e( 'BuddyPress looks great in WordPress\'s latest default theme with the new Twenty Seventeen companion stylesheet.', 'buddypress' ); ?></p> 
  619. <p><?php 
  620. /** translators: 1: Link to the Codex article, 2: functions.php */ 
  621. printf( __( 'To change the default two-column page layout to a full-width layout as seen in the image, add the <a href="%1$s">following code</a> to the %2$s file of your Twenty Seventeen child theme.', 'buddypress' ),  
  622. 'https://codex.buddypress.org/themes/bp-theme-compatibility-and-the-wordpress-default-themes/twenty-seventeen-theme/',  
  623. '<code>functions.php</code>' ); 
  624. ?></p> 
  625. </div> 
  626.  
  627. <div class="bp-feature-imaged anon"> 
  628. <img src="<?php echo esc_url( buddypress()->plugin_url . 'bp-core/admin/images/twenty-seventeen.png' ); ?>" alt="<?php esc_attr_e( 'Full-width BuddyPress layout for Twenty Seventeen theme.', 'buddypress' ); ?>"> 
  629. </div> 
  630.  
  631. <div class="clear"></div> 
  632. </div> 
  633.  
  634. <div class="bp-feature"> 
  635. <span class="dashicons dashicons-testimonial" aria-hidden="true"></span> 
  636. <h4 class="feature-title"><?php esc_html_e( 'More hooks for Messages', 'buddypress' ); ?></h4> 
  637. <p><?php esc_html_e( 'We\'ve added new filters and actions for different methods throughout the Messages component.', 'buddypress' ); ?></p> 
  638. </div> 
  639.  
  640. <div class="bp-feature opposite"> 
  641. <span class="dashicons dashicons-search" aria-hidden="true"></span> 
  642. <h4 class="feature-title"><?php esc_html_e( 'A more flexible Group search', 'buddypress' ); ?></h4> 
  643. <p><?php 
  644. /** translators: 1: search_column, 2: BP_Groups_Group::get() */ 
  645. printf( __( 'The new %1$s parameter allows developers to specify which columns should be matched, as well as where wildcard characters should be placed, when searching via %2$s.', 'buddypress' ),  
  646. '<code>search_column</code>',  
  647. '<code>BP_Groups_Group::get()</code>' ); 
  648. ?></p> 
  649. </div> 
  650.  
  651. <div class="bp-feature"> 
  652. <span class="dashicons dashicons-groups" aria-hidden="true"></span> 
  653. <h4 class="feature-title"><?php esc_html_e( 'Alphabetical sorting for Groups widget', 'buddypress' ); ?></h4> 
  654. <p><?php esc_html_e( 'The groups widget can now be sorted alphabetically, in addition to sorting the results by recently active, popular, and newest groups.', 'buddypress' ); ?></p> 
  655. </div> 
  656.  
  657. <div class="bp-feature opposite"> 
  658. <span class="dashicons dashicons-email" aria-hidden="true"></span> 
  659. <h4 class="feature-title"><?php 
  660. /** translators: %s: PHPMailer */ 
  661. printf( __( 'Enable choice of %s', 'buddypress' ), '<code>PHPMailer</code>' ); 
  662. ?></h4> 
  663. <p><?php 
  664. /** translators: %s: PHPMailer */ 
  665. printf( __( 'Developers can specify which %s should be used when sending BuddyPress with a new filter.', 'buddypress' ), '<code>PHPMailer</code>' ); 
  666. ?></p> 
  667. </div> 
  668.  
  669. <div class="clear"></div> 
  670. </div> 
  671.  
  672. <div class="bp-changelog-section"> 
  673. <h3 class="changelog-title"><?php esc_html_e( 'More under the hood …', 'buddypress' ); ?></h3> 
  674. <div class="bp-changelog three-col"> 
  675. <div class="col"> 
  676. <h4 class="title"><?php esc_html_e( 'Localization Improvements', 'buddypress' ); ?></h4> 
  677. <p><?php esc_html_e( 'We continue to improve our localization internals, making it easier for translation editors to ensure that BuddyPress will be available for everyone in their own language.', 'buddypress' ); ?></p> 
  678. </div> 
  679. <div class="col"> 
  680. <h4 class="title"><?php esc_html_e( 'Developer Reference', 'buddypress' ); ?></h4> 
  681. <p><?php esc_html_e( 'Regular updates to inline code documentation make it easier for developers to understand how BuddyPress works.', 'buddypress' ); ?></p> 
  682. </div> 
  683.  
  684. <div class="col"> 
  685. <h4 class="title"><?php esc_html_e( 'Accessibility Upgrades', 'buddypress' ); ?></h4> 
  686. <p><?php esc_html_e( 'Continued improvements for universal access help make BuddyPress back- and front-end screens usable for everyone (and on more devices).', 'buddypress' ); ?></p> 
  687. </div> 
  688. </div> 
  689. <div class="clear"></div> 
  690. </div> 
  691.  
  692. <div class="bp-assets"> 
  693. <p><?php _ex( 'Learn more:', 'About screen, website links', 'buddypress' ); ?> <a href="https://buddypress.org/blog/"><?php _ex( 'News', 'About screen, link to project blog', 'buddypress' ); ?></a> • <a href="https://buddypress.org/support/"><?php _ex( 'Support', 'About screen, link to support site', 'buddypress' ); ?></a> • <a href="https://codex.buddypress.org/"><?php _ex( 'Documentation', 'About screen, link to documentation', 'buddypress' ); ?></a> • <a href="https://bpdevel.wordpress.com/"><?php _ex( 'Development Blog', 'About screen, link to development blog', 'buddypress' ); ?></a></p> 
  694.  
  695. <p><?php _ex( 'Twitter:', 'official Twitter accounts:', 'buddypress' ); ?> <a href="https://twitter.com/buddypress/"><?php _ex( 'BuddyPress', '@buddypress twitter account name', 'buddypress' ); ?></a> • <a href="https://twitter.com/bptrac/"><?php _ex( 'Trac', '@bptrac twitter account name', 'buddypress' ); ?></a> • <a href="https://twitter.com/buddypressdev/"><?php _ex( 'Development', '@buddypressdev twitter account name', 'buddypress' ); ?></a></p> 
  696. </div> 
  697.  
  698. </div> 
  699.  
  700. <?php 
  701.  
  702. /** 
  703. * Output the credits screen. 
  704. * 
  705. * Hardcoding this in here is pretty janky. It's fine for now, but we'll 
  706. * want to leverage api.wordpress.org eventually. 
  707. * 
  708. * @since 1.7.0 
  709. */ 
  710. public function credits_screen() { 
  711. ?> 
  712.  
  713. <div class="wrap about-wrap"> 
  714.  
  715. <?php self::welcome_text(); ?> 
  716.  
  717. <?php self::tab_navigation( __METHOD__ ); ?> 
  718.  
  719. <p class="about-description"><?php _e( 'BuddyPress is created by a worldwide network of friendly folks like these.', 'buddypress' ); ?></p> 
  720.  
  721. <h3 class="wp-people-group"><?php _e( 'Project Leaders', 'buddypress' ); ?></h3> 
  722. <ul class="wp-people-group " id="wp-people-group-project-leaders"> 
  723. <li class="wp-person" id="wp-person-johnjamesjacoby"> 
  724. <a class="web" href="https://profiles.wordpress.org/johnjamesjacoby"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/7a2644fb53ae2f7bfd7143b504af396c?s=60"> 
  725. John James Jacoby</a> 
  726. <span class="title"><?php _e( 'Project Lead', 'buddypress' ); ?></span> 
  727. </li> 
  728. <li class="wp-person" id="wp-person-boonebgorges"> 
  729. <a class="web" href="https://profiles.wordpress.org/boonebgorges"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/9cf7c4541a582729a5fc7ae484786c0c?s=60"> 
  730. Boone B. Gorges</a> 
  731. <span class="title"><?php _e( 'Lead Developer', 'buddypress' ); ?></span> 
  732. </li> 
  733. <li class="wp-person" id="wp-person-djpaul"> 
  734. <a class="web" href="https://profiles.wordpress.org/djpaul"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/3bc9ab796299d67ce83dceb9554f75df?s=60"> 
  735. Paul Gibbs</a> 
  736. <span class="title"><?php _e( 'Lead Developer', 'buddypress' ); ?></span> 
  737. </li> 
  738. </ul> 
  739.  
  740. <h3 class="wp-people-group"><?php _e( 'BuddyPress Team', 'buddypress' ); ?></h3> 
  741. <ul class="wp-people-group " id="wp-people-group-core-team"> 
  742. <li class="wp-person" id="wp-person-slaffik"> 
  743. <a class="web" href="https://profiles.wordpress.org/r-a-y"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/61fb07ede3247b63f19015f200b3eb2c?s=60"> 
  744. Slava Abakumov</a> 
  745. <span class="title"><?php _e( '2.8 Release Lead', 'buddypress' ); ?></span> 
  746. </li> 
  747. <li class="wp-person" id="wp-person-r-a-y"> 
  748. <a class="web" href="https://profiles.wordpress.org/r-a-y"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/3bfa556a62b5bfac1012b6ba5f42ebfa?s=60"> 
  749. Ray</a> 
  750. <span class="title"><?php _e( 'Core Developer', 'buddypress' ); ?></span> 
  751. </li> 
  752. <li class="wp-person" id="wp-person-imath"> 
  753. <a class="web" href="https://profiles.wordpress.org/imath"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/8b208ca408dad63888253ee1800d6a03?s=60"> 
  754. Mathieu Viet</a> 
  755. <span class="title"><?php _e( 'Core Developer', 'buddypress' ); ?></span> 
  756. </li> 
  757. <li class="wp-person" id="wp-person-mercime"> 
  758. <a class="web" href="https://profiles.wordpress.org/mercime"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/fae451be6708241627983570a1a1817a?s=60"> 
  759. Mercime</a> 
  760. <span class="title"><?php _e( 'Navigator', 'buddypress' ); ?></span> 
  761. </li> 
  762. <li class="wp-person" id="wp-person-dcavins"> 
  763. <a class="web" href="https://profiles.wordpress.org/dcavins"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/a5fa7e83d59cb45ebb616235a176595a?s=60"> 
  764. David Cavins</a> 
  765. <span class="title"><?php _e( 'Core Developer', 'buddypress' ); ?></span> 
  766. </li> 
  767. <li class="wp-person" id="wp-person-tw2113"> 
  768. <a class="web" href="https://profiles.wordpress.org/tw2113"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/a5d7c934621fa1c025b83ee79bc62366?s=60"> 
  769. Michael Beckwith</a> 
  770. <span class="title"><?php _e( 'Core Developer', 'buddypress' ); ?></span> 
  771. </li> 
  772. <li class="wp-person" id="wp-person-hnla"> 
  773. <a class="web" href="https://profiles.wordpress.org/hnla"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/3860c955aa3f79f13b92826ae47d07fe?s=60"> 
  774. Hugo</a> 
  775. <span class="title"><?php _e( 'Core Developer', 'buddypress' ); ?></span> 
  776. </li> 
  777. <li class="wp-person" id="wp-person-henry-wright"> 
  778. <a class="web" href="https://profiles.wordpress.org/henry.wright"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/0da2f1a9340d6af196b870f6c107a248?s=60"> 
  779. Henry Wright</a> 
  780. <span class="title"><?php _e( 'Community Support', 'buddypress' ); ?></span> 
  781. </li> 
  782. <li class="wp-person" id="wp-person-danbp"> 
  783. <a class="web" href="https://profiles.wordpress.org/danbp"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/0deae2e7003027fbf153500cd3fa5501?s=60"> 
  784. danbp</a> 
  785. <span class="title"><?php _e( 'Community Support', 'buddypress' ); ?></span> 
  786. </li> 
  787. <li class="wp-person" id="wp-person-shanebp"> 
  788. <a class="web" href="https://profiles.wordpress.org/shanebp"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/ffd294ab5833ba14aaf175f9acc71cc4?s=60"> 
  789. shanebp</a> 
  790. <span class="title"><?php _e( 'Community Support', 'buddypress' ); ?></span> 
  791. </li> 
  792.  
  793. <li class="wp-person" id="wp-person-offereins"> 
  794. <a class="web" href="https://profiles.wordpress.org/Offereins"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/2404ed0a35bb41aedefd42b0a7be61c1?s=60"> 
  795. Laurens Offereins</a> 
  796. <span class="title"><?php _e( 'Core Developer', 'buddypress' ); ?></span> 
  797. </li> 
  798. <li class="wp-person" id="wp-person-netweb"> 
  799. <a class="web" href="https://profiles.wordpress.org/netweb"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/97e1620b501da675315ba7cfb740e80f?s=60"> 
  800. Stephen Edgar</a> 
  801. <span class="title"><?php _e( 'Core Developer', 'buddypress' ); ?></span> 
  802. </li> 
  803. </ul> 
  804.  
  805. <h3 class="wp-people-group"><?php _e( '🌟Recent Rockstars🌟', 'buddypress' ); ?></h3> 
  806. <ul class="wp-people-group " id="wp-people-group-rockstars"> 
  807. <li class="wp-person" id="wp-person-dimensionmedia"> 
  808. <a class="web" href="https://profiles.wordpress.org/dimensionmedia"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/7735aada1ec39d0c1118bd92ed4551f1?s=60"> 
  809. David Bisset</a> 
  810. </li> 
  811. <li class="wp-person" id="wp-person-garrett-eclipse"> 
  812. <a class="web" href="https://profiles.wordpress.org/garrett-eclipse"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/7f68f24441c61514d5d0e1451bb5bc9d?s=60"> 
  813. Garrett Hyder</a> 
  814. </li> 
  815. <li class="wp-person" id="wp-person-thebrandonallen"> 
  816. <a class="web" href="https://profiles.wordpress.org/thebrandonallen"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/6d3f77bf3c9ca94c406dea401b566950?s=60"> 
  817. Brandon Allen</a> 
  818. </li> 
  819. <li class="wp-person" id="wp-person-ramiy"> 
  820. <a class="web" href="https://profiles.wordpress.org/ramiy"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/ce2a269e424156d79cb0c4e1d4d82db1?s=60"> 
  821. Rami Yushuvaev</a> 
  822. </li> 
  823. </ul> 
  824.  
  825. <h3 class="wp-people-group"><?php printf( esc_html__( 'Contributors to BuddyPress %s', 'buddypress' ), self::display_version() ); ?></h3> 
  826. <p class="wp-credits-list"> 
  827. <a href="https://profiles.wordpress.org/dontdream/">Andrea Tarantini (dontdream)</a>,  
  828. <a href="https://profiles.wordpress.org/ankit-k-gupta/">Ankit K Gupta (ankit-k-gupta)</a>,  
  829. <a href="https://profiles.wordpress.org/angeljs/">angeljs</a>,  
  830. <a href="https://profiles.wordpress.org/boonebgorges/">Boone B Gorges (boonebgorges)</a>,  
  831. <a href="https://profiles.wordpress.org/thebrandonallen/">Brandon Allen (thebrandonallen)</a>,  
  832. <a href="https://profiles.wordpress.org/bhargavbhandari90/">Bunty (bhargavbhandari90)</a>,  
  833. <a href="https://profiles.wordpress.org/ketuchetan/">chetansatasiya (ketuchetan)</a>,  
  834. <a href="https://profiles.wordpress.org/chiragpatel/">Chirag Patel (chiragpatel)</a>,  
  835. <a href="https://profiles.wordpress.org/danbp/">danbp</a>,  
  836. <a href="https://profiles.wordpress.org/dcavins/">David Cavins (dcavins)</a>,  
  837. <a href="https://profiles.wordpress.org/wpdennis/">Dennis (wpdennis)</a>,  
  838. <a href="https://profiles.wordpress.org/Dianakc/">Diana K. Cury (Dianakc)</a>,  
  839. <a href="https://profiles.wordpress.org/finzend/">finzend</a>,  
  840. <a href="https://profiles.wordpress.org/hnla/">Hugo (hnla)</a>,  
  841. <a href="https://profiles.wordpress.org/jdgrimes/">J.D. Grimes (jdgrimes)</a>,  
  842. <a href="https://profiles.wordpress.org/johnjamesjacoby/">John James Jacoby (johnjamesjacoby)</a>,  
  843. <a href="https://profiles.wordpress.org/jonas-lundman/">Jonas Lundman (jonas-lundman)</a>,  
  844. <a href="https://profiles.wordpress.org/jonieske/">jonieske</a>,  
  845. <a href="https://profiles.wordpress.org/jreeve/">jreeve</a>,  
  846. <a href="https://profiles.wordpress.org/lakrisgubben/">lakrisgubben</a>,  
  847. <a href="https://profiles.wordpress.org/Offereins">Laurens Offereins (Offereins)</a>,  
  848. <a href="https://profiles.wordpress.org/lgreenwoo/">lgreenwoo</a>,  
  849. <a href="https://profiles.wordpress.org/maccast/">maccast</a>,  
  850. <a href="https://profiles.wordpress.org/imath/">Mathieu Viet (imath)</a>,  
  851. <a href="https://profiles.wordpress.org/mchansy/">mchansy</a>,  
  852. <a href="https://profiles.wordpress.org/mercime/">mercime</a>,  
  853. <a href="https://profiles.wordpress.org/tw2113/">Michael Beckwith (tw2113)</a>,  
  854. <a href="https://profiles.wordpress.org/modemlooper/">modemlooper</a>,  
  855. <a href="https://profiles.wordpress.org/m_uysl/">Mustafa Uysal (m_uysl)</a>,  
  856. <a href="https://profiles.wordpress.org/nickmomrik/">Nick Momrik (nickmomrik)</a>,  
  857. <a href="https://profiles.wordpress.org/DJPaul/">Paul Gibbs (DJPaul)</a>,  
  858. <a href="https://profiles.wordpress.org/pareshradadiya/">paresh.radadiya (pareshradadiya)</a>,  
  859. <a href="https://profiles.wordpress.org/petya/">Petya Raykovska</a>,  
  860. <a href="https://profiles.wordpress.org/r-a-y/">r-a-y</a>,  
  861. <a href="https://profiles.wordpress.org/rekmla/">rekmla</a>,  
  862. <a href="https://profiles.wordpress.org/espellcaste/">Renato Alves (espellcaste)</a>,  
  863. <a href="https://profiles.wordpress.org/rogercoathup/">Roger Coathup (rogercoathup)</a>,  
  864. <a href="https://profiles.wordpress.org/DarkWolf/">Salvatore (DarkWolf)</a>,  
  865. <a href="https://profiles.wordpress.org/sanket.parmar/">Sanket Parmar (sanket.parmar)</a>,  
  866. <a href="https://profiles.wordpress.org/slaffik/">Slava Abakumov (slaffik)</a>,  
  867. <a href="https://profiles.wordpress.org/stagger-lee/">Stagger Lee (stagger-lee)</a>,  
  868. <a href="https://profiles.wordpress.org/netweb/">Stephen Edgar (netweb)</a>,  
  869. <a href="https://profiles.wordpress.org/mahype/">Sven Wagener (mahype)</a>,  
  870. <a href="https://profiles.wordpress.org/wordpressrene/">wordpressrene</a>. 
  871. </p> 
  872.  
  873. <h3 class="wp-people-group"><?php _e( '💖With our thanks to these Open Source projects💖', 'buddypress' ); ?></h3> 
  874. <p class="wp-credits-list"> 
  875. <a href="https://github.com/ichord/At.js">At.js</a>,  
  876. <a href="https://bbpress.org">bbPress</a>,  
  877. <a href="https://github.com/ichord/Caret.js">Caret.js</a>,  
  878. <a href="https://tedgoas.github.io/Cerberus/">Cerberus</a>,  
  879. <a href="https://ionicons.com/">Ionicons</a>,  
  880. <a href="https://github.com/carhartl/jquery-cookie">jquery.cookie</a>,  
  881. <a href="https://mattbradley.github.io/livestampjs/">Livestamp.js</a>,  
  882. <a href="https://www.mediawiki.org/wiki/MediaWiki">MediaWiki</a>,  
  883. <a href="http://momentjs.com/">Moment.js</a>,  
  884. <a href="https://wordpress.org">WordPress</a>. 
  885. </p> 
  886.  
  887. </div> 
  888.  
  889. <?php 
  890.  
  891. /** 
  892. * Output welcome text and badge for What's New and Credits pages. 
  893. * 
  894. * @since 2.2.0 
  895. */ 
  896. public static function welcome_text() { 
  897.  
  898. // Switch welcome text based on whether this is a new installation or not. 
  899. $welcome_text = ( self::is_new_install() ) 
  900. ? __( 'Thank you for installing BuddyPress! BuddyPress helps site builders and WordPress developers add community features to their websites, with user profile fields, activity streams, messaging, and notifications.', 'buddypress' ) 
  901. : __( 'Thank you for updating! BuddyPress %s has many new improvements that you will enjoy.', 'buddypress' ); 
  902.  
  903. ?> 
  904.  
  905. <h1><?php printf( esc_html__( 'Welcome to BuddyPress %s', 'buddypress' ), self::display_version() ); ?></h1> 
  906.  
  907. <div class="about-text"> 
  908. <?php 
  909. if ( self::is_new_install() ) { 
  910. echo $welcome_text; 
  911. } else { 
  912. printf( $welcome_text, self::display_version() ); 
  913. ?> 
  914. </div> 
  915.  
  916. <div class="bp-badge"></div> 
  917.  
  918. <?php 
  919.  
  920. /** 
  921. * Output tab navigation for `What's New` and `Credits` pages. 
  922. * 
  923. * @since 2.2.0 
  924. * 
  925. * @param string $tab Tab to highlight as active. 
  926. */ 
  927. public static function tab_navigation( $tab = 'whats_new' ) { 
  928. ?> 
  929.  
  930. <h2 class="nav-tab-wrapper"> 
  931. <a class="nav-tab <?php if ( 'BP_Admin::about_screen' === $tab ) : ?>nav-tab-active<?php endif; ?>" href="<?php echo esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-about' ), 'index.php' ) ) ); ?>"> 
  932. <?php esc_html_e( 'What’s New', 'buddypress' ); ?> 
  933. </a><a class="nav-tab <?php if ( 'BP_Admin::credits_screen' === $tab ) : ?>nav-tab-active<?php endif; ?>" href="<?php echo esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-credits' ), 'index.php' ) ) ); ?>"> 
  934. <?php esc_html_e( 'Credits', 'buddypress' ); ?> 
  935. </a> 
  936. </h2> 
  937.  
  938. <?php 
  939.  
  940. /** Emails ****************************************************************/ 
  941.  
  942. /** 
  943. * Registers 'Situations' column on Emails dashboard page. 
  944. * 
  945. * @since 2.6.0 
  946. * 
  947. * @param array $columns Current column data. 
  948. * @return array 
  949. */ 
  950. public function emails_register_situation_column( $columns = array() ) { 
  951. $situation = array( 
  952. 'situation' => _x( 'Situations', 'Email post type', 'buddypress' ) 
  953. ); 
  954.  
  955. // Inject our 'Situations' column just before the last 'Date' column. 
  956. return array_slice( $columns, 0, -1, true ) + $situation + array_slice( $columns, -1, null, true ); 
  957.  
  958. /** 
  959. * Output column data for our custom 'Situations' column. 
  960. * 
  961. * @since 2.6.0 
  962. * 
  963. * @param string $column Current column name. 
  964. * @param int $post_id Current post ID. 
  965. */ 
  966. public function emails_display_situation_column_data( $column = '', $post_id = 0 ) { 
  967. if ( 'situation' !== $column ) { 
  968. return; 
  969.  
  970. // Grab email situations for the current post. 
  971. $situations = wp_list_pluck( get_the_terms( $post_id, bp_get_email_tax_type() ), 'description' ); 
  972.  
  973. // Output each situation as a list item. 
  974. echo '<ul><li>'; 
  975. echo implode( '</li><li>', $situations ); 
  976. echo '</li></ul>'; 
  977.  
  978. /** Helpers ***************************************************************/ 
  979.  
  980. /** 
  981. * Return true/false based on whether a query argument is set. 
  982. * 
  983. * @see bp_do_activation_redirect() 
  984. * 
  985. * @since 2.2.0 
  986. * 
  987. * @return bool 
  988. */ 
  989. public static function is_new_install() { 
  990. return (bool) isset( $_GET['is_new_install'] ); 
  991.  
  992. /** 
  993. * Return a user-friendly version-number string, for use in translations. 
  994. * 
  995. * @since 2.2.0 
  996. * 
  997. * @return string 
  998. */ 
  999. public static function display_version() { 
  1000.  
  1001. // Use static variable to prevent recalculations. 
  1002. static $display = ''; 
  1003.  
  1004. // Only calculate on first run. 
  1005. if ( '' === $display ) { 
  1006.  
  1007. // Get current version. 
  1008. $version = bp_get_version(); 
  1009.  
  1010. // Check for prerelease hyphen. 
  1011. $pre = strpos( $version, '-' ); 
  1012.  
  1013. // Strip prerelease suffix. 
  1014. $display = ( false !== $pre ) 
  1015. ? substr( $version, 0, $pre ) 
  1016. : $version; 
  1017.  
  1018. // Done! 
  1019. return $display; 
  1020.  
  1021. /** 
  1022. * Add Emails menu item to custom menus array. 
  1023. * 
  1024. * Several BuddyPress components have top-level menu items in the Dashboard,  
  1025. * which all appear together in the middle of the Dashboard menu. This function 
  1026. * adds the Emails screen to the array of these menu items. 
  1027. * 
  1028. * @since 2.4.0 
  1029. * 
  1030. * @param array $custom_menus The list of top-level BP menu items. 
  1031. * @return array $custom_menus List of top-level BP menu items, with Emails added. 
  1032. */ 
  1033. public function emails_admin_menu_order( $custom_menus = array() ) { 
  1034. array_push( $custom_menus, 'edit.php?post_type=' . bp_get_email_post_type() ); 
  1035.  
  1036. if ( is_network_admin() && bp_is_network_activated() ) { 
  1037. array_push( 
  1038. $custom_menus,  
  1039. get_admin_url( bp_get_root_blog_id(), 'edit.php?post_type=' . bp_get_email_post_type() ) 
  1040. ); 
  1041.  
  1042. return $custom_menus; 
  1043.  
  1044. /** 
  1045. * Register styles commonly used by BuddyPress wp-admin screens. 
  1046. * 
  1047. * @since 2.5.0 
  1048. */ 
  1049. public function admin_register_styles() { 
  1050. $min = bp_core_get_minified_asset_suffix(); 
  1051. $url = $this->css_url; 
  1052.  
  1053. /** 
  1054. * Filters the BuddyPress Core Admin CSS file path. 
  1055. * 
  1056. * @since 1.6.0 
  1057. * 
  1058. * @param string $file File path for the admin CSS. 
  1059. */ 
  1060. $common_css = apply_filters( 'bp_core_admin_common_css', "{$url}common{$min}.css" ); 
  1061.  
  1062. /** 
  1063. * Filters the BuddyPress admin stylesheet files to register. 
  1064. * 
  1065. * @since 2.5.0 
  1066. * 
  1067. * @param array $value Array of admin stylesheet file information to register. 
  1068. */ 
  1069. $styles = apply_filters( 'bp_core_admin_register_styles', array( 
  1070. // Legacy. 
  1071. 'bp-admin-common-css' => array( 
  1072. 'file' => $common_css,  
  1073. 'dependencies' => array(),  
  1074. ),  
  1075.  
  1076. // 2.5 
  1077. 'bp-customizer-controls' => array( 
  1078. 'file' => "{$url}customizer-controls{$min}.css",  
  1079. 'dependencies' => array(),  
  1080. ),  
  1081. ) ); 
  1082.  
  1083.  
  1084. $version = bp_get_version(); 
  1085.  
  1086. foreach ( $styles as $id => $style ) { 
  1087. wp_register_style( $id, $style['file'], $style['dependencies'], $version ); 
  1088. wp_style_add_data( $id, 'rtl', true ); 
  1089.  
  1090. if ( $min ) { 
  1091. wp_style_add_data( $id, 'suffix', $min ); 
  1092.  
  1093. /** 
  1094. * Register JS commonly used by BuddyPress wp-admin screens. 
  1095. * 
  1096. * @since 2.5.0 
  1097. */ 
  1098. public function admin_register_scripts() { 
  1099. $min = bp_core_get_minified_asset_suffix(); 
  1100. $url = $this->js_url; 
  1101.  
  1102. /** 
  1103. * Filters the BuddyPress admin JS files to register. 
  1104. * 
  1105. * @since 2.5.0 
  1106. * 
  1107. * @param array $value Array of admin JS file information to register. 
  1108. */ 
  1109. $scripts = apply_filters( 'bp_core_admin_register_scripts', array( 
  1110. // 2.5 
  1111. 'bp-customizer-controls' => array( 
  1112. 'file' => "{$url}customizer-controls{$min}.js",  
  1113. 'dependencies' => array( 'jquery' ),  
  1114. 'footer' => true,  
  1115. ),  
  1116. ) ); 
  1117.  
  1118. $version = bp_get_version(); 
  1119.  
  1120. foreach ( $scripts as $id => $script ) { 
  1121. wp_register_script( $id, $script['file'], $script['dependencies'], $version, $script['footer'] ); 
  1122. endif; // End class_exists check. 
.