Search
 
SCRIPT & CODE EXAMPLE
 

PHP

How to Disable the WordPress JSON REST API Without Plugin

<?php
 add_filter( 'rest_authentication_errors', 'wp_snippet_disable_rest_api' );
   function wp_snippet_disable_rest_api( $access ) {
      return new WP_Error( 'rest_disabled', __('The WordPress REST API has been disabled.'), array( 'status' => rest_authorization_required_code()));
   }
?>
Comment

PREVIOUS NEXT
Code Example
Php :: php datetime object get unix timestamp 
Php :: get yesterday date in php 
Php :: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress. 
Php :: php get user ip address 
Php :: how to set field type of date of birth in laravel 
Php :: php convert array to json object 
Php :: how to create controller in specific folder laravel 
Php :: flutter form set next input 
Php :: laravel delete confirm link 
Php :: wp get term link 
Php :: create session in wordpress 
Php :: Fatal error: Maximum execution time of 120 seconds exceeded in 
Php :: wait php 
Php :: php utf 8 sqlsrv 
Php :: reload page in php 
Php :: python truncate file contents 
Php :: in_array in php 
Php :: doument root phpp 
Php :: Check duplicate email in laravel using jQuery validation 
Php :: get logged in user name yii2 
Php :: php fpm status check 
Php :: php check if extension is installed 
Php :: Laravel Add regx on password 
Php :: mysql timestamp format php 
Php :: php array of objects filter 
Php :: php random float number with 2 decimal places 
Php :: php header redirect same page 
Php :: php qatorni teskari aylantirish 
Php :: undefined variable _session 
Php :: do shortcode wordpress 
ADD CONTENT
Topic
Content
Source link
Name
9+2 =