| 880 | |
| 881 | /** |
| 882 | * On a BuddyPress page, force post type to 'page' to avoid template issues. |
| 883 | * |
| 884 | * Most notably with is_singular( get_post_type() ) calls since BP's post |
| 885 | * types defined in {@link bp_theme_compat_reset_post()} do not exist. |
| 886 | * |
| 887 | * @since BuddyPress (2.0.0) |
| 888 | * |
| 889 | * @param object $query The WP_Query object. |
| 890 | */ |
| 891 | function bp_theme_compat_loop_start( $query ) { |
| 892 | |
| 893 | // theme compat isn't on, so stop now! |
| 894 | if ( ! bp_is_theme_compat_active() ) { |
| 895 | return; |
| 896 | } |
| 897 | |
| 898 | $query->post->post_type = 'page'; |
| 899 | } |
| 900 | add_action( 'loop_start', 'bp_theme_compat_loop_start' ); |