BP_Admin

Load BuddyPress plugin admin area.

Defined (1)

The class is defined in the following location(s).

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