Changeset 13946
- Timestamp:
- 07/05/2024 02:28:12 AM (3 months ago)
- Location:
- trunk/src/bp-core
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/admin/bp-core-admin-functions.php
r13937 r13946 389 389 } 390 390 391 $query_args = array(); 391 $settings_page = 'options-general.php'; 392 if ( bp_core_do_network_admin() ) { 393 $settings_page = 'settings.php'; 394 } 395 396 $query_args = array( 397 'page' => 'bp-components', 398 'hello' => 'buddypress' 399 ); 400 392 401 if ( get_transient( '_bp_is_new_install' ) ) { 393 402 $query_args['is_new_install'] = '1'; … … 396 405 397 406 // Redirect to dashboard and trigger the Hello screen. 398 wp_safe_redirect( add_query_arg( $query_args, bp_get_admin_url( '?hello=buddypress') ) );407 wp_safe_redirect( add_query_arg( $query_args, bp_get_admin_url( $settings_page ) ) ); 399 408 } 400 409 -
trunk/src/bp-core/classes/class-bp-admin.php
r13883 r13946 607 607 */ 608 608 public function admin_bar_about_link( $wp_admin_bar ) { 609 if ( ! is_user_logged_in() ) {609 if ( ! bp_current_user_can( $this->capability ) ) { 610 610 return; 611 611 } … … 616 616 'id' => 'bp-about', 617 617 'title' => esc_html_x( 'Hello, BuddyPress!', 'Colloquial alternative to "learn about BuddyPress"', 'buddypress' ), 618 'href' => bp_get_admin_url( '?hello=buddypress' ), 618 'href' => add_query_arg( 619 array( 620 'page' => 'bp-components', 621 'hello' => 'buddypress' 622 ), 623 bp_get_admin_url( $this->settings_page ) 624 ), 619 625 'meta' => array( 620 626 'class' => 'say-hello-buddypress', … … 640 646 } 641 647 648 $settings_args = array( 649 'page' => 'bp-components', 650 ); 651 652 $about_args = array_merge( 653 $settings_args, 654 array( 655 'hello' => 'buddypress', 656 ) 657 ); 658 642 659 // Add a few links to the existing links array. 643 660 return array_merge( $links, array( 644 'settings' => '<a href="' . esc_url( add_query_arg( array( 'page' => 'bp-components' ), bp_get_admin_url( $this->settings_page ) ) ) . '">' . esc_html__( 'Settings', 'buddypress' ) . '</a>',645 'about' => '<a href="' . esc_url( bp_get_admin_url( '?hello=buddypress') ) . '">' . esc_html_x( 'Hello, BuddyPress!', 'Colloquial alternative to "learn about BuddyPress"', 'buddypress' ) . '</a>'661 'settings' => '<a href="' . esc_url( add_query_arg( $settings_args, bp_get_admin_url( $this->settings_page ) ) ) . '">' . esc_html__( 'Settings', 'buddypress' ) . '</a>', 662 'about' => '<a href="' . esc_url( add_query_arg( $about_args, bp_get_admin_url( $this->settings_page ) ) ) . '">' . esc_html_x( 'Hello, BuddyPress!', 'Colloquial alternative to "learn about BuddyPress"', 'buddypress' ) . '</a>' 646 663 ) ); 647 664 } … … 700 717 701 718 // BuddyPress Hello. 702 if ( 0 === strpos( get_current_screen()->id, 'dashboard') && ! empty( $_GET['hello'] ) && $_GET['hello'] === 'buddypress' ) {719 if ( isset( $this->submenu_pages['settings']['bp-components'] ) && 0 === strpos( get_current_screen()->id, $this->submenu_pages['settings']['bp-components'] ) && ! empty( $_GET['hello'] ) && $_GET['hello'] === 'buddypress' ) { 703 720 wp_enqueue_style( 'bp-hello-css' ); 704 721 wp_enqueue_script( 'bp-hello-js' ); … … 776 793 */ 777 794 public function about_screen() { 778 if ( 0 !== strpos( get_current_screen()->id, 'dashboard') || empty( $_GET['hello'] ) || $_GET['hello'] !== 'buddypress' ) {795 if ( ! isset( $this->submenu_pages['settings']['bp-components'] ) || 0 !== strpos( get_current_screen()->id, $this->submenu_pages['settings']['bp-components'] ) || empty( $_GET['hello'] ) || $_GET['hello'] !== 'buddypress' ) { 779 796 return; 780 797 } … … 783 800 $version = self::display_version(); 784 801 $version_slug = 'version-' . str_replace( '.', '-', $version ); 785 786 // The BP Classic Add-on's Modal box.787 $classic_box = add_query_arg(788 array(789 'tab' => 'bp-add-ons',790 'show' => 'bp-classic',791 ),792 network_admin_url( 'plugin-install.php' )793 );794 795 // The URLs settings screen.796 $rewrites_screen = add_query_arg(797 array(798 'page' => 'bp-rewrites',799 ),800 bp_get_admin_url( 'admin.php' )801 );802 802 ?> 803 803 … … 823 823 <div id="dynamic-content"></div> 824 824 <div id="top-features"> 825 <h2>826 <?php827 printf(828 /* Translators: %s is a raising hands emoji. */829 esc_html__( 'You now have complete control over all BuddyPress-generated URLs %s', 'buddypress' ),830 // phpcs:ignore WordPress.Security.EscapeOutput831 wp_staticize_emoji( '🙌' )832 );833 ?>834 </h2>835 825 <p> 836 <?php esc_html_e( 'Among the 100 changes introduced in 12.0.0, the BP Rewrites API is a massive revolution opening the way for a progressive BuddyPress evolution.', 'buddypress' ); ?> 837 <?php esc_html_e( 'Based on 10 years of experience gained through hard work, we are beginning to reimagine what it means to organize and manage communities within WordPress.', 'buddypress' ); ?> 838 <?php esc_html_e( 'Here are the immediate benefits of the new BP Rewrites API :', 'buddypress' ); ?> 826 <?php esc_html_e( 'Thanks for upgrading BuddyPress to 14.0.0. This new major version of your site’s community engine introduces around 80 changes mostly acting under the hood to improve documentation, code formatting, consistency and the stability of the plugin.', 'buddypress' ); ?> 827 <?php esc_html_e( 'Here are five improvements we would like to highlight:', 'buddypress' ); ?> 839 828 </p> 840 829 <ol> 841 830 <li> 831 <?php esc_html_e( 'There’s a new "BuddyPress constants" panel added to the WordPress Site Health information tool. Use it to check whether you’re using deprecated constants in your custom code or third party BP Plugins/Add-ons.', 'buddypress' ); ?> 832 <?php esc_html_e( 'The information in the "BuddyPress" and "BuddyPress constants" panels is also very useful when you need to ask for support.', 'buddypress' ); ?> 833 </li> 834 <li> 842 835 <?php 843 836 printf( 844 /* Translators: %s is a the link to the URLs settings screen*/845 esc_html__( ' You can customize each piece of any URL generated by BuddyPress to better reflect your unique community using the new%s.', 'buddypress' ),837 /* Translators: %s is a the link to the new User Documentation on GitHub */ 838 esc_html__( 'Most BuddyPress Admin screens now have a help tab in their top right corner which includes a link to an updated %s.', 'buddypress' ), 846 839 sprintf( 847 840 '<a href="%1$s">%2$s</a>', 848 esc_url( $rewrites_screen),849 esc_html__( ' URLs settings screen', 'buddypress' )841 esc_url( 'https://github.com/buddypress/buddypress/tree/master/docs/user/administration#readme' ), 842 esc_html__( 'documentation resource', 'buddypress' ) 850 843 ) 851 844 ); … … 853 846 </li> 854 847 <li> 855 <?php esc_html_e( 'Pretty or plain, BuddyPress just works no matter which option you choose for your permalink settings.', 'buddypress' ); ?> 848 <?php 849 printf( 850 /* translators: %s is the placeholder for the link to a developer note. */ 851 esc_html__( 'Whether BuddyPress is installed on a multisite network or on a single site, %s are now managed the exact same way.', 'buddypress' ), 852 sprintf( 853 '<a href="%1$s">%2$s</a>', 854 esc_url( 'https://bpdevel.wordpress.com/2024/04/21/signups-are-becoming-members-only-after-validating-their-accounts/' ), 855 esc_html__( 'signups', 'buddypress' ) 856 ) 857 ); 858 ?> 856 859 </li> 857 860 <li> 858 <?php esc_html_e( 'Routing BuddyPress URLs is faster, more reliable, extensible, testable and fully compliant with WordPress best practices.', 'buddypress' ); ?> 861 <?php 862 printf( 863 /* translators: %s is the placeholder for the link to a developer note. */ 864 esc_html__( 'Speaking of signups, the %s has been improved so that you can now submit values for any xProfile field registered as part of the Signups profile field group.', 'buddypress' ), 865 sprintf( 866 '<a href="%1$s">%2$s</a>', 867 esc_url( 'https://bpdevel.wordpress.com/2024/05/07/signup-fields-via-the-rest-api/' ), 868 esc_html__( 'BP REST API', 'buddypress' ) 869 ) 870 ); 871 ?> 872 </li> 873 <li> 874 <?php 875 printf( 876 /* translators: %s is the placeholder for the link to a developer note. */ 877 esc_html__( 'Last but not least, we again offer native support for overriding BuddyPress’s language with your community vocabulary using %s.', 'buddypress' ), 878 sprintf( 879 '<a href="%1$s">%2$s</a>', 880 esc_url( 'https://bpdevel.wordpress.com/2024/06/28/translating-buddypress-texts-into-your-community-vocabulary-is-back-in-14-0-0/' ), 881 esc_html__( 'custom translations', 'buddypress' ) 882 ) 883 ); 884 ?> 859 885 </li> 860 886 </ol> … … 862 888 <hr class="bp-hello-divider"/> 863 889 864 < h2>890 <p> 865 891 <?php 866 892 printf( 867 /* translators: %s is the placeholder for the link to the BuddyPress Add-ons administration page. */ 868 esc_html__( 'Do you need to maintain backward compatibility? %s has you covered.', 'buddypress' ), 869 sprintf( 870 '<a href="%1$s">%2$s</a>', 871 esc_url( $classic_box ), 872 esc_html__( 'BP Classic', 'buddypress' ) 873 ) 893 /* Translators: %s is a black cat emoji. */ 894 esc_html__( 'Compared to our previous major version (12.0.0 - the number right after was too intimidating %s), 14.0.0 is a quieter update.', 'buddypress' ), 895 // phpcs:ignore WordPress.Security.EscapeOutput 896 wp_staticize_emoji( '🐈⬛' ) 874 897 ); 898 echo ' '; 899 esc_html_e( 'After the huge BP Rewrites API revolution, the humans (us the BP Team) who maintain and support your favorite community plugin needed to catch their breath to get ready for the new round of big changes arriving in 15.0.0.', 'buddypress' ); 875 900 ?> 876 </h2>877 878 <p>879 <?php esc_html_e( 'Although we chose to extend our beta testing period to 3 months for this major release and documented what BuddyPress plugin authors need to do to be ready for our core change, some of them might need a little more time to be fully compatible with the latest BuddyPress version.', 'buddypress' ); ?>880 <?php esc_html_e( 'Or, for instance, you might still use the BP Default theme (which was deprecated 10 years ago) or a BP Legacy Widget.', 'buddypress' ); ?>881 <?php882 printf(883 /* translators: %s is the placeholder for the link to the BuddyPress Add-ons administration page. */884 esc_html__( 'If so, you can download and activate %s for your backward compatibility needs.', 'buddypress' ),885 sprintf(886 '<a href="%1$s">%2$s</a>',887 esc_url( $classic_box ),888 esc_html__( 'BP Classic', 'buddypress' )889 )890 );891 ?>892 </p>893 894 <hr class="bp-hello-divider"/>895 896 <h2>897 <?php898 printf(899 /* Translators: %s is a woman supervillain emoji. */900 esc_html__( 'Here\'s another benefit of the BP Rewrites API: the new "members only" community visibility level %s', 'buddypress' ),901 // phpcs:ignore WordPress.Security.EscapeOutput902 wp_staticize_emoji( '🦹🏻' )903 );904 ?>905 </h2>906 907 <p>908 <?php esc_html_e( 'We\'ve heard from BuddyPress end-users that being able to easily restrict access to their community is a necessary feature. And, thanks to the BP Rewrites API, we are now able to make this possible.', 'buddypress' ); ?>909 <?php esc_html_e( 'With this first iteration, a site admin can now choose whether the community is fully public or is only accessible to logged-in members.', 'buddypress' ); ?>910 <?php esc_html_e( 'In future versions, we hope to add granularity to this choice, so that community administrators can choose to highlight their members but share activities only inside the community "gates" for example.', 'buddypress' ); ?>911 901 </p> 912 902 … … 916 906 <div class="dashicons dashicons-buddicons-buddypress-logo big"></div> 917 907 </figure> 908 909 <hr class="bp-hello-divider"/> 910 911 <p> 912 <?php 913 esc_html_e( 'Let’s keep in mind BuddyPress is an open source project maintained by volunteers giving freely of their time and energy to help you build great WordPress community sites.', 'buddypress' ); 914 echo ' '; 915 printf( 916 /* Translators: %s is a the link to the new Contributor Documentation on GitHub */ 917 esc_html__( 'Don’t hesitate to send us some encouraging words and please consider contributing back to %s.', 'buddypress' ), 918 sprintf( 919 '<a href="%1$s">%2$s</a>', 920 esc_url( 'https://github.com/buddypress/buddypress/tree/master/docs/contributor#readme' ), 921 esc_html__( 'the project', 'buddypress' ) 922 ) 923 ); 924 ?> 925 </p> 918 926 919 927 <hr class="bp-hello-divider"/> … … 1477 1485 'bp-hello-js' => array( 1478 1486 'file' => "{$url}hello{$min}.js", 1479 'dependencies' => array( 'bp-thickbox', 'wp-api-request' ),1487 'dependencies' => array( 'bp-thickbox', 'wp-api-request', 'underscore', 'plugin-install' ), 1480 1488 'footer' => true, 1481 1489 ),
Note: See TracChangeset
for help on using the changeset viewer.