diff --git a/api.wordpress.org/public_html/core/credits/wp-credits.php b/api.wordpress.org/public_html/core/credits/wp-credits.php index 55da7a5b13..6e1e85f124 100644 --- a/api.wordpress.org/public_html/core/credits/wp-credits.php +++ b/api.wordpress.org/public_html/core/credits/wp-credits.php @@ -221,9 +221,9 @@ private function _grab_validators( $gp_locale, $path ) { if ( $user->user_nicename == 'nacin' ) // I stopped taking Spanish in 11th grade, don't show me as a validator when I'm testing things. continue; if ( $user->display_name && $user->display_name != $user->user_nicename && false === strpos( $user->display_name , '?') ) - $validators[ $user->user_nicename ] = array( $this->_encode( $user->display_name ), md5( $user->user_email ), $user->user_nicename ); + $validators[ $user->user_nicename ] = array( $this->_encode( $user->display_name ), $this->hash( $user->user_email ), $user->user_nicename ); else - $validators[ $user->user_nicename ] = array( $user->user_nicename, md5( $user->user_email ), $user->user_nicename ); + $validators[ $user->user_nicename ] = array( $user->user_nicename, $this->hash( $user->user_email ), $user->user_nicename ); } return $validators; @@ -299,14 +299,14 @@ private function _groups() { $this->names_in_groups[] = strtolower( $k ); if ( ! empty( $person[2] ) ) { - // array( 'Andrew Nacin', 'Lead Developer', 'md5 hash' ) + // array( 'Andrew Nacin', 'Lead Developer', 'gravatar hash' ) $new_data['title'] = $person[1]; $new_data['hash'] = $person[2]; } elseif ( empty( $person[1] ) ) { // array( 'Andrew Nacin' ) $fetch_emails_from_user_cache[ $k ] = $group_slug; - } elseif ( strlen( $person[1] ) === 32 && preg_match('/^[a-f0-9]{32}$/', $person[1] ) ) { - // array( 'Andrew Nacin', 'md5 hash' ) + } elseif ( $this->is_hashed( $person[1] ) ) { + // array( 'Andrew Nacin', 'gravatar hash' ) $new_data['hash'] = $person[1]; } else { // array( 'Andrew Nacin', 'Lead Developer' ) @@ -315,8 +315,8 @@ private function _groups() { } // Temporary: - if ( strlen( $new_data['hash'] ) != 32 || strpos( $new_data['hash'], '@' ) ) { - $new_data['hash'] = md5( $new_data['hash'] ); + if ( ! $this->is_hashed( $new_data['hash'] ) ) { + $new_data['hash'] = $this->hash( $new_data['hash'] ); } $group_data['data'][ $k ] = array_values( $new_data ); @@ -330,7 +330,7 @@ private function _groups() { $user_id = wp_cache_get( $username, 'userlogins' ); if ( $user_id ) { if ( $user_object = wp_cache_get( $user_id, 'users' ) ) { - $groups[ $group ]['data'][ $username ][1] = md5( strtolower( $user_object->user_email ) ); + $groups[ $group ]['data'][ $username ][1] = $this->hash( $user_object->user_email ); } else { $fetch_emails_from_db[ $username ] = $group; } @@ -341,7 +341,7 @@ private function _groups() { if ( $fetch_emails_from_db ) { $fetched = $wpdb->get_results( "SELECT user_login, ID, user_email FROM $wpdb->users WHERE user_login IN ('" . implode( "', '", array_keys( $fetch_emails_from_db ) ) . "')", OBJECT_K ); foreach ( $fetched as $username => $row ) { - $groups[ $fetch_emails_from_db[ $username ] ]['data'][ $username ][1] = md5( strtolower( $row->user_email ) ); + $groups[ $fetch_emails_from_db[ $username ] ]['data'][ $username ][1] = $this->hash( $row->user_email ); wp_cache_add( $username, $row->ID, 'userlogins' ); } } @@ -445,4 +445,26 @@ final public function execute() { } } + private function is_hashed( $maybe_hash ) { + if ( + ! is_string( $maybe_hash ) || + strpos( $maybe_hash, '@' ) !== false + ) { + return false; + } + + switch ( strlen( $maybe_hash ) ) { + case 32: + return preg_match( '/^[a-f0-9]{32}$/', $maybe_hash ); + case 64: + return preg_match( '/^[a-f0-9]{64}$/', $maybe_hash ); + } + + return false; + } + + private function hash( $email ) { + return hash( 'sha256', strtolower( $email ) ); + } + } diff --git a/api.wordpress.org/public_html/dotorg/slack/announce.php b/api.wordpress.org/public_html/dotorg/slack/announce.php index 92f92738d6..1390e30d2a 100644 --- a/api.wordpress.org/public_html/dotorg/slack/announce.php +++ b/api.wordpress.org/public_html/dotorg/slack/announce.php @@ -22,7 +22,7 @@ function get_avatar( $username, $slack_id, $team_id ) { $wp_user_id ) ); - $hash = md5( strtolower( trim( $email ) ) ); + $hash = hash( 'sha256', strtolower( trim( $email ) ) ); return sprintf( 'https://secure.gravatar.com/avatar/%s?s=96d=mm&r=G&%s', $hash, time() ); } diff --git a/api.wordpress.org/public_html/events/1.0/index.php b/api.wordpress.org/public_html/events/1.0/index.php index 4e0b46c0d7..41f2de0d4d 100644 --- a/api.wordpress.org/public_html/events/1.0/index.php +++ b/api.wordpress.org/public_html/events/1.0/index.php @@ -1588,35 +1588,31 @@ function pin_next_workshop_discussion_group( $events, $user_agent ) { * Pin one-off events. */ function pin_one_off_events( $events, $current_time ) { - $madrid_utc_offset = 1 * HOUR_IN_SECONDS; // Central European Standard Time - GMT+1 + $tokyo_utc_offset = 9 * HOUR_IN_SECONDS; // JST: UTC+9 $sotw = array( 'type' => 'wordcamp', - 'title' => 'State of the Word - Watch Now', // Remove "watch now" next year, see date note below. + 'title' => 'State of the Word 2024 – Tokyo, Japan', // `utm_source` is `private` because it would have to be set by the WP install, we don't need it, and tracking it could be a privacy concern. - 'url' => 'https://wordpress.org/state-of-the-word/?utm_source=private&utm_medium=events_widget&utm_campaign=sotw2023', + 'url' => 'https://wordpress.org/state-of-the-word/?utm_source=private&utm_medium=events_widget&utm_campaign=sotw2024', 'meetup' => '', 'meetup_url' => '', - - // This year they requested the event to show up for a few days after it was over. The API does that no - // problem, but in Core `WP_Community_Events::trim_events()` will remove it. This is a hack to make the - // event show up, but it will probably confuse people about when it actual was, because the date will be - // wrong. Don't do this again next year, only show the event in the lead up to it. The pinned News item - // will still show it to people after the event. - 'date' => '2023-12-14 15:00:00', - 'end_date' => '2023-12-14 16:30:00', - 'start_unix_timestamp' => strtotime( '2023-12-14 15:00:00' ) - $madrid_utc_offset, - 'end_unix_timestamp' => strtotime( '2023-12-14 16:30:00' ) - $madrid_utc_offset, + // Local time for the event location. + 'date' => '2024-12-16 18:00:00', + 'end_date' => '2024-12-16 20:00:00', + // Unix timestamp (UTC). + 'start_unix_timestamp' => strtotime( '2024-12-16 18:00:00' ) - $tokyo_utc_offset, + 'end_unix_timestamp' => strtotime( '2024-12-16 20:00:00' ) - $tokyo_utc_offset, 'location' => array( 'location' => 'Online', - 'country' => 'ES', - 'latitude' => 40.41446998218856, - 'longitude' => -3.695042334019202, + 'country' => 'JP', + 'latitude' => 35.652832, + 'longitude' => 139.839478, ), ); - if ( $current_time > strtotime( 'December 9, 2023' ) && $current_time < strtotime( 'December 14, 2023' ) ) { + if ( $current_time > strtotime( 'December 11, 2024' ) && $current_time < strtotime( 'December 17, 2024' ) ) { array_unshift( $events, $sotw ); } diff --git a/buddypress.org/public_html/wp-content/plugins/bbpress-org/toolbar.php b/buddypress.org/public_html/wp-content/plugins/bbpress-org/toolbar.php index c8dc3fd58a..02be48b888 100644 --- a/buddypress.org/public_html/wp-content/plugins/bbpress-org/toolbar.php +++ b/buddypress.org/public_html/wp-content/plugins/bbpress-org/toolbar.php @@ -7,15 +7,15 @@ * @since 1.0.1 */ function bborg_toolbar_tweaks() { - remove_action( 'admin_bar_menu', 'wp_admin_bar_my_account_menu', 0 ); - remove_action( 'admin_bar_menu', 'wp_admin_bar_search_menu', 4 ); - remove_action( 'admin_bar_menu', 'wp_admin_bar_my_account_item', 7 ); - remove_action( 'admin_bar_menu', 'wp_admin_bar_wp_menu', 10 ); - remove_action( 'admin_bar_menu', 'wp_admin_bar_site_menu', 30 ); - remove_action( 'admin_bar_menu', 'wp_admin_bar_customize_menu', 40 ); - remove_action( 'admin_bar_menu', 'wp_admin_bar_comments_menu', 60 ); - remove_action( 'admin_bar_menu', 'wp_admin_bar_new_content_menu', 70 ); - remove_action( 'admin_bar_menu', 'wp_admin_bar_edit_menu', 80 ); + remove_action( 'admin_bar_menu', 'wp_admin_bar_my_account_menu', 0 ); + remove_action( 'admin_bar_menu', 'wp_admin_bar_my_account_item', 7 ); + remove_action( 'admin_bar_menu', 'wp_admin_bar_wp_menu', 10 ); + remove_action( 'admin_bar_menu', 'wp_admin_bar_site_menu', 30 ); + remove_action( 'admin_bar_menu', 'wp_admin_bar_customize_menu', 40 ); + remove_action( 'admin_bar_menu', 'wp_admin_bar_comments_menu', 60 ); + remove_action( 'admin_bar_menu', 'wp_admin_bar_new_content_menu', 70 ); + remove_action( 'admin_bar_menu', 'wp_admin_bar_edit_menu', 80 ); + remove_action( 'admin_bar_menu', 'wp_admin_bar_search_menu', 9999 ); } add_action( 'add_admin_bar_menus', 'bborg_toolbar_tweaks', 11 ); @@ -254,12 +254,6 @@ function bbporg_new_admin_bar_wp_menu( $wp_admin_bar ) { */ function bbporg_new_admin_bar_site_menu( $wp_admin_bar ) { - $wp_admin_bar->add_menu( array( - 'id' => 'bbp-site-name', - 'title' => __( 'bbPress.org' ), - 'href' => home_url( '/' ) - ) ); - // Create submenu items. if ( is_user_logged_in() ) { @@ -267,39 +261,22 @@ function bbporg_new_admin_bar_site_menu( $wp_admin_bar ) { // Add a link to create a new topic. $wp_admin_bar->add_menu( array( 'id' => 'bbp-new-topic', + 'parent' => 'top-secondary', 'title' => __( 'Create New Topic' ), 'href' => 'https://bbpress.org/forums/new-topic/' ) ); - // Add an option to visit the admin dashboard - if ( is_super_admin() ) { - - $wp_admin_bar->add_group( array( - 'parent' => 'bbp-site-name', - 'id' => 'bbp-site-name-super-admin', - 'meta' => array( - 'class' => 'ab-sub-secondary', - ), - ) ); - - $wp_admin_bar->add_menu( array( - 'parent' => 'bbp-site-name-super-admin', - 'id' => 'bbp-admin-link', - 'title' => __( 'Admin Dashbooard' ), - 'href' => get_admin_url() - ) ); - } - // Not logged in } else { $wp_admin_bar->add_menu( array( 'id' => 'bbp-login', + 'parent' => 'top-secondary', 'title' => __( 'Log in' ), 'href' => wp_login_url() ) ); } } -add_action( 'admin_bar_menu', 'bbporg_new_admin_bar_site_menu', 20 ); +add_action( 'admin_bar_menu', 'bbporg_new_admin_bar_site_menu', 2 ); /** * Add the "My Account" item. @@ -344,7 +321,7 @@ function bbporg_admin_bar_my_account_item( $wp_admin_bar ) { ) ); } } -add_action( 'admin_bar_menu', 'bbporg_admin_bar_my_account_item', 0 ); +add_action( 'admin_bar_menu', 'bbporg_admin_bar_my_account_item', 4 ); /** * Add the "My Account" submenu items. @@ -472,79 +449,3 @@ function bbporg_admin_bar_my_account_menu( $wp_admin_bar ) { } } add_action( 'admin_bar_menu', 'bbporg_admin_bar_my_account_menu', 7 ); - -/** - * Force toolbar styling into looking like sub-navigation - * - * Note: slightly experimental - kind of a hack - * - * @author johnjamesjacoby - * @since 1.0.3 - */ -function bbporg_toolbar_css_overrides() { -?> - - 'bbporg_toolbar_css_overrides' ) ); diff --git a/buddypress.org/public_html/wp-content/plugins/buddypress-org/toolbar.php b/buddypress.org/public_html/wp-content/plugins/buddypress-org/toolbar.php index b0d5d650a4..1e8b89af0a 100644 --- a/buddypress.org/public_html/wp-content/plugins/buddypress-org/toolbar.php +++ b/buddypress.org/public_html/wp-content/plugins/buddypress-org/toolbar.php @@ -7,16 +7,29 @@ * @since 1.0.1 */ function bporg_toolbar_tweaks() { - remove_action( 'admin_bar_menu', 'wp_admin_bar_search_menu', 4 ); - remove_action( 'admin_bar_menu', 'wp_admin_bar_wp_menu', 10 ); - remove_action( 'admin_bar_menu', 'wp_admin_bar_site_menu', 30 ); - remove_action( 'admin_bar_menu', 'wp_admin_bar_customize_menu', 40 ); - remove_action( 'admin_bar_menu', 'wp_admin_bar_comments_menu', 60 ); - remove_action( 'admin_bar_menu', 'wp_admin_bar_new_content_menu', 70 ); - remove_action( 'admin_bar_menu', 'wp_admin_bar_edit_menu', 80 ); + + // WordPress Menus + remove_action( 'admin_bar_menu', 'wp_admin_bar_sidebar_toggle', 0 ); + remove_action( 'admin_bar_menu', 'wp_admin_bar_wp_menu', 10 ); + remove_action( 'admin_bar_menu', 'wp_admin_bar_site_menu', 30 ); + remove_action( 'admin_bar_menu', 'wp_admin_bar_edit_site_menu', 40 ); + remove_action( 'admin_bar_menu', 'wp_admin_bar_customize_menu', 40 ); + remove_action( 'admin_bar_menu', 'wp_admin_bar_updates_menu', 50 ); + remove_action( 'admin_bar_menu', 'wp_admin_bar_comments_menu', 60 ); + remove_action( 'admin_bar_menu', 'wp_admin_bar_new_content_menu', 70 ); + remove_action( 'admin_bar_menu', 'wp_admin_bar_edit_menu', 80 ); + remove_action( 'admin_bar_menu', 'wp_admin_bar_my_account_item', 9991 ); + remove_action( 'admin_bar_menu', 'wp_admin_bar_recovery_mode_menu', 9992 ); + remove_action( 'admin_bar_menu', 'wp_admin_bar_search_menu', 9999 ); // BuddyPress Menus remove_action( 'bp_setup_admin_bar', 'bp_members_admin_bar_my_account_menu', 4 ); + + // WordPress.org Profiles site specific removals + if ( 'profiles.wordpress.org' === $_SERVER['HTTP_HOST'] ) { + remove_action( 'admin_bar_menu', 'bp_groups_group_admin_menu', 99 ); + remove_action( 'admin_bar_menu', 'bp_admin_bar_my_account_root', 100 ); + } } add_action( 'add_admin_bar_menus', 'bporg_toolbar_tweaks', 11 ); @@ -27,11 +40,54 @@ function bporg_toolbar_tweaks() { * @param WP_Admin_Bar $wp_admin_bar WP_Admin_Bar instance, passed by reference. */ function bporg_remove_about_pages( $wp_admin_bar ) { + + // About page links $wp_admin_bar->remove_menu( 'bp-about' ); $wp_admin_bar->remove_menu( 'bbp-about' ); } add_action( 'admin_bar_menu', 'bporg_remove_about_pages', 99 ); +/** + * Remove the BuddyPress XProfile + * @author johnjamesjacoby + * @since 1.1.0 + */ +function bporg_remove_my_account_items( $wp_admin_bar ) { + $wp_admin_bar->remove_menu( 'my-account-blogs' ); + $wp_admin_bar->remove_menu( 'my-account-xprofile-edit' ); + $wp_admin_bar->remove_menu( 'my-account-xprofile-change-avatar' ); +} +add_action( 'admin_bar_menu', 'bporg_remove_my_account_items', 99 ); + +/** + * Prevent the BuddyPress Component admin-bar nav items from being added. + * + * This function adds filters to return false inside of the + * BP_Component::setup_admin_bar() methods. + * + * WordPress.org & BuddyPress.org implement their own user profile flow. The + * relevant components all have their + * + * @author johnjamesjacoby + * @since 1.1.0 + */ +function bporg_remove_component_menu_items() { + + // BuddyPress + $components = bp_core_get_active_components(); + + // bbPress + if ( ! array_search( 'forums', $components, true ) ) { + array_push( $components, 'forums' ); + } + + // Filter admin-nav for all components + foreach ( $components as $component ) { + add_filter( 'bp_' . $component . '_admin_nav', '__return_false' ); + } +} +add_action( 'bp_init', 'bporg_remove_component_menu_items', 99 ); + /** * Add a new main top-left menu with links for each project. * @@ -57,7 +113,7 @@ function bporg_new_admin_bar_wp_menu( $wp_admin_bar ) { 'parent' => 'wp-logo', 'id' => 'wordpress', 'title' => __( 'WordPress.org' ), - 'href' => 'https://wordpress.org', + 'href' => 'https://wordpress.org', ) ); // Add "About WordPress" link @@ -70,26 +126,26 @@ function bporg_new_admin_bar_wp_menu( $wp_admin_bar ) { // Add codex link $wp_admin_bar->add_menu( array( - 'parent' => 'wordpress', - 'id' => 'wp-documentation', - 'title' => __('Documentation'), - 'href' => 'https://codex.wordpress.org/', + 'parent' => 'wordpress', + 'id' => 'wp-documentation', + 'title' => __( 'Documentation' ), + 'href' => 'https://codex.wordpress.org/', ) ); // Add forums link $wp_admin_bar->add_menu( array( - 'parent' => 'wordpress', - 'id' => 'wp-support-forums', - 'title' => __('Support Forums'), - 'href' => 'https://wordpress.org/support/', + 'parent' => 'wordpress', + 'id' => 'wp-support-forums', + 'title' => __( 'Support Forums' ), + 'href' => 'https://wordpress.org/support/', ) ); // Add feedback link $wp_admin_bar->add_menu( array( - 'parent' => 'wordpress', - 'id' => 'wp-feedback', - 'title' => __('Feedback'), - 'href' => 'https://wordpress.org/support/forum/requests-and-feedback', + 'parent' => 'wordpress', + 'id' => 'wp-feedback', + 'title' => __( 'Feedback' ), + 'href' => 'https://wordpress.org/support/forum/requests-and-feedback', ) ); /** WordPress Developer **/ @@ -122,7 +178,7 @@ function bporg_new_admin_bar_wp_menu( $wp_admin_bar ) { 'parent' => 'wp-logo', 'id' => 'bbpress', 'title' => __( 'bbPress.org' ), - 'href' => 'https://bbpress.org', + 'href' => 'https://bbpress.org', ) ); // Add "About bbPress" link @@ -135,26 +191,26 @@ function bporg_new_admin_bar_wp_menu( $wp_admin_bar ) { // Add codex link $wp_admin_bar->add_menu( array( - 'parent' => 'bbpress', - 'id' => 'bbp-documentation', - 'title' => __( 'Documentation' ), - 'href' => 'https://codex.bbpress.org/', + 'parent' => 'bbpress', + 'id' => 'bbp-documentation', + 'title' => __( 'Documentation' ), + 'href' => 'https://codex.bbpress.org/', ) ); // Add forums link $wp_admin_bar->add_menu( array( - 'parent' => 'bbpress', - 'id' => 'bbp-support-forums', - 'title' => __( 'Support Forums' ), - 'href' => __( 'https://bbpress.org/forums/' ), + 'parent' => 'bbpress', + 'id' => 'bbp-support-forums', + 'title' => __( 'Support Forums' ), + 'href' => __( 'https://bbpress.org/forums/' ), ) ); // Add feedback link $wp_admin_bar->add_menu( array( - 'parent' => 'bbpress', - 'id' => 'bbp-feedback', - 'title' => __( 'Feedback' ), - 'href' => 'https://bbpress.org/forums/forum/requests-and-feedback', + 'parent' => 'bbpress', + 'id' => 'bbp-feedback', + 'title' => __( 'Feedback' ), + 'href' => 'https://bbpress.org/forums/forum/requests-and-feedback', ) ); /** bbPress Developer **/ @@ -187,7 +243,7 @@ function bporg_new_admin_bar_wp_menu( $wp_admin_bar ) { 'parent' => 'wp-logo', 'id' => 'buddypress', 'title' => __( 'BuddyPress.org' ), - 'href' => 'https://buddypress.org', + 'href' => 'https://buddypress.org', ) ); // Add "About BuddyPress" link @@ -200,26 +256,26 @@ function bporg_new_admin_bar_wp_menu( $wp_admin_bar ) { // Add codex link $wp_admin_bar->add_menu( array( - 'parent' => 'buddypress', - 'id' => 'bp-documentation', - 'title' => __( 'Documentation' ), - 'href' => 'https://codex.buddypress.org/', + 'parent' => 'buddypress', + 'id' => 'bp-documentation', + 'title' => __( 'Documentation' ), + 'href' => 'https://codex.buddypress.org/', ) ); // Add forums link $wp_admin_bar->add_menu( array( - 'parent' => 'buddypress', - 'id' => 'bp-support-forums', - 'title' => __( 'Support Forums' ), - 'href' => 'https://buddypress.org/support/', + 'parent' => 'buddypress', + 'id' => 'bp-support-forums', + 'title' => __( 'Support Forums' ), + 'href' => 'https://buddypress.org/support/', ) ); // Add feedback link $wp_admin_bar->add_menu( array( - 'parent' => 'buddypress', - 'id' => 'bp-feedback', - 'title' => __( 'Feedback' ), - 'href' => 'https://buddypress.org/support/forum/feedback/', + 'parent' => 'buddypress', + 'id' => 'bp-feedback', + 'title' => __( 'Feedback' ), + 'href' => 'https://buddypress.org/support/forum/feedback/', ) ); /** BuddyPress Developer **/ @@ -250,68 +306,22 @@ function bporg_new_admin_bar_wp_menu( $wp_admin_bar ) { /** * Add a new "Site Name" menu with less things for average users to do * - * * @author johnjamesjacoby * @since 1.0.2 */ function bporg_new_admin_bar_site_menu( $wp_admin_bar ) { - // Profiles - if ( 'profiles.wordpress.org' == $_SERVER['HTTP_HOST'] ) { - $wp_admin_bar->add_menu( array( - 'id' => 'bp-site-name', - 'title' => __( 'WordPress.org' ), - 'href' => 'https://wordpress.org' - ) ); - - return; - - // bbPress Network - } elseif ( strstr( $_SERVER['HTTP_HOST'], 'bbpress.org' ) ) { - $wp_admin_bar->add_menu( array( - 'id' => 'bp-site-name', - 'title' => __( 'bbPress.org' ), - 'href' => 'https://bbpress.org' - ) ); - - return; - - // BuddyPress Network - } else { - $wp_admin_bar->add_menu( array( - 'id' => 'bp-site-name', - 'title' => __( 'BuddyPress.org' ), - 'href' => 'https://buddypress.org' - ) ); - } - // Create submenu items. - if ( is_user_logged_in() ) { - // Add a link to create a new topic. - $wp_admin_bar->add_menu( array( - 'id' => 'bp-new-topic', - 'title' => __( 'Create New Topic' ), - 'href' => 'https://buddypress.org/support/new-topic/' - ) ); - - // Add an option to visit the admin dashboard - if ( is_super_admin() ) { - - $wp_admin_bar->add_group( array( - 'parent' => 'bp-site-name', - 'id' => 'bp-site-name-super-admin', - 'meta' => array( - 'class' => 'ab-sub-secondary', - ), - ) ); + if ( is_main_site() ) { + // Add a link to create a new topic. $wp_admin_bar->add_menu( array( - 'parent' => 'bp-site-name-super-admin', - 'id' => 'bp-admin-link', - 'title' => __( 'Admin Dashbooard' ), - 'href' => get_admin_url() + 'id' => 'bp-new-topic', + 'parent' => 'top-secondary', + 'title' => __( 'Create New Topic' ), + 'href' => 'https://buddypress.org/support/new-topic/' ) ); } @@ -319,12 +329,13 @@ function bporg_new_admin_bar_site_menu( $wp_admin_bar ) { } else { $wp_admin_bar->add_menu( array( 'id' => 'bp-login', + 'parent' => 'top-secondary', 'title' => __( 'Log in' ), 'href' => wp_login_url(), ) ); } } -add_action( 'admin_bar_menu', 'bporg_new_admin_bar_site_menu', 20 ); +add_action( 'admin_bar_menu', 'bporg_new_admin_bar_site_menu', 2 ); /** * Add the "My Account" menu and all submenus. @@ -385,6 +396,7 @@ function bporg_admin_bar_my_account_menu( $wp_admin_bar ) { 'title' => __( 'Register' ), 'href' => wp_registration_url(), ) ); + $wp_admin_bar->add_menu( array( 'parent' => 'user-actions', 'id' => 'login', @@ -402,105 +414,53 @@ function bporg_admin_bar_my_account_menu( $wp_admin_bar ) { * @since 1.0.2 */ function bporg_admin_bar_my_account_item( $wp_admin_bar ) { + $user_id = get_current_user_id(); + $current_user = wp_get_current_user(); - if ( is_user_logged_in() ) - return; + // Logged out + if ( empty( $user_id ) ) { + $howdy = __( 'Anonymous' ); + $avatar = get_avatar( 0, 16, 'mystery' ); + $class = empty( $avatar ) ? '' : 'with-avatar'; - $avatar = get_avatar( 0, 16, 'mystery' ); - $howdy = __( 'Anonymous' ); - $class = empty( $avatar ) ? '' : 'with-avatar'; + $wp_admin_bar->add_menu( array( + 'id' => 'my-account', + 'parent' => 'top-secondary', + 'title' => $howdy . $avatar, + 'href' => wp_login_url(), + 'meta' => array( + 'class' => $class, + 'title' => __( 'My Account' ), + ), + ) ); - $wp_admin_bar->add_menu( array( - 'id' => 'my-account', - 'parent' => 'top-secondary', - 'title' => $howdy . $avatar, - 'href' => wp_login_url(), - 'meta' => array( - 'class' => $class, - 'title' => __('My Account'), - ), - ) ); -} -add_action( 'admin_bar_menu', 'bporg_admin_bar_my_account_item', 0 ); + // Logged in + } else { + if ( current_user_can( 'read' ) ) { + $profile_url = get_edit_profile_url( $user_id ); + } elseif ( is_multisite() ) { + $profile_url = get_dashboard_url( $user_id, 'profile.php' ); + } else { + $profile_url = false; + } -/** - * Force toolbar styling into looking like sub-navigation - * - * Note: slightly experimental - kind of a hack - * - * @author johnjamesjacoby - * @since 1.0.3 - */ -function bporg_toolbar_css_overrides() { -?> - -' . $current_user->display_name . ''; + $avatar = get_avatar( $user_id, 26 ); + $class = empty( $avatar ) ? '' : 'with-avatar'; -// These toolbar modifications are for the buddypress.org network only. -// (Do not override the toolbar for profiles.wordpress.org) -if ( $_SERVER['HTTP_HOST'] !== 'profiles.wordpress.org' ) { - add_theme_support( 'admin-bar', array( 'callback' => 'bporg_toolbar_css_overrides' ) ); + $wp_admin_bar->add_node( + array( + 'id' => 'my-account', + 'parent' => 'top-secondary', + 'title' => $howdy . $avatar, + 'href' => $profile_url, + 'meta' => array( + 'class' => $class, + 'menu_title' => $current_user->display_name, + 'tabindex' => ( false !== $profile_url ) ? '' : 0, + ), + ) + ); + } } +add_action( 'admin_bar_menu', 'bporg_admin_bar_my_account_item', 9991 ); diff --git a/buddypress.org/public_html/wp-content/themes/bb-base/archive-forum.php b/buddypress.org/public_html/wp-content/themes/bb-base/archive-forum.php index 04effdd4ef..4e11a3581a 100644 --- a/buddypress.org/public_html/wp-content/themes/bb-base/archive-forum.php +++ b/buddypress.org/public_html/wp-content/themes/bb-base/archive-forum.php @@ -1,6 +1,6 @@ -

+

diff --git a/buddypress.org/public_html/wp-content/themes/bb-base/archive.php b/buddypress.org/public_html/wp-content/themes/bb-base/archive.php index ce2557e61c..1b55a7029b 100644 --- a/buddypress.org/public_html/wp-content/themes/bb-base/archive.php +++ b/buddypress.org/public_html/wp-content/themes/bb-base/archive.php @@ -4,7 +4,7 @@ while ( have_posts() ) : the_post(); ?> -

+

-
- - - -
+ diff --git a/buddypress.org/public_html/wp-content/themes/bb-base/bbpress/content-search.php b/buddypress.org/public_html/wp-content/themes/bb-base/bbpress/content-search.php index 2dde3f052a..1fa560df74 100644 --- a/buddypress.org/public_html/wp-content/themes/bb-base/bbpress/content-search.php +++ b/buddypress.org/public_html/wp-content/themes/bb-base/bbpress/content-search.php @@ -1,10 +1,6 @@ -
- - - -
+ diff --git a/buddypress.org/public_html/wp-content/themes/bb-base/bbpress/content-single-topic-lead.php b/buddypress.org/public_html/wp-content/themes/bb-base/bbpress/content-single-topic-lead.php index 0f019dac3f..84fd57880f 100644 --- a/buddypress.org/public_html/wp-content/themes/bb-base/bbpress/content-single-topic-lead.php +++ b/buddypress.org/public_html/wp-content/themes/bb-base/bbpress/content-single-topic-lead.php @@ -21,21 +21,27 @@ - '
', 'show_role' => true, 'size' => 100 ) ); ?> + '', 'type' => 'avatar', 'show_role' => false, 'size' => 80 ) ); ?> - '

@', 'after' => '

' ) ); ?> +
- + '

@', 'after' => '

' ) ); ?> + + bbp_get_topic_id() ) ); ?> + + - + - +
-
+ - + - +
+ +

diff --git a/buddypress.org/public_html/wp-content/themes/bb-base/bbpress/form-reply-search.php b/buddypress.org/public_html/wp-content/themes/bb-base/bbpress/form-reply-search.php new file mode 100644 index 0000000000..8958f56582 --- /dev/null +++ b/buddypress.org/public_html/wp-content/themes/bb-base/bbpress/form-reply-search.php @@ -0,0 +1,24 @@ + + +
+ +
+ + + +
+ +
+ + + +
+ +
+ + - '
', 'show_role' => true, 'size' => 100 ) ); ?> + '', 'type' => 'avatar', 'show_role' => false, 'size' => 80 ) ); ?> - '

@', 'after' => '

' ) ); ?> +
- + '

@', 'after' => '

' ) ); ?> + + bbp_get_reply_id() ) ); ?> + + - + - +
-
+ - + - +
+ +

diff --git a/buddypress.org/public_html/wp-content/themes/bb-base/comments.php b/buddypress.org/public_html/wp-content/themes/bb-base/comments.php index 1600a77b8c..a62ae0d2dc 100644 --- a/buddypress.org/public_html/wp-content/themes/bb-base/comments.php +++ b/buddypress.org/public_html/wp-content/themes/bb-base/comments.php @@ -4,7 +4,7 @@ -

to “

+

@@ -19,13 +19,13 @@

- + -

+

- + diff --git a/buddypress.org/public_html/wp-content/themes/bb-base/footer-edits.php b/buddypress.org/public_html/wp-content/themes/bb-base/footer-edits.php new file mode 100644 index 0000000000..59a099b6d8 --- /dev/null +++ b/buddypress.org/public_html/wp-content/themes/bb-base/footer-edits.php @@ -0,0 +1,57 @@ + + + + +
+ +

Want to help?

+ +

These sites are volunteer-powered which means you can contribute too! If you're interested in updating existing pages or creating entirely new ones, please read our Standards & Guidelines.

+ +
+ + + + diff --git a/buddypress.org/public_html/wp-content/themes/bb-base/footer.php b/buddypress.org/public_html/wp-content/themes/bb-base/footer.php index 4e90fead49..be84d29e3f 100644 --- a/buddypress.org/public_html/wp-content/themes/bb-base/footer.php +++ b/buddypress.org/public_html/wp-content/themes/bb-base/footer.php @@ -2,27 +2,26 @@ - diff --git a/buddypress.org/public_html/wp-content/themes/bb-base/functions.php b/buddypress.org/public_html/wp-content/themes/bb-base/functions.php index 25054ffc3b..79bcbb6b1d 100644 --- a/buddypress.org/public_html/wp-content/themes/bb-base/functions.php +++ b/buddypress.org/public_html/wp-content/themes/bb-base/functions.php @@ -54,7 +54,7 @@ function bb_base_is_bbpress() { function bb_base_register_stylesheets() { // Version of CSS - $version = '20221108'; + $version = '202412180001'; // Base theme styling wp_enqueue_style( 'bb-base', get_template_directory_uri() . '/style.css', false, $version, 'screen' ); @@ -77,10 +77,9 @@ function bb_base_topic_search_form() { @@ -92,10 +91,9 @@ function bb_base_reply_search_form() { @@ -107,10 +105,9 @@ function bb_base_plugin_search_form() { @@ -196,7 +193,7 @@ function bb_base_single_topic_description() {
  • 'name', 'post_id' => $last_reply, 'size' => '15' ) ) ); ?>
  • @@ -204,7 +201,7 @@ function bb_base_single_topic_description() {
  • @@ -263,7 +260,7 @@ function bb_base_single_forum_description() {
  • 'name', 'post_id' => $last_active ) ) ); ?>
  • @@ -271,7 +268,7 @@ function bb_base_single_forum_description() {
  • @@ -615,3 +612,13 @@ function bb_base_login_redirect() { } } add_action( 'bbp_template_redirect', 'bb_base_login_redirect', 11 ); + +/** + * Enlarge the single-user-details avatar size. + * + * @author johnjamesjacoby + */ +function bb_base_override_single_user_details_avatar_size( $size = 150 ) { + return 200; +} +add_filter( 'bbp_single_user_details_avatar_size', 'bb_base_override_single_user_details_avatar_size' ); \ No newline at end of file diff --git a/buddypress.org/public_html/wp-content/themes/bb-base/header-nav.php b/buddypress.org/public_html/wp-content/themes/bb-base/header-nav.php index 1f5a269e1e..ca89989382 100644 --- a/buddypress.org/public_html/wp-content/themes/bb-base/header-nav.php +++ b/buddypress.org/public_html/wp-content/themes/bb-base/header-nav.php @@ -2,12 +2,11 @@ diff --git a/buddypress.org/public_html/wp-content/themes/bb-base/image.php b/buddypress.org/public_html/wp-content/themes/bb-base/image.php index e2f67e3565..6e0a49cb2b 100644 --- a/buddypress.org/public_html/wp-content/themes/bb-base/image.php +++ b/buddypress.org/public_html/wp-content/themes/bb-base/image.php @@ -41,7 +41,7 @@ -

    +