Making WordPress.org

Ticket #2932: 2932.patch

File 2932.patch, 814 bytes (added by SergeyBiryukov, 7 years ago)
  • wordpress.org/public_html/wp-content/themes/pub/wporg-breathe/functions.php

     
    150150        return $args;
    151151}
    152152add_filter( 'nav_menu_item_args', __NAMESPACE__ . '\add_screen_reader_text_for_icon_menu_items', 10, 2 );
     153
     154/**
     155 * Disables the P2 Mentions on any handbook page.
     156 */
     157function wporg_p2_disable_mentions_for_handbooks() {
     158        if ( is_singular( 'handbook' ) && ! is_single( 'credits' ) ) {
     159                add_action( 'p2_found_mentions', '__return_empty_array', 100 );
     160        }
     161}
     162add_action( 'wp', 'wporg_p2_disable_mentions_for_handbooks' );