Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View kagg-design's full-sized avatar

Igor at KAGG Design kagg-design

View GitHub Profile
<?php
/**
* Plugin Name: Mihdan: Disable Plugins For REST API
* Description: Отключить все плагины при запросах REST API для увеличения скорости ответов
* Version: 1.0
* Author: Mikhail Kobzarev
* Author URI: https://www.kobzarev.com/
*/
if ( false !== strpos( $_SERVER['REQUEST_URI'], '/wp-json' ) ) {
@Rodrigo54
Rodrigo54 / php-html-css-js-minifier.php
Last active April 21, 2024 15:38 — forked from taufik-nurrohman/php-html-css-js-minifier.php
PHP Function to Minify HTML, CSS and JavaScript
<?php
/**
* -----------------------------------------------------------------------------------------
* Based on `https://github.com/mecha-cms/mecha-cms/blob/master/system/kernel/converter.php`
* -----------------------------------------------------------------------------------------
*/
// HTML Minifier
function minify_html($input) {
@mattclements
mattclements / function.php
Last active April 16, 2024 17:04
Wordpress Disable Comments (add to function.php)
<?php
add_action('admin_init', function () {
// Redirect any user trying to access comments page
global $pagenow;
if ($pagenow === 'edit-comments.php') {
wp_redirect(admin_url());
exit;
}