Skip to:
Content

bbPress.org

Ticket #3337: 3337.1.patch

File 3337.1.patch, 1.5 KB (added by johnjamesjacoby, 5 years ago)
  • src/includes/core/actions.php

     
    433433add_action( 'bbp_template_redirect', 'bbp_check_reply_edit',      10 );
    434434add_action( 'bbp_template_redirect', 'bbp_check_topic_tag_edit',  10 );
    435435
     436// Must be after bbp_template_include_theme_compat
     437add_action( 'bbp_template_redirect', 'bbp_remove_adjacent_posts', 10 );
     438
    436439// Theme-side POST requests
    437440add_action( 'bbp_post_request', 'bbp_do_ajax',                1  );
    438441add_action( 'bbp_post_request', 'bbp_edit_topic_tag_handler', 1  );
  • src/includes/core/theme-compat.php

     
    10261026        // Filter & return
    10271027        return (bool) apply_filters( 'bbp_force_comment_status', $retval, $open, $post_id, $post_type );
    10281028}
     1029
     1030/**
     1031 * Remove "prev" and "next" relational links from <head> on bbPress pages.
     1032 *
     1033 * WordPress automatically generates these relational links to the current
     1034 * page, but bbPress does not use these links, nor would they work the same.
     1035 *
     1036 * In this function, we remove these links when on a bbPress page. This also
     1037 * prevents additional, unnecessary queries from running.
     1038 *
     1039 * @since 2.6.0 bbPress (r7071)
     1040 */
     1041function bbp_remove_adjacent_posts() {
     1042
     1043        // Bail if not a bbPress page
     1044        if ( ! is_bbpress() ) {
     1045                return;
     1046        }
     1047
     1048        // Remove the WordPress core action for adjacent posts
     1049        remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10 );
     1050}