Making WordPress.org

Changeset 6663


Ignore:
Timestamp:
02/16/2018 05:37:43 PM (9 years ago)
Author:
iandunn
Message:

WordCamp Misc: Reactivate CampTix on Central, but disable admin menu.

r6617 broke the [camptix_tshirt_report] shortcode on ​https://central.wordcamp.org/reports/t-shirt-sizes/. This restores it, but hides the menu in wp-admin to maintain the original purpose of disabling the plugin.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/wcorg-misc.php

    r6617 r6663  
    8686 */
    8787function wcorg_disable_network_activated_plugins_on_sites( $plugins ) {
    88 
    8988        /*
    9089         * central.wordcamp.org, plan.wordcamp.org
    … …  
    9998                unset( $plugins['wc-canonical-years/wc-canonical-years.php'] );
    10099                unset( $plugins['wordcamp-organizer-nags/wordcamp-organizer-nags.php'] );
    101                 unset( $plugins['camptix/camptix.php'] );
    102100                unset( $plugins['wc-post-types/wc-post-types.php'] );
    103101        }
    … …  
    107105         */
    108106        if ( 63 === get_current_blog_id() ) {
     107                unset( $plugins['camptix/camptix.php'] );
    109108                unset( $plugins['wordcamp-payments/bootstrap.php'] );
    110109                unset( $plugins['wordcamp-payments-network/bootstrap.php'] );
    … …  
    114113}
    115114add_filter( 'site_option_active_sitewide_plugins', 'wcorg_disable_network_activated_plugins_on_sites' );
     115
     116/**
     117 * Remove menu items on certain sites.
     118 *
     119 * This works together with `wcorg_disable_network_activated_plugins_on_sites()`. There are some plugins that we
     120 * need running on sites so we can use some of their internals, but don't use the main features, and don't want
     121 * them cluttering the UI.
     122 */
     123function wcorg_remove_admin_menu_pages_on_sites() {
     124        if ( get_current_blog_id() === BLOG_ID_CURRENT_SITE ) {
     125                remove_menu_page( 'edit.php?post_type=tix_ticket' );
     126        }
     127}
     128add_action( 'admin_menu', 'wcorg_remove_admin_menu_pages_on_sites', 11 );
    116129
    117130/*
Note: See TracChangeset for help on using the changeset viewer.