Skip to:
Content

BuddyPress.org

Changeset 12718


Ignore:
Timestamp:
09/11/2020 07:37:47 PM (4 months ago)
Author:
johnjamesjacoby
Message:

Settings: Do not show "View" links for missing pages.

This commit adds get_post() checks to an existing comparison to ensure that some UI elements are not incorrectly shown. This bug could arise if component pages are trashed & deleted after BuddyPress is deactivated, causing a mismatch between the bp-pages option and the pages that exist on the site.

Fixes #8362.

File:
1 edited

Legend:

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

    r12588 r12718  
    144144                            ) ); ?>
    145145
    146                             <?php if ( !empty( $existing_pages[$name] ) ) : ?>
     146                            <?php if ( ! empty( $existing_pages[ $name ] ) && get_post( $existing_pages[ $name ] ) ) : ?>
    147147
    148148                                <a href="<?php echo esc_url( get_permalink( $existing_pages[$name] ) ); ?>" class="button-secondary" target="_bp">
     
    228228                            ) ) ?>
    229229
    230                             <?php if ( !empty( $existing_pages[$name] ) ) : ?>
     230                            <?php if ( ! empty( $existing_pages[ $name ] ) && get_post( $existing_pages[ $name ] ) ) : ?>
    231231
    232232                                <a href="<?php echo get_permalink( $existing_pages[$name] ); ?>" class="button-secondary" target="_bp"><?php _e( 'View', 'buddypress' ); ?></a>
Note: See TracChangeset for help on using the changeset viewer.