Skip to:
Content

BuddyPress.org

Changeset 13586


Ignore:
Timestamp:
09/28/2023 02:18:35 AM (9 months ago)
Author:
dcavins
Message:

Add help tab content for URL settings screen.

Props imath.

Fixes #8958.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/admin/bp-core-admin-functions.php

    r13549 r13586  
    671671function bp_core_add_contextual_help( $screen = '' ) {
    672672
    673     $screen = get_current_screen();
     673    $screen   = get_current_screen();
     674    $bp_forum = sprintf(
     675        '<a href="%1$s">%2$s</a>',
     676        esc_url( 'https://buddypress.org/support/' ),
     677        esc_html__( 'Support Forums', 'buddypress' )
     678    );
    674679
    675680    switch ( $screen->id ) {
     
    686691            );
    687692
     693            $manage_components = sprintf(
     694                '<a href="%1$s">%2$s</a>',
     695                esc_url( 'https://codex.buddypress.org/getting-started/configure-components/' ),
     696                esc_html__( 'Managing Components', 'buddypress' )
     697            );
     698
    688699            // Help panel - sidebar links.
    689700            $screen->set_help_sidebar(
    690                 '<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' .
    691                 '<p>' . __( '<a href="https://codex.buddypress.org/getting-started/configure-components/">Managing Components</a>', 'buddypress' ) . '</p>' .
    692                 '<p>' . __( '<a href="https://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>'
     701                '<p><strong>' . esc_html__( 'For more information:', 'buddypress' ) . '</strong></p>' .
     702                '<p>' . $manage_components . '</p>' .
     703                '<p>' . $bp_forum . '</p>'
     704            );
     705            break;
     706
     707        // Component page.
     708        case 'settings_page_bp-rewrites':
     709            // Help tabs.
     710            $screen->add_help_tab(
     711                array(
     712                    'id'      => 'bp-rewrites-overview',
     713                    'title'   => esc_html__( 'Overview', 'buddypress' ),
     714                    'content' => bp_core_add_contextual_help_content( 'bp-rewrites-overview' ),
     715                )
     716            );
     717
     718            // Help panel - sidebar links.
     719            $screen->set_help_sidebar(
     720                '<p><strong>' . esc_html__( 'For more information:', 'buddypress' ) . '</strong></p>' .
     721                '<p>' . $bp_forum . '</p>'
    693722            );
    694723            break;
     
    700729                array(
    701730                    'id'      => 'bp-settings-overview',
    702                     'title'   => __( 'Overview', 'buddypress' ),
     731                    'title'   => esc_html__( 'Overview', 'buddypress' ),
    703732                    'content' => bp_core_add_contextual_help_content( 'bp-settings-overview' ),
    704733                )
    705734            );
    706735
     736            $manage_settings = sprintf(
     737                '<a href="%1$s">%2$s</a>',
     738                esc_url( 'https://codex.buddypress.org/getting-started/configure-components/#settings-buddypress-settings' ),
     739                esc_html__( 'Managing Settings', 'buddypress' )
     740            );
     741
    707742            // Help panel - sidebar links.
    708743            $screen->set_help_sidebar(
    709                 '<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' .
    710                 '<p>' . __( '<a href="https://codex.buddypress.org/getting-started/configure-components/#settings-buddypress-settings">Managing Settings</a>', 'buddypress' ) . '</p>' .
    711                 '<p>' . __( '<a href="https://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>'
     744                '<p><strong>' . esc_html__( 'For more information:', 'buddypress' ) . '</strong></p>' .
     745                '<p>' . $manage_settings . '</p>' .
     746                '<p>' . $bp_forum . '</p>'
    712747            );
    713748
     
    725760            );
    726761
     762            $manage_profile_fields = sprintf(
     763                '<a href="%1$s">%2$s</a>',
     764                esc_url( 'https://codex.buddypress.org/administrator-guide/extended-profiles/' ),
     765                esc_html__( 'Managing Profile Fields', 'buddypress' )
     766            );
     767
    727768            // Help panel - sidebar links.
    728769            $screen->set_help_sidebar(
    729                 '<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' .
    730                 '<p>' . __( '<a href="https://codex.buddypress.org/administrator-guide/extended-profiles/">Managing Profile Fields</a>', 'buddypress' ) . '</p>' .
    731                 '<p>' . __( '<a href="https://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>'
     770                '<p><strong>' . esc_html__( 'For more information:', 'buddypress' ) . '</strong></p>' .
     771                '<p>' . $manage_profile_fields . '</p>' .
     772                '<p>' . $bp_forum . '</p>'
    732773            );
    733774
     
    736777}
    737778add_action( 'load-settings_page_bp-components', 'bp_core_add_contextual_help' );
     779add_action( 'load-settings_page_bp-rewrites', 'bp_core_add_contextual_help' );
    738780add_action( 'load-settings_page_bp-settings', 'bp_core_add_contextual_help' );
    739781add_action( 'load-users_page_bp-profile-setup', 'bp_core_add_contextual_help' );
     
    762804            break;
    763805
     806        case 'bp-rewrites-overview':
     807            $retval = __( 'Customize the page titles and URL slugs for the BuddyPress screens on your site.', 'buddypress' ) . '<br /><br />' . __( 'The <strong>title</strong> is the page title displayed above the BuddyPress content. For example, the page title "Members" is shown above the members directory.', 'buddypress' ) . '<br /><br />' . __( 'A <strong>slug</strong> is a portion of the URL itself. For instance, "members" is the members directory slug in the following example URL: <code>https://mysite.org/members</code>. Slugs should only include lowercase letters, numbers, and hyphens.', 'buddypress' );
     808            break;
     809
    764810        default:
    765811            $retval = false;
     
    769815    // Wrap text in a paragraph tag.
    770816    if ( ! empty( $retval ) ) {
    771         $retval = '<p>' . $retval . '</p>';
     817        $allowed_tags = array(
     818            'br'     => true,
     819            'code'   => true,
     820            'strong' => true,
     821        );
     822
     823        $retval = '<p>' . wp_kses( $retval, $allowed_tags ) . '</p>';
    772824    }
    773825
Note: See TracChangeset for help on using the changeset viewer.