Changeset 13883 for trunk/src/bp-core/classes/class-bp-admin.php
- Timestamp:
- 06/01/2024 05:06:17 PM (4 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/classes/class-bp-admin.php
r13878 r13883 11 11 defined( 'ABSPATH' ) || exit; 12 12 13 if ( !class_exists( 'BP_Admin' ) ) : 13 if ( class_exists( 'BP_Admin' ) ) { 14 return; 15 } 14 16 15 17 /** … … 29 31 * 30 32 * @since 1.6.0 31 * @var string $admin_dir33 * @var string 32 34 */ 33 35 public $admin_dir = ''; … … 37 39 /** 38 40 * URL to the BuddyPress admin directory. 39 *40 * @since 1.6.041 * @var string $admin_url42 */43 public $admin_url = '';44 45 /**46 * URL to the BuddyPress images directory.47 *48 * @since 1.6.049 * @var string $images_url50 */51 public $images_url = '';52 53 /**54 * URL to the BuddyPress admin CSS directory.55 *56 * @since 1.6.057 * @var string $css_url58 */59 public $css_url = '';60 61 /**62 * URL to the BuddyPress admin JS directory.63 41 * 64 42 * @since 1.6.0 65 43 * @var string 66 44 */ 45 public $admin_url = ''; 46 47 /** 48 * URL to the BuddyPress images directory. 49 * 50 * @since 1.6.0 51 * @var string 52 */ 53 public $images_url = ''; 54 55 /** 56 * URL to the BuddyPress admin CSS directory. 57 * 58 * @since 1.6.0 59 * @var string 60 */ 61 public $css_url = ''; 62 63 /** 64 * URL to the BuddyPress admin JS directory. 65 * 66 * @since 1.6.0 67 * @var string 68 */ 67 69 public $js_url = ''; 68 70 … … 73 75 * 74 76 * @since 1.9.0 75 * @var array ()77 * @var array 76 78 */ 77 79 public $notices = array(); … … 81 83 * 82 84 * @since 10.0.0 83 * @var array ()85 * @var array 84 86 */ 85 87 public $nav_tabs = array(); … … 89 91 * 90 92 * @since 10.0.0 91 * @var string ()93 * @var string 92 94 */ 93 95 public $active_nav_tab = ''; … … 97 99 * 98 100 * @since 10.0.0 99 * @var array ()101 * @var array 100 102 */ 101 103 public $submenu_pages = array(); … … 107 109 * 108 110 * @since 1.6.0 109 *110 111 */ 111 112 public function __construct() { … … 123 124 $bp = buddypress(); 124 125 125 // Paths and URLs 126 $this->admin_dir = trailingslashit( $bp->plugin_dir 127 $this->admin_url = trailingslashit( $bp->plugin_url 128 $this->images_url = trailingslashit( $this->admin_url . 'images' 129 $this->css_url = trailingslashit( $this->admin_url . 'css' 130 $this->js_url = trailingslashit( $this->admin_url . 'js' 126 // Paths and URLs. 127 $this->admin_dir = trailingslashit( $bp->plugin_dir . 'bp-core/admin' ); // Admin path. 128 $this->admin_url = trailingslashit( $bp->plugin_url . 'bp-core/admin' ); // Admin url. 129 $this->images_url = trailingslashit( $this->admin_url . 'images' ); // Admin images URL. 130 $this->css_url = trailingslashit( $this->admin_url . 'css' ); // Admin css URL. 131 $this->js_url = trailingslashit( $this->admin_url . 'js' ); // Admin css URL. 131 132 132 133 // Main settings page. … … 159 160 * 160 161 * @since 1.6.0 161 *162 162 */ 163 163 private function setup_actions() { … … 166 166 167 167 // Add some page specific output to the <head>. 168 add_action( 'bp_admin_head', array( $this, 'admin_head' 168 add_action( 'bp_admin_head', array( $this, 'admin_head' ), 999 ); 169 169 170 170 // Add menu item to settings menu. … … 225 225 add_filter( 'user_row_actions', 'bp_core_admin_user_row_actions', 10, 2 ); 226 226 227 // Emails 227 // Emails. 228 228 add_filter( 'bp_admin_menu_order', array( $this, 'emails_admin_menu_order' ), 20 ); 229 229 add_action( 'load-edit.php', array( $this, 'post_type_load_admin_screen' ), 20 ); … … 232 232 // Official BuddyPress supported Add-ons. 233 233 add_filter( 'install_plugins_tabs', array( $this, 'addons_tab' ) ); 234 add_filter( 'install_plugins_table_api_args_bp-add-ons', array( $this, 'addons_args' ) );234 add_filter( 'install_plugins_table_api_args_bp-add-ons', array( $this, 'addons_args' ) ); 235 235 } 236 236 … … 320 320 321 321 $this->submenu_pages['settings']['bp-admin-notifications'] = $bp_admin_notifications; 322 $hooks[] 322 $hooks[] = $bp_admin_notifications; 323 323 324 324 // Credits. … … 477 477 * 478 478 * @since 1.6.0 479 *480 479 */ 481 480 public function register_admin_settings() { … … 490 489 register_setting( 'buddypress', 'hide-loggedout-adminbar', 'intval' ); 491 490 492 // Community Visibility 491 // Community Visibility. 493 492 if ( 'rewrites' === bp_core_get_query_parser() ) { 494 493 add_settings_field( '_bp_community_visibility', __( 'Community Visibility', 'buddypress' ), 'bp_admin_setting_callback_community_visibility', 'buddypress', 'bp_main' ); … … 547 546 // Profile sync setting. 548 547 add_settings_field( 'bp-disable-profile-sync', __( 'Profile Syncing', 'buddypress' ), 'bp_admin_setting_callback_profile_sync', 'buddypress', 'bp_xprofile' ); 549 register_setting 548 register_setting( 'buddypress', 'bp-disable-profile-sync', 'intval' ); 550 549 } 551 550 … … 612 611 } 613 612 614 $wp_admin_bar->add_node( array( 615 'parent' => 'wp-logo', 616 'id' => 'bp-about', 617 'title' => esc_html_x( 'Hello, BuddyPress!', 'Colloquial alternative to "learn about BuddyPress"', 'buddypress' ), 618 'href' => bp_get_admin_url( '?hello=buddypress' ), 619 'meta' => array( 620 'class' => 'say-hello-buddypress', 621 ), 622 ) ); 613 $wp_admin_bar->add_node( 614 array( 615 'parent' => 'wp-logo', 616 'id' => 'bp-about', 617 'title' => esc_html_x( 'Hello, BuddyPress!', 'Colloquial alternative to "learn about BuddyPress"', 'buddypress' ), 618 'href' => bp_get_admin_url( '?hello=buddypress' ), 619 'meta' => array( 620 'class' => 'say-hello-buddypress', 621 ), 622 ) 623 ); 623 624 } 624 625 … … 635 636 636 637 // Return normal links if not BuddyPress. 637 if ( plugin_basename( buddypress()->basename ) != $file ) {638 if ( plugin_basename( buddypress()->basename ) !== $file ) { 638 639 return $links; 639 640 } … … 780 781 781 782 // Get BuddyPress stable version. 782 $version = 783 $version = self::display_version(); 783 784 $version_slug = 'version-' . str_replace( '.', '-', $version ); 784 785 … … 824 825 <h2> 825 826 <?php 826 printf(827 printf( 827 828 /* Translators: %s is a raising hands emoji. */ 828 829 esc_html__( 'You now have complete control over all BuddyPress-generated URLs %s', 'buddypress' ), … … 895 896 <h2> 896 897 <?php 897 printf(898 printf( 898 899 /* Translators: %s is a woman supervillain emoji. */ 899 900 esc_html__( 'Here\'s another benefit of the BP Rewrites API: the new "members only" community visibility level %s', 'buddypress' ), … … 966 967 'span' => array( 967 968 'class' => true, 968 ) 969 ), 969 970 ) 970 971 ); … … 1284 1285 $taxonomy_object = get_taxonomy( bp_get_email_tax_type() ); 1285 1286 1286 if ( is_wp_error( $terms ) || ! $terms 1287 if ( is_wp_error( $terms ) || ! $terms ) { 1287 1288 printf( '<span aria-hidden="true">—</span><span class="screen-reader-text">%s</span>', esc_html( $taxonomy_object->labels->no_terms ) ); 1288 1289 } else { … … 1348 1349 1349 1350 // Check for prerelease hyphen. 1350 $pre 1351 $pre = strpos( $version, '-' ); 1351 1352 1352 1353 // Strip prerelease suffix. … … 1571 1572 } 1572 1573 %2$s', 1573 implode( " ", $grid_columns ),1574 implode( ' ', $grid_columns ), 1574 1575 $help_tab_css 1575 1576 ) … … 1612 1613 * @global int $paged The current page of the Plugin results. 1613 1614 * 1614 * @param false|array $args `false` by default. 1615 * @return array The "BuddyPress add-ons" args. 1616 */ 1617 public function addons_args( $args = false ) { 1615 * @return array The "BuddyPress add-ons" args. 1616 */ 1617 public function addons_args() { 1618 1618 global $paged; 1619 1619 … … 1686 1686 } 1687 1687 } 1688 endif; // End class_exists check.
Note: See TracChangeset
for help on using the changeset viewer.