This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Redis Test | |
Plugin URI: https://wordpress.org/plugins/redis-cache/ | |
Description: Redis connection test. | |
Author: Till Krüss | |
Version: 1.0 | |
Author URI: https://till.im/ | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Kernel extends HttpKernel | |
{ | |
protected $middleware = [ | |
\App\Http\Middleware\TrustedProxies::class, | |
]; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Redis; | |
use Redis; | |
use Illuminate\Redis\Database as RedisDatabase; | |
use Illuminate\Contracts\Redis\Database as DatabaseContract; | |
class Database extends RedisDatabase implements DatabaseContract | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// increase `timeout` for `api.wordpress.org` requests | |
add_filter( 'http_request_args', function( $request, $url ) { | |
if ( strpos( $url, '://api.wordpress.org/' ) !== false ) { | |
$request[ 'timeout' ] = 15; | |
} | |
return $request; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// add query string cache buster to W3TC minified stylesheet links | |
add_action( 'init', function() { | |
// is css minify enabled? | |
if ( isset( $GLOBALS[ '_w3tc_ob_callbacks' ][ 'minify' ] ) && $GLOBALS[ '_w3tc_ob_callbacks' ][ 'minify' ][0]->_config->get_cache_option( 'minify.css.enable' ) ) { | |
// store original minify callback | |
$GLOBALS[ '_w3tc_ob_callbacks' ][ 'minify-org' ] = $GLOBALS[ '_w3tc_ob_callbacks' ][ 'minify' ]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'admin_init', function() { | |
// remove the color scheme picker | |
remove_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' ); | |
// force all users to use the "Ectoplasm" color scheme | |
add_filter( 'get_user_option_admin_color', function() { | |
return 'ectoplasm'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'get_user_option_admin_color', function( $color_scheme ) { | |
global $_wp_admin_css_colors; | |
if ( ! isset( $_wp_admin_css_colors[ $color_scheme ] ) ) { | |
$color_scheme = 'ectoplasm'; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'template_redirect', function() { | |
global $wp_query; | |
if ( is_home() || $wp_query->is_singular( 'post' ) || $wp_query->is_post_type_archive( 'post' ) ) { | |
header( $_SERVER[ 'SERVER_PROTOCOL' ] . ' 404 Not Found' ); | |
$wp_query->set_404(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// always paste as plain text | |
foreach ( array( 'tiny_mce_before_init', 'teeny_mce_before_init') as $filter ) { | |
add_filter( $filter, function( $mceInit ) { | |
$mceInit[ 'paste_text_sticky' ] = true; | |
$mceInit[ 'paste_text_sticky_default' ] = true; | |
return $mceInit; | |
}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'admin_menu', function() { | |
remove_submenu_page( 'edit.php', 'edit-tags.php?taxonomy=post_tag' ); // Remove menu link under "Posts" | |
}); | |
add_action( 'admin_menu', function() { | |
remove_meta_box( 'tagsdiv-post_tag', 'post', 'side'); // Remove metabox on add/edit post screen | |
}); | |
add_filter( 'manage_posts_columns', function($columns) { | |
unset( $columns['tags'] ); // Remove "Tags" column in post listing |