Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
07/23/2014 07:42:14 PM (10 years ago)
Author:
r-a-y
Message:

Theme compatibility: Fix issues with themes using post type conditionals.

Previously, when BP resets a post for theme compatibility, we set the
'post_type' to a post type that does not exist (eg. 'bp_activity'). For
themes doing conditional template loading based on the post type, BP's
theme compatibility would not kick in due to the non-existent post type.

This commit replaces all 'post_type' values in bp_theme_compat_reset_post()
to 'page' to address this problem.

For backward compatibility, this commit also modifies the post class to
emulate the older post classes prior to this commit resulting from the
'page' post type change.

Fixes #5418.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-members/bp-members-screens.php

    r8658 r8682  
    359359            'post_date'      => 0,
    360360            'post_content'   => '',
    361             'post_type'      => 'bp_members',
     361            'post_type'      => 'page',
    362362            'post_status'    => 'publish',
    363363            'is_page'        => true,
     
    421421            'post_date'      => 0,
    422422            'post_content'   => '',
    423             'post_type'      => 'bp_members',
     423            'post_type'      => 'page',
    424424            'post_status'    => 'publish',
    425425            'is_page'        => true,
     
    530530        }
    531531
    532         $post_type = bp_is_register_page() ? 'bp_register' : 'bp_activate';
    533 
    534532        bp_theme_compat_reset_post( array(
    535533            'ID'             => 0,
     
    538536            'post_date'      => 0,
    539537            'post_content'   => '',
    540             'post_type'      => $post_type,
     538            'post_type'      => 'page',
    541539            'post_status'    => 'publish',
    542540            'is_page'        => true,
Note: See TracChangeset for help on using the changeset viewer.