Changeset 13974
- Timestamp:
- 07/24/2024 08:36:35 AM (2 years ago)
- Location:
- trunk/src
- Files:
-
- 7 edited
-
bp-activity/bp-activity-admin.php (modified) (1 diff)
-
bp-core/admin/bp-core-admin-functions.php (modified) (1 diff)
-
bp-core/bp-core-functions.php (modified) (1 diff)
-
bp-core/classes/class-bp-admin.php (modified) (6 diffs)
-
bp-groups/bp-groups-admin.php (modified) (2 diffs)
-
bp-members/classes/class-bp-members-admin.php (modified) (1 diff)
-
bp-xprofile/bp-xprofile-admin.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/bp-activity-admin.php
r13937 r13974 180 180 function bp_activity_admin_load() { 181 181 global $bp_activity_list_table; 182 183 $bp = buddypress(); 182 $bp = buddypress(); 183 184 // Traces the current BP Admin screen. 185 $bp->admin->trace_current_screen(); 186 184 187 $doaction = bp_admin_list_table_current_bulk_action(); 185 188 $min = bp_core_get_minified_asset_suffix(); -
trunk/src/bp-core/admin/bp-core-admin-functions.php
r13955 r13974 1768 1768 add_filter( 'set_screen_option_tools_page_bp_members_invitations_per_page', 'bp_admin_set_screen_options', 10, 3 ); 1769 1769 add_filter( 'set_screen_option_tools_page_bp_members_invitations_network_per_page', 'bp_admin_set_screen_options', 10, 3 ); 1770 1771 /** 1772 * Remove the Plugin Dependency warning from BP add-ons listed into the Plugin/Add BP Addons tab. 1773 * 1774 * @since 15.0.0 1775 * 1776 * @param false|object|array $result The result object or array. Default false. 1777 * @param string $action The type of information being requested from the Plugin Installation API. 1778 * @param object $args Plugin API arguments. 1779 */ 1780 function bp_admin_edit_available_addons_properties( $addons, $action, $args ) { 1781 if ( 'query_plugins' === $action && bp_is_admin( 'plugin-install' ) && isset( $args->author ) && 'buddypress' === $args->author ) { 1782 foreach ( $addons->plugins as $key => $plugin_data ) { 1783 if ( ! isset( $plugin_data['requires_plugins'] ) || ! in_array( 'buddypress', $plugin_data['requires_plugins'], true ) ) { 1784 continue; 1785 } 1786 1787 // The BP Add-ons tab is generated by BuddyPress, so BuddyPress is installed, no need to add a Plugin Dependency warning about it. 1788 $addons->plugins[ $key ]['requires_plugins'] = array_diff( $plugin_data['requires_plugins'], array( 'buddypress' ) ); 1789 } 1790 } 1791 1792 return $addons; 1793 } 1794 add_filter( 'plugins_api_result', 'bp_admin_edit_available_addons_properties', 10, 3 ); -
trunk/src/bp-core/bp-core-functions.php
r13964 r13974 5251 5251 return $admin_notifications; 5252 5252 } 5253 5254 /** 5255 * Checks whether a BuddyPress admin screen is displayed. 5256 * 5257 * @since 15.0.0 5258 * 5259 * @param string $screen_id The specific screen ID to check. 5260 * @return boolean True if a BuddyPress admin screen is displayed. False otherwise. 5261 */ 5262 function bp_is_admin( $screen_id = '' ) { 5263 $bp = buddypress(); 5264 5265 if ( ! isset( $bp->admin->current_screen ) ) { 5266 return false; 5267 } 5268 5269 if ( ! $screen_id ) { 5270 return ! empty( $bp->admin->current_screen ); 5271 } 5272 5273 return $screen_id === $bp->admin->current_screen; 5274 } -
trunk/src/bp-core/classes/class-bp-admin.php
r13966 r13974 102 102 */ 103 103 public $submenu_pages = array(); 104 105 /** 106 * The current BP Admin screen being displayed. 107 * 108 * @since 15.0.0 109 * @var array 110 */ 111 public $current_screen = ''; 104 112 105 113 /** Methods ***************************************************************/ … … 410 418 foreach ( $hooks as $hook ) { 411 419 add_action( "admin_head-$hook", 'bp_core_modify_admin_menu_highlight' ); 420 add_action( "load-{$hook}", array( $this, 'trace_current_screen' ), 1 ); 412 421 413 422 if ( 'settings_page_bp-rewrites' === $hook ) { … … 1320 1329 } 1321 1330 1331 /* 1332 * @todo We should check for any possible post types generated by BuddyPress: 1333 * - BP Email, 1334 * - BP Directories... 1335 */ 1322 1336 if ( ! isset( $screen->post_type ) || bp_get_email_post_type() !== $screen->post_type ) { 1323 1337 return; … … 1325 1339 1326 1340 bp_core_add_contextual_help( $screen ); 1341 $this->trace_current_screen(); 1327 1342 } 1328 1343 … … 1629 1644 public function addons_args() { 1630 1645 global $paged; 1646 $this->current_screen = get_current_screen()->id; 1631 1647 1632 1648 return array( … … 1697 1713 <?php 1698 1714 } 1715 1716 /** 1717 * Traces the BP Admin screen being viewed. 1718 * 1719 * @since 15.0.0 1720 */ 1721 public function trace_current_screen() { 1722 $this->current_screen = get_current_screen()->id; 1723 } 1699 1724 } -
trunk/src/bp-groups/bp-groups-admin.php
r13937 r13974 128 128 function bp_groups_admin_load() { 129 129 global $bp_groups_list_table; 130 $bp = buddypress(); 131 132 // Traces the current BP Admin screen. 133 $bp->admin->trace_current_screen(); 130 134 131 135 // Build redirection URL. … … 247 251 ) ); 248 252 } 249 250 $bp = buddypress();251 253 252 254 // Enqueue CSS and JavaScript. -
trunk/src/bp-members/classes/class-bp-members-admin.php
r13973 r13974 964 964 */ 965 965 public function user_admin_load() { 966 $bp = buddypress(); 967 968 // Traces the current BP Admin screen. 969 $bp->admin->trace_current_screen(); 966 970 967 971 // Get the user ID. -
trunk/src/bp-xprofile/bp-xprofile-admin.php
r13878 r13974 26 26 } 27 27 28 add_users_page( _x( 'Profile Fields', 'xProfile admin page title', 'buddypress' ), _x( 'Profile Fields', 'Admin Users menu', 'buddypress' ), 'manage_options', 'bp-profile-setup', 'xprofile_admin' ); 28 $hook = add_users_page( 29 _x( 'Profile Fields', 'xProfile admin page title', 'buddypress' ), 30 _x( 'Profile Fields', 'Admin Users menu', 'buddypress' ), 31 'manage_options', 32 'bp-profile-setup', 33 'xprofile_admin' 34 ); 35 36 // Hook into early actions to load our init handler. 37 add_action( "load-$hook", 'bp_xprofile_admin_load' ); 29 38 } 30 39 add_action( bp_core_admin_hook(), 'xprofile_add_admin_menu' ); 40 41 /** 42 * Performs actions early during the xProfile Admin loading process. 43 * 44 * @since 15.0.0 45 */ 46 function bp_xprofile_admin_load() { 47 $bp = buddypress(); 48 49 // Traces the current BP Admin screen. 50 $bp->admin->trace_current_screen(); 51 } 31 52 32 53 /**
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)