Making WordPress.org

Changeset 972


Ignore:
Timestamp:
11/11/2014 08:11:53 AM (9 years ago)
Author:
coffee2code
Message:

WP.org P2 theme: disable P2 mentions on any non-credit handbook page (not just for make/core)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-p2/functions.php

    r878 r972  
    7979add_action( 'wp_enqueue_scripts', 'wporg_p2_iphone_style_override', 1001 );
    8080
    81 // disable the P2 Mentions on the /core/handbook site
    82 if ( 'make.wordpress.org' === DOMAIN_CURRENT_SITE && 0 === strpos( $_SERVER['REQUEST_URI'], '/core/handbook' ) ) {
    83     add_action( 'p2_found_mentions', '__return_empty_array' );
     81// Disable the P2 Mentions on any handbook page
     82function wporg_p2_disable_mentions_for_handbooks() {
     83    if ( is_singular( 'handbook' ) && ! is_single( 'credits' ) ) {
     84        add_action( 'p2_found_mentions', '__return_empty_array', 100 );
     85    }
    8486}
     87add_action( 'wp', 'wporg_p2_disable_mentions_for_handbooks' );
    8588
    86 
Note: See TracChangeset for help on using the changeset viewer.