Skip to content

Instantly share code, notes, and snippets.

View edcarreiro's full-sized avatar
🏠
Working from home

Eduardo Carreiro edcarreiro

🏠
Working from home
View GitHub Profile
add_filter( 'login_display_language_dropdown', '__return_false' );
add_filter( 'login_display_language_dropdown', '__return_false' );
@edcarreiro
edcarreiro / AutomaticCSS Var Names.php
Created January 21, 2022 12:28
Code Snippet Plugin
//AutomaticCSS Var Names
function acss_context_menu_enqueue_scripts() {
wp_register_script( 'acss-context-menu', '',);
wp_enqueue_script( 'acss-context-menu' );
$script = '
jQuery(document).ready(()=>{
console.log(\'ACSS-Context-Menu Code Snippet is active\')
let acssContextMenu = document.createElement(\'div\');
@edcarreiro
edcarreiro / AutomaticCSS To Global Colors.php
Created January 21, 2022 12:27
Inspect in a BUILDER - Not in Website ViewPort - and run on console
const colors = [
"primary",
"secondary",
"accent",
"base",
"shade"
]
const variations = [
"medium",
"hover",
body {
overflow: -moz-scrollbars-horizontal;
overflow-x: hidden;
overflow-y: auto;
}
.dnsAsWhole,
.ftpAsWhole,
.emailAsWhole {
display: none
}
.col-md-6 .table > thead > tr > th {color: #222}
#page-sidebar {
//WP Disable Gutenberg Editor
add_filter('use_block_editor_for_post_type', '__return_false', 10);
// Don't load Gutenberg-related stylesheets.
add_action( 'wp_enqueue_scripts', 'remove_block_css', 100 );
function remove_block_css() {
wp_dequeue_style( 'wp-block-library' ); // Wordpress core
wp_dequeue_style( 'wp-block-library-theme' ); // Wordpress core
wp_dequeue_style( 'wc-block-style' ); // WooCommerce
//WP Security Header
header('X-XSS-Protection: 1; mode=block');
header('X-Frame-Options: SAMEORIGIN');
header('Content-Security-Policy: frame-ancestors self; upgrade-insecure-requests');
header('Referrer-Policy: strict-origin-when-cross-origin, origin-when-cross-origin');
header('Permissions-Policy: geolocation=(self "https://topfornecedoresatacado.com.br/"), microphone=(), interest-cohort=()');
header('Strict-Transport-Security: max-age=31536000; includeSubDomains');
header('X-Content-Type-Options: nosniff');
?>
//WP Allow SVG
add_filter("upload_mimes", function ($mimes) {
$mimes["svg"] = "image/svg+xml";
return $mimes;
});
add_filter("wp_check_filetype_and_ext", function ($result, $file, $filename, $mimes) {
if (!$result["ext"] || !$result["type"]) {
//Disable WP Image Compression
add_filter( 'jpeg_quality', 'keep_jpeg_quality' );
function keep_jpeg_quality() {
return 100;
}
?>