Skip to content

Commit

Permalink
Add new
Browse files Browse the repository at this point in the history
  • Loading branch information
yannkozon committed Dec 16, 2016
1 parent db74485 commit 7e59e3b
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
27 changes: 27 additions & 0 deletions disable-rest-api.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php
defined('ABSPATH') or die();
/*
MU Plugin: disable-rest-api
Description: Disable rest api
Author: Yann Kozon
Author URI: http://www.yannkozon.com
*/

function mu_disable_rest_api( ) {
remove_action( 'init', 'rest_api_init' );
remove_action( 'parse_request', 'rest_api_loaded' );

remove_action( 'xmlrpc_rsd_apis', 'rest_output_rsd' );
remove_action( 'wp_head', 'rest_output_link_wp_head' );
remove_action( 'template_redirect', 'rest_output_link_header', 11 );
remove_action( 'auth_cookie_malformed', 'rest_cookie_collect_status' );
remove_action( 'auth_cookie_expired', 'rest_cookie_collect_status' );
remove_action( 'auth_cookie_bad_username', 'rest_cookie_collect_status' );
remove_action( 'auth_cookie_bad_hash', 'rest_cookie_collect_status' );
remove_action( 'auth_cookie_valid', 'rest_cookie_collect_status' );

add_filter( 'rest_enabled', '__return_false' );
add_filter( 'rest_jsonp_enabled', '__return_false' );
}

mu_disable_rest_api();
10 changes: 10 additions & 0 deletions remove-post-revisions.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php
defined('ABSPATH') or die();
/*
MU Plugin: remove-post-revisions
Description: Remove post revisions
Author: Yann Kozon
Author URI: http://www.yannkozon.com
*/

define( 'WP_POST_REVISIONS', false );
10 changes: 10 additions & 0 deletions remove-theme-editor.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php
defined('ABSPATH') or die();
/*
MU Plugin: remove-theme-editor
Description: Remove theme editor
Author: Yann Kozon
Author URI: http://www.yannkozon.com
*/

define( 'DISALLOW_FILE_EDIT', true );

0 comments on commit 7e59e3b

Please sign in to comment.