Skip to content

Instantly share code, notes, and snippets.

@redsoxfan2499
Last active November 18, 2019 02:08
Show Gist options
  • Save redsoxfan2499/f9f56a6032c4b96b065ef0cb8e78c589 to your computer and use it in GitHub Desktop.
Save redsoxfan2499/f9f56a6032c4b96b065ef0cb8e78c589 to your computer and use it in GitHub Desktop.
wordpress wp-config settings
define( 'DISALLOW_FILE_EDIT', true ); // turn off Editors access for themes and plugin from admin
define( 'WP_AUTO_UPDATE_CORE', minor );
define( 'WP_DEBUG', true ); // turns on debugging for WP. Must be on to write to log file
define( 'WP_DEBUG_DISPLAY', false ); // this turns off debug errors from showing on the front end
define( 'WP_DEBUG_LOG', true ); // turn on writing to WP debug log file
// allow to do updates from admin
define('FS_METHOD', 'direct');
// custom function to write to WordPress Debug Log
// must have following in the wp-config file
// define('WP_DEBUG', true); turns on debugging for WP. Must be on to write to log file
// define( 'WP_DEBUG_DISPLAY', false ); this turns off debug errors from showing on the front end
// define( 'WP_DEBUG_LOG', true ); turn on writing to WP debug log file
if (!function_exists('write_to_debug_log')) {
function write_to_debug_log ( $log ) {
if ( true === WP_DEBUG ) {
if ( is_array( $log ) || is_object( $log ) ) {
error_log( print_r( $log, true ) );
} else {
error_log( $log );
}
}
}
}
write_to_debug_log('WW API Error: Response set is empty.');
/**
* Disable the emoji's
*/
function disable_emojis() {
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_action( 'admin_print_styles', 'print_emoji_styles' );
remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );
remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
add_filter( 'tiny_mce_plugins', 'disable_emojis_tinymce' );
}
add_action( 'init', 'disable_emojis' );
/**
* Filter function used to remove the tinymce emoji plugin.
*
* @param array $plugins
* @return array Difference betwen the two arrays
*/
function disable_emojis_tinymce( $plugins ) {
if ( is_array( $plugins ) ) {
return array_diff( $plugins, array( 'wpemoji' ) );
} else {
return array();
}
}
DISABLE GUTENBERG FOR ALL WP
/**
* Disable Gutenberg Block Editor
*/
add_filter('use_block_editor_for_post', '__return_false');
define( 'DISALLOW_FILE_EDIT', true );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment