Making WordPress.org


Ignore:
Timestamp:
07/09/2017 04:32:00 PM (8 years ago)
Author:
SergeyBiryukov
Message:

Support Theme: Add a template for single replies.

Also add a workaround for missing is_single query var so that bbpress and single-reply classes are properly added to <body>.

Fixes #2551.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support/functions.php

    r5637 r5638  
    543543add_filter( 'bbp_get_topic_edit_url', 'wporg_support_fix_pending_posts_reply_url', 10, 2 );
    544544add_filter( 'bbp_get_reply_edit_url', 'wporg_support_fix_pending_posts_reply_url', 10, 2 );
     545
     546/**
     547 * Set 'is_single' query var to true on single replies.
     548 *
     549 * @see https://meta.trac.wordpress.org/ticket/2551
     550 * @see https://bbpress.trac.wordpress.org/ticket/3055
     551 *
     552 * @param array $args Theme compat query vars.
     553 * @return array
     554 */
     555function wporg_support_set_is_single_on_single_replies( $args ) {
     556    if ( bbp_is_single_reply() ) {
     557        $args['is_single'] = true;
     558    }
     559
     560    return $args;
     561}
     562add_filter( 'bbp_after_theme_compat_reset_post_parse_args', 'wporg_support_set_is_single_on_single_replies' );
    545563
    546564
Note: See TracChangeset for help on using the changeset viewer.