| | 1705 | /** |
| | 1706 | * Remove "prev" and "next" relational links from <head> on BuddyPress pages. |
| | 1707 | * |
| | 1708 | * WordPress automatically generates these relational links to the current |
| | 1709 | * page. However, BuddyPress doesn't adhere to these links. In this |
| | 1710 | * function, we remove these links when on a BuddyPress page. This also |
| | 1711 | * prevents additional, unnecessary queries from running. |
| | 1712 | * |
| | 1713 | * @since BuddyPress (2.1.0) |
| | 1714 | */ |
| | 1715 | function bp_remove_adjacent_posts_rel_link() { |
| | 1716 | if ( ! is_buddypress() ) { |
| | 1717 | return; |
| | 1718 | } |
| | 1719 | |
| | 1720 | remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 ); |
| | 1721 | } |
| | 1722 | add_action( 'bp_init', 'bp_remove_adjacent_posts_rel_link' ); |
| | 1723 | |