Skip to:
Content

BuddyPress.org

Changeset 13687


Ignore:
Timestamp:
01/03/2024 04:44:33 AM (18 months ago)
Author:
imath
Message:

Add directory post type entries to "page on front" choices if needed

When the rewrites URL parser is in use, to preserve the possibility to use a BuddyPress directory as the site's front page, we need to append the corresponding post type IDs to the available pages listed into the WP "page on front" reading setting as BP Directories are stored as buddypress post types instead of the page one.

On the other hand, when the legacy URL parser is in use (eg: BP Classic is active), to prevent duplicates, it's important to leave the "page on front" reading setting choices the way WP sets it as BP Directories are stored as page post types.

Props emaralive

See #9052 (trunk)

File:
1 edited

Legend:

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

    r13522 r13687  
    957957 */
    958958function bp_core_include_directory_on_front( $pages = array(), $args = array() ) {
     959    // Prevent duplicate "page on front" option values when the 'legacy' BuddyPress URL Parser is in use.
     960    if ( 'rewrites' !== bp_core_get_query_parser() ) {
     961        return $pages;
     962    }
     963
    959964    $is_page_on_front_dropdown = false;
    960965
Note: See TracChangeset for help on using the changeset viewer.