Skip to:
Content

BuddyPress.org

Ticket #8588: 8588-empty-table.patch

File 8588-empty-table.patch, 2.9 KB (added by oztaser, 5 years ago)
  • src/bp-core/admin/bp-core-admin-slugs.php

    diff --git src/bp-core/admin/bp-core-admin-slugs.php src/bp-core/admin/bp-core-admin-slugs.php
    index 2dcf86146..aeca37fdb 100644
    function bp_core_admin_slugs_options() { 
    188188                                <?php esc_html_e( 'Associate WordPress Pages with the following BuddyPress Registration pages.', 'buddypress' ); ?>
    189189                                <?php esc_html_e( 'These pages will only be reachable by users who are not logged in.', 'buddypress' ); ?>
    190190                        </p>
     191
     192                        <table class="form-table">
     193                                <tbody>
     194
     195                                        <?php foreach ( $static_pages as $name => $label ) : ?>
     196
     197                                                <tr valign="top">
     198                                                        <th scope="row">
     199                                                                <label for="bp_pages[<?php echo esc_attr( $name ) ?>]"><?php echo esc_html( $label ) ?></label>
     200                                                        </th>
     201
     202                                                        <td>
     203
     204                                                                <?php if ( ! bp_is_root_blog() ) switch_to_blog( bp_get_root_blog_id() ); ?>
     205
     206                                                                <?php echo wp_dropdown_pages( array(
     207                                                                        'name'             => 'bp_pages[' . esc_attr( $name ) . ']',
     208                                                                        'echo'             => false,
     209                                                                        'show_option_none' => __( '- None -', 'buddypress' ),
     210                                                                        'selected'         => !empty( $existing_pages[$name] ) ? $existing_pages[$name] : false
     211                                                                ) ) ?>
     212
     213                                                                <?php if ( ! bp_is_root_blog() ) restore_current_blog(); ?>
     214
     215                                                        </td>
     216                                                </tr>
     217
     218                                        <?php endforeach; ?>
     219
     220                                        <?php
     221
     222                                        /**
     223                                         * Fires after the display of default static pages for BuddyPress setup.
     224                                         *
     225                                         * @since 1.5.0
     226                                         */
     227                                        do_action( 'bp_active_external_pages' ); ?>
     228
     229                                </tbody>
     230                        </table>
    191231                <?php else : ?>
    192232                        <?php if ( is_multisite() ) : ?>
    193233                                <p>
    function bp_core_admin_slugs_options() { 
    218258                                        ?>
    219259                                </p>
    220260                        <?php endif; ?>
    221                 <?php endif; ?>
    222 
    223                 <table class="form-table">
    224                         <tbody>
    225 
    226                                 <?php if ( bp_allow_access_to_registration_pages() ) : foreach ( $static_pages as $name => $label ) : ?>
    227 
    228                                         <tr valign="top">
    229                                                 <th scope="row">
    230                                                         <label for="bp_pages[<?php echo esc_attr( $name ) ?>]"><?php echo esc_html( $label ) ?></label>
    231                                                 </th>
    232 
    233                                                 <td>
    234 
    235                                                         <?php if ( ! bp_is_root_blog() ) switch_to_blog( bp_get_root_blog_id() ); ?>
    236 
    237                                                         <?php echo wp_dropdown_pages( array(
    238                                                                 'name'             => 'bp_pages[' . esc_attr( $name ) . ']',
    239                                                                 'echo'             => false,
    240                                                                 'show_option_none' => __( '- None -', 'buddypress' ),
    241                                                                 'selected'         => !empty( $existing_pages[$name] ) ? $existing_pages[$name] : false
    242                                                         ) ) ?>
    243 
    244                                                         <?php if ( ! bp_is_root_blog() ) restore_current_blog(); ?>
    245 
    246                                                 </td>
    247                                         </tr>
    248 
    249                                 <?php endforeach; endif; ?>
    250 
    251                                 <?php
    252 
    253                                 /**
    254                                  * Fires after the display of default static pages for BuddyPress setup.
    255                                  *
    256                                  * @since 1.5.0
    257                                  */
    258                                 do_action( 'bp_active_external_pages' ); ?>
    259 
    260                         </tbody>
    261                 </table>
    262 
    263                 <?php
     261                <?php endif;
    264262        endif;
    265263}
    266264