Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable Site Management? #1452

Closed
MarcWoodyard opened this issue Dec 21, 2014 · 4 comments
Closed

Disable Site Management? #1452

MarcWoodyard opened this issue Dec 21, 2014 · 4 comments

Comments

@MarcWoodyard
Copy link

Is there a way to disable site management for WordPress multisite?

Thanks,
Marc

@jeherve
Copy link
Member

jeherve commented Dec 22, 2014

Yes, you can hide the Site Management banner and force deactivate the JSON API module on all sites of your network with this code:

// First, hide the Remote Site Management banner
add_filter( 'can_display_jetpack_manage_notice', '__return_false' );

/*
 * Then, force deactivate the JSON API module if it was activated in the past
 * Note that this can break things you're using,
 * like remote editors such as StackEdit or Display Posts widgets displaying content from that site
 */
function jeherve_force_deactivate_jsonapi() {
    if ( class_exists( 'Jetpack' ) && Jetpack::is_module_active( 'json-api' ) ) {
        Jetpack::deactivate_module( 'json-api' );
    }
}
add_action( 'init', 'jeherve_force_deactivate_jsonapi' );

// And now, hide the JSON API module from the listing
function jeherve_kill_jsonapi( $modules ) {
    unset( $modules['json-api'] );
    return $modules;
}
add_filter( 'jetpack_get_available_modules', 'jeherve_kill_jsonapi' );

@jeherve jeherve closed this as completed Dec 22, 2014
@MarcWoodyard
Copy link
Author

Thanks for the reply Jeherve. Where would I add this code?

Thanks,
Marc

@jeherve
Copy link
Member

jeherve commented Dec 23, 2014

You can paste this code in a functionality plugin.

IT's worth noting that Site Management is disabled by default. This code just stops site admins in your Multisite network from enabling it.

@MarcWoodyard
Copy link
Author

Thanks for the help. It worked!

Thanks again, and happy holidays!
-Marc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants