Skip to content

Instantly share code, notes, and snippets.

@jaworowicz
Created October 15, 2019 23:58
Show Gist options
  • Save jaworowicz/03e5df2a2097543bd5d8b66492ae0af6 to your computer and use it in GitHub Desktop.
Save jaworowicz/03e5df2a2097543bd5d8b66492ae0af6 to your computer and use it in GitHub Desktop.
Wyłączenie JSON REST API w WordPress - Plugin i gotowy kod do wklejenia w functions.php
<?php
/**
*
* @link https://jaworowi.cz
* @since 1.0.0
* @package restapi-disable
*
* @wordpress-plugin
* Plugin Name: JSON REST API DISABLE
* Plugin URI: https://jaworowi.cz
* Description: Wyłączenie dodawania adresów do REST API
* Version: 1.0.0
* Author: Jakub Jaworowicz
* Author URI: https://jaworowi.cz
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: restapi-disable
*/
// Wklej od kolejnej linii lub dodaj cały plik do folderu /wp-content/mu-plugins
// Wyłączenie LINKU do JSON REST API WORDPRESS
remove_action('wp_head', 'rest_output_link_wp_head', 10);
// Wyłacz linki oEmbed
remove_action('wp_head', 'wp_oembed_add_discovery_links', 10);
// Wyłącz odnośniki w headerze HTTP
remove_action('template_redirect', 'rest_output_link_header', 11, 0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment