Skip to:
Content

bbPress.org


Ignore:
Timestamp:
06/04/2017 10:30:35 PM (7 years ago)
Author:
johnjamesjacoby
Message:

BuddyPress: Only wrap titles in h2 tags if they are not empty.

Allows easier overriding if titles are not desired at all.

See #3105.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/extend/buddypress/groups.php

    r6482 r6488  
    887887
    888888                        // Setup the forum
    889                         bbp_the_forum(); ?>
    890 
    891                         <h2><?php bbp_forum_title(); ?></h2>
    892 
    893                         <?php bbp_get_template_part( 'content', 'single-forum' );
     889                        bbp_the_forum();
     890
     891                        // Only wrap title in H2 if not empty
     892                        $title = bbp_get_forum_title();
     893                        if ( ! empty( $title ) ) {
     894                            echo '<h2>' . $title . '</h2>';
     895                        }
     896
     897                        // Output forum
     898                        bbp_get_template_part( 'content', 'single-forum' );
    894899
    895900                    // No forums found
     
    920925                    // If no topic, 404
    921926                    if ( ! bbp_topics() ) {
    922                         bp_do_404( bbp_get_forum_permalink( $forum_id ) ); ?>
    923                         <h2><?php bbp_forum_title(); ?></h2>
    924                         <?php bbp_get_template_part( 'feedback', 'no-topics' );
     927                        bp_do_404( bbp_get_forum_permalink( $forum_id ) );
     928
     929                        // Only wrap title in H2 if not empty
     930                        $title = bbp_get_forum_title();
     931                        if ( ! empty( $title ) ) {
     932                            echo '<h2>' . $title . '</h2>';
     933                        }
     934
     935                        // No topics
     936                        bbp_get_template_part( 'feedback', 'no-topics' );
    925937                        break;
    926938                    }
    927939
    928940                    // Setup the topic
    929                     bbp_the_topic(); ?>
    930 
    931                     <h2><?php bbp_topic_title(); ?></h2>
    932 
    933                     <?php
     941                    bbp_the_topic();
     942
     943                    // Only wrap title in H2 if not empty
     944                    $title = bbp_get_topic_title();
     945                    if ( ! empty( $title ) ) {
     946                        echo '<h2>' . $title . '</h2>';
     947                    }
    934948
    935949                    // Topic edit
     
    982996                    // If no topic, 404
    983997                    if ( ! bbp_replies() ) {
    984                         bp_do_404( bbp_get_forum_permalink( $forum_id ) ); ?>
    985                         <h2><?php bbp_forum_title(); ?></h2>
    986                         <?php bbp_get_template_part( 'feedback', 'no-replies' );
     998                        bp_do_404( bbp_get_forum_permalink( $forum_id ) );
     999
     1000                        // Only wrap title in H2 if not empty
     1001                        $title = bbp_get_forum_title();
     1002                        if ( ! empty( $title ) ) {
     1003                            echo '<h2>' . $title . '</h2>';
     1004                        }
     1005
     1006                        // No replies
     1007                        bbp_get_template_part( 'feedback', 'no-replies' );
    9871008                        break;
    9881009                    }
    9891010
    9901011                    // Setup the reply
    991                     bbp_the_reply(); ?>
    992 
    993                     <h2><?php bbp_reply_title(); ?></h2>
    994 
    995                     <?php if ( bp_action_variable( $offset + 2 ) === bbp_get_edit_rewrite_id() ) :
     1012                    bbp_the_reply();
     1013
     1014                    // Only wrap title in H2 if not empty
     1015                    $title = bbp_get_reply_title();
     1016                    if ( ! empty( $title ) ) {
     1017                        echo '<h2>' . $title . '</h2>';
     1018                    }
     1019
     1020                    if ( bp_action_variable( $offset + 2 ) === bbp_get_edit_rewrite_id() ) :
    9961021
    9971022                        // Set the edit switches
Note: See TracChangeset for help on using the changeset viewer.