Create a gist now

Instantly share code, notes, and snippets.

@Nodws /WPConfig
Last active Jan 12, 2017

What would you like to do?
home and theme dirs
define('td', get_bloginfo('template_directory').'/' );
define('hd', esc_url(home_url( '/' )));
//WPconfig
$path = '/path';
define( 'WP_SITEURL', 'http://' . $_SERVER['SERVER_NAME'] . $path );
define( 'WP_HOME', 'http://' . $_SERVER['HTTP_HOST'] . $path );
define( 'AUTOSAVE_INTERVAL', 3600 );
define( 'WP_POST_REVISIONS', 3 );
define( 'WP_MAX_MEMORY_LIMIT', '256M' );
//define( 'DISALLOW_FILE_EDIT', true );
define( 'WP_HTTP_BLOCK_EXTERNAL', true );
define( 'IMAGE_EDIT_OVERWRITE', true );
//define( 'WP_AUTO_UPDATE_CORE', false );
define( 'WP_DEBUG', false );
//ini_set( 'display_errors', 'On' );
// Disable login modals introduced in WordPress 3.6
remove_action( 'admin_enqueue_scripts', 'wp_auth_check_load' );
//Disable annoying index redirect
remove_filter('template_redirect', 'redirect_canonical');
// Disable useless tags
remove_action( 'wp_head', 'rsd_link' );
remove_action( 'wp_head', 'wlwmanifest_link' );
remove_action( 'wp_head', 'wp_generator' );
remove_action( 'wp_head', 'start_post_rel_link' );
remove_action( 'wp_head', 'index_rel_link' );
remove_action( 'wp_head', 'adjacent_posts_rel_link' );
remove_action( 'wp_head', 'wp_shortlink_wp_head' );
// all rubbish related to emojis
remove_action( 'admin_print_styles', 'print_emoji_styles' );
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );
// filter to remove TinyMCE emojis
add_filter( 'tiny_mce_plugins', 'disable_emojicons_tinymce' );
// Remove useless retina images
add_filter( 'wp_calculate_image_srcset', __return_false );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment