Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/18/2020 07:42:10 PM (3 years ago)
Author:
imath
Message:

Administration: remove pre-WordPress 4.8 Admin page headers code

Now the WordPress required version for BuddyPress is >= 4.9, we can remove pre-WordPress 4.8 back compatibility code from Admin page headers.

Fixes #8330

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-groups/bp-groups-admin.php

    r12664 r12724  
    583583
    584584    <div class="wrap">
    585         <?php if ( version_compare( $GLOBALS['wp_version'], '4.8', '>=' ) ) : ?>
    586 
    587             <h1 class="wp-heading-inline"><?php _e( 'Edit Group', 'buddypress' ); ?></h1>
    588 
    589             <?php if ( is_user_logged_in() && bp_user_can_create_groups() ) : ?>
    590                 <a class="page-title-action" href="<?php echo trailingslashit( bp_get_groups_directory_permalink() . 'create' ); ?>"><?php _e( 'Add New', 'buddypress' ); ?></a>
    591             <?php endif; ?>
    592 
    593             <hr class="wp-header-end">
    594 
    595         <?php else : ?>
    596 
    597             <h1><?php _e( 'Edit Group', 'buddypress' ); ?>
    598 
    599                 <?php if ( is_user_logged_in() && bp_user_can_create_groups() ) : ?>
    600                     <a class="add-new-h2" href="<?php echo trailingslashit( bp_get_groups_directory_permalink() . 'create' ); ?>"><?php _e( 'Add New', 'buddypress' ); ?></a>
    601                 <?php endif; ?>
    602 
    603             </h1>
    604 
     585        <h1 class="wp-heading-inline"><?php _e( 'Edit Group', 'buddypress' ); ?></h1>
     586
     587        <?php if ( is_user_logged_in() && bp_user_can_create_groups() ) : ?>
     588            <a class="page-title-action" href="<?php echo trailingslashit( bp_get_groups_directory_permalink() . 'create' ); ?>"><?php _e( 'Add New', 'buddypress' ); ?></a>
    605589        <?php endif; ?>
     590
     591        <hr class="wp-header-end">
    606592
    607593        <?php // If the user has just made a change to an group, display the status messages. ?>
     
    770756
    771757    <div class="wrap">
    772         <?php if ( version_compare( $GLOBALS['wp_version'], '4.8', '>=' ) ) : ?>
    773 
    774             <h1 class="wp-heading-inline"><?php _e( 'Groups', 'buddypress' ); ?></h1>
    775 
    776             <?php if ( is_user_logged_in() && bp_user_can_create_groups() ) : ?>
    777                 <a class="page-title-action" href="<?php echo trailingslashit( bp_get_groups_directory_permalink() . 'create' ); ?>"><?php _e( 'Add New', 'buddypress' ); ?></a>
    778             <?php endif; ?>
    779 
    780             <?php if ( !empty( $_REQUEST['s'] ) ) : ?>
    781                 <span class="subtitle"><?php printf( __( 'Search results for &#8220;%s&#8221;', 'buddypress' ), wp_html_excerpt( esc_html( stripslashes( $_REQUEST['s'] ) ), 50 ) ); ?></span>
    782             <?php endif; ?>
    783 
    784             <hr class="wp-header-end">
    785 
    786         <?php else : ?>
    787 
    788         <h1>
    789             <?php _e( 'Groups', 'buddypress' ); ?>
    790 
    791             <?php if ( is_user_logged_in() && bp_user_can_create_groups() ) : ?>
    792                 <a class="add-new-h2" href="<?php echo trailingslashit( bp_get_groups_directory_permalink() . 'create' ); ?>"><?php _e( 'Add New', 'buddypress' ); ?></a>
    793             <?php endif; ?>
    794 
    795             <?php if ( !empty( $_REQUEST['s'] ) ) : ?>
    796                 <span class="subtitle"><?php printf( __( 'Search results for &#8220;%s&#8221;', 'buddypress' ), wp_html_excerpt( esc_html( stripslashes( $_REQUEST['s'] ) ), 50 ) ); ?></span>
    797             <?php endif; ?>
    798         </h1>
    799 
     758
     759        <h1 class="wp-heading-inline"><?php _e( 'Groups', 'buddypress' ); ?></h1>
     760
     761        <?php if ( is_user_logged_in() && bp_user_can_create_groups() ) : ?>
     762            <a class="page-title-action" href="<?php echo trailingslashit( bp_get_groups_directory_permalink() . 'create' ); ?>"><?php _e( 'Add New', 'buddypress' ); ?></a>
    800763        <?php endif; ?>
     764
     765        <?php if ( !empty( $_REQUEST['s'] ) ) : ?>
     766            <span class="subtitle"><?php printf( __( 'Search results for &#8220;%s&#8221;', 'buddypress' ), wp_html_excerpt( esc_html( stripslashes( $_REQUEST['s'] ) ), 50 ) ); ?></span>
     767        <?php endif; ?>
     768
     769        <hr class="wp-header-end">
    801770
    802771        <?php // If the user has just made a change to an group, display the status messages. ?>
Note: See TracChangeset for help on using the changeset viewer.