Skip to content

Instantly share code, notes, and snippets.

@jgorinjac
Forked from vovafeldman/functions.php
Created October 31, 2016 22:44
Show Gist options
  • Save jgorinjac/3c26ef3c77e10ba1d0f0f38f3c18bda9 to your computer and use it in GitHub Desktop.
Save jgorinjac/3c26ef3c77e10ba1d0f0f38f3c18bda9 to your computer and use it in GitHub Desktop.

Revisions

  1. @vovafeldman vovafeldman revised this gist Oct 19, 2016. 1 changed file with 19 additions and 19 deletions.
    38 changes: 19 additions & 19 deletions functions.php
    Original file line number Diff line number Diff line change
    @@ -1,26 +1,26 @@
    <?php
    // Disable emoji.
    remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
    remove_action( 'wp_print_styles', 'print_emoji_styles' );
    // Disable emoji.
    remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
    remove_action( 'wp_print_styles', 'print_emoji_styles' );

    // Cleanup RPC.
    remove_action( 'wp_head', 'rsd_link' );
    remove_action( 'wp_head', 'wlwmanifest_link' );
    // Cleanup RPC.
    remove_action( 'wp_head', 'rsd_link' );
    remove_action( 'wp_head', 'wlwmanifest_link' );

    // Cleanup oembed.
    remove_action( 'wp_head', 'wp_oembed_add_discovery_links' );
    remove_action( 'wp_head', 'wp_oembed_add_host_js' );
    // Cleanup oembed.
    remove_action( 'wp_head', 'wp_oembed_add_discovery_links' );
    remove_action( 'wp_head', 'wp_oembed_add_host_js' );

    // Remove WP generator meta.
    remove_action( 'wp_head', 'wp_generator' );
    // Remove WP generator meta.
    remove_action( 'wp_head', 'wp_generator' );

    // Disable XML RPC
    add_filter( 'xmlrpc_methods', function ( $methods ) {
    unset( $methods['pingback.ping'] );
    // Disable XML RPC
    add_filter( 'xmlrpc_methods', function ( $methods ) {
    unset( $methods['pingback.ping'] );

    return $methods;
    } );
    return $methods;
    } );

    // Disable RESTful API.
    add_filter('json_enabled', '__return_false');
    add_filter('json_jsonp_enabled', '__return_false');
    // Disable RESTful API.
    add_filter('json_enabled', '__return_false');
    add_filter('json_jsonp_enabled', '__return_false');
  2. @vovafeldman vovafeldman revised this gist Oct 15, 2016. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion functions.php
    Original file line number Diff line number Diff line change
    @@ -19,4 +19,8 @@
    unset( $methods['pingback.ping'] );

    return $methods;
    } );
    } );

    // Disable RESTful API.
    add_filter('json_enabled', '__return_false');
    add_filter('json_jsonp_enabled', '__return_false');
  3. @vovafeldman vovafeldman created this gist Oct 13, 2016.
    22 changes: 22 additions & 0 deletions functions.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    <?php
    // Disable emoji.
    remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
    remove_action( 'wp_print_styles', 'print_emoji_styles' );

    // Cleanup RPC.
    remove_action( 'wp_head', 'rsd_link' );
    remove_action( 'wp_head', 'wlwmanifest_link' );

    // Cleanup oembed.
    remove_action( 'wp_head', 'wp_oembed_add_discovery_links' );
    remove_action( 'wp_head', 'wp_oembed_add_host_js' );

    // Remove WP generator meta.
    remove_action( 'wp_head', 'wp_generator' );

    // Disable XML RPC
    add_filter( 'xmlrpc_methods', function ( $methods ) {
    unset( $methods['pingback.ping'] );

    return $methods;
    } );