Making WordPress.org

Changeset 5638


Ignore:
Timestamp:
07/09/2017 04:32:00 PM (7 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.

Location:
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support
Files:
1 added
2 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
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support/sidebar.php

    r5139 r5638  
    4040            <?php do_action( 'wporg_compat_view_sidebar' ); ?>
    4141
    42         <?php elseif ( bbp_is_single_topic() || bbp_is_topic_edit() || bbp_is_reply_edit() ) : ?>
     42        <?php elseif ( bbp_is_single_topic() || bbp_is_topic_edit() || bbp_is_single_reply() || bbp_is_reply_edit() ) : ?>
    4343
    4444            <?php do_action( 'wporg_compat_single_topic_sidebar_pre' ); ?>
Note: See TracChangeset for help on using the changeset viewer.