Skip to:
Content

BuddyPress.org

Changeset 10109


Ignore:
Timestamp:
09/13/2015 07:37:54 PM (10 years ago)
Author:
dcavins
Message:

Limit class deletion in bp_get_the_post_class().

Prevent bp_get_the_post_class() from deleting
the zeroth element in the wp_classes array when
array_search() returns false.

Fixes #6615.

File:
1 edited

Legend:

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

    r10108 r10109  
    30413041    // we need to remove these classes since they did not exist before we switched
    30423042    // theme compat to use the 'page' post type
    3043     $page_key      = array_search( 'page',      $wp_classes );
     3043    $page_key = array_search( 'page', $wp_classes );
     3044    if ( $page_key !== false ) {
     3045        unset( $wp_classes[$page_key] );
     3046    }
     3047
    30443048    $page_type_key = array_search( 'type-page', $wp_classes );
    3045     unset( $wp_classes[$page_key], $wp_classes[$page_type_key] );
     3049    if ( $page_type_key !== false ) {
     3050        unset( $wp_classes[$page_type_key] );
     3051    }
    30463052
    30473053    // okay let's merge!
Note: See TracChangeset for help on using the changeset viewer.