This file contains 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 | |
function my_targeted_link_rel( $rel_values ) { | |
return 'noopener'; | |
} | |
add_filter( 'wp_targeted_link_rel', 'my_targeted_link_rel', 999 ); | |
?> |
This file contains 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 | |
function enable_vcard_upload( $mime_types ){ | |
$mime_types['vcf'] = 'text/vcard'; | |
$mime_types['vcard'] = 'text/vcard'; | |
return $mime_types; | |
} | |
add_filter('upload_mimes', 'enable_vcard_upload' ); | |
?> |
This file contains 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('use_block_editor_for_post', '__return_false', 10); | |
?> |
This file contains 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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
# Redirect all http to naked https in 1 hop | |
RewriteCond %{HTTPS} !on [NC] | |
RewriteRule ^(.*)$ https://domain\.com/$1 [R=301,L] | |
# Redirect all https www to naked https in 1 hop | |
RewriteCond %{HTTP_HOST} ^www\.domain\.com [NC] | |
RewriteRule ^(.*)$ https://domain\.com/$1 [R=301,L] |
This file contains 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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
# Redirect all naked http(s) to https www in 1 hop | |
RewriteCond %{HTTP_HOST} ^domain\.com [NC] | |
RewriteRule ^(.*)$ https://www\.domain\.com/$1 [R=301,L] | |
# Redirect all http www to https www in 1 hop | |
RewriteCond %{HTTPS} !on [NC] | |
RewriteRule ^(.*)$ https://www\.domain\.com/$1 [R=301,L] |
This file contains 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
html { | |
box-sizing: border-box; | |
} | |
*, | |
*:before, | |
*:after { | |
box-sizing: inherit; | |
} |
This file contains 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 | |
function redirect_attachment_urls() { | |
if ( is_attachment() ) { | |
wp_redirect( wp_get_attachment_url(), 301 ); | |
exit(); | |
} | |
} | |
add_action( 'template_redirect', 'redirect_attachment_urls' ); |
This file contains 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 | |
function dequeue_woo() { | |
if ( function_exists( 'is_woocommerce' ) ) { | |
if ( ! is_woocommerce() && ! is_cart() && ! is_checkout() && ! is_account_page() ) { | |
// Styles | |
wp_dequeue_style( 'woocommerce-general' ); | |
wp_dequeue_style( 'woocommerce-layout' ); | |
wp_dequeue_style( 'woocommerce-smallscreen' ); | |
// Scripts |
This file contains 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 | |
function dequeue_select2() { | |
if ( class_exists( 'woocommerce' ) ) { | |
// Styles | |
wp_dequeue_style( 'select2' ); | |
wp_deregister_style( 'select2' ); | |
// Scripts | |
wp_dequeue_script( 'selectWoo' ); | |
wp_deregister_script( 'selectWoo' ); |