Skip to:
Content

BuddyPress.org

Changeset 10536


Ignore:
Timestamp:
02/06/2016 01:11:09 AM (4 years ago)
Author:
djpaul
Message:

Emails: only register post type and taxonomy on root site.

Prevent the post type appearing on non-root site wp-admin screen in a
network-activated multisite configuration, while retaining single-site
and multiblog compatibility.

A subsequent change will add support for these items to the network
admin for network-activated multisite configuration.

See #6592

Location:
trunk/src/bp-core
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-taxonomy.php

    r10474 r10536  
    2727
    2828    // Email type.
    29     register_taxonomy(
    30         bp_get_email_tax_type(),
    31         bp_get_email_post_type(),
    32         apply_filters( 'bp_register_email_tax_type', array(
    33             'description'   => _x( 'BuddyPress email types', 'email type taxonomy description', 'buddypress' ),
    34             'labels'        => bp_get_email_tax_type_labels(),
    35             'meta_box_cb'   => 'bp_email_tax_type_metabox',
    36             'public'        => false,
    37             'query_var'     => false,
    38             'rewrite'       => false,
    39             'show_in_menu'  => false,
    40             'show_tagcloud' => false,
    41             'show_ui'       => bp_current_user_can( 'bp_moderate' ),
    42         ) )
    43     );
     29    if ( bp_is_root_blog() && ! is_network_admin() ) {
     30        register_taxonomy(
     31            bp_get_email_tax_type(),
     32            bp_get_email_post_type(),
     33            apply_filters( 'bp_register_email_tax_type', array(
     34                'description'   => _x( 'BuddyPress email types', 'email type taxonomy description', 'buddypress' ),
     35                'labels'        => bp_get_email_tax_type_labels(),
     36                'meta_box_cb'   => 'bp_email_tax_type_metabox',
     37                'public'        => false,
     38                'query_var'     => false,
     39                'rewrite'       => false,
     40                'show_in_menu'  => false,
     41                'show_tagcloud' => false,
     42                'show_ui'       => bp_current_user_can( 'bp_moderate' ),
     43            ) )
     44        );
     45    }
    4446}
    4547add_action( 'bp_register_taxonomies', 'bp_register_default_taxonomies' );
  • trunk/src/bp-core/classes/class-bp-core.php

    r10518 r10536  
    299299
    300300        // Emails
    301         if ( bp_is_root_blog() ) {
     301        if ( bp_is_root_blog() && ! is_network_admin() ) {
    302302            register_post_type(
    303303                bp_get_email_post_type(),
Note: See TracChangeset for help on using the changeset viewer.