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 | |
/** | |
* Global Trade Identification Numbers (GTINs) to WooCommerce products. | |
* Render the Global Trade Identification Number (GTIN) meta field. | |
*/ | |
function woocommerce_render_gtin_field() { | |
$input = array( | |
'id' => '_gtin', | |
'label' => sprintf( | |
'<abbr title="%1$s">%2$s</abbr>', |
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 | |
/** | |
* Change default WP login errors message. | |
*/ | |
add_filter('login_errors', function (): string { | |
return 'Invalid credentials ¯\_(ツ)_/¯'; | |
}); | |
/** |
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 | |
// | |
// | |
// Below is the code that cleans up dashboard and admin bar | |
// | |
// | |
// | |
// Remove admin bar from frontend |
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
# API Key | |
First of all create a free account here and create an API key to use the blacklist: https://www.abuseipdb.com | |
# UFW | |
You should have installed and started UFW, test it with | |
```bash | |
ufw status | |
``` | |
# Cronjob |
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
add_filter( 'astra_enable_default_fonts', 'temp_disable_astra_fonts' ); | |
function temp_disable_astra_fonts( $load ) { | |
$load = false; | |
return $load; | |
} | |
add_action( 'wp_head', 'add_astra_fonts_preload', 1 ); | |
function add_astra_fonts_preload() { | |
?> | |
<link rel="preload" href="<?php echo get_site_url(); ?>/wp-content/themes/astra/assets/fonts/astra.woff" as="font" crossorigin /> | |
<link rel="preload" href="<?php echo get_site_url(); ?>/wp-content/themes/astra/assets/fonts/astra.ttf" as="font" crossorigin /> |
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
function removeCustomPostTypesFromTinyMCELinkBuilder($query){ | |
$key = false; | |
$cpt_to_remove = array( | |
'oxy_user_library', | |
'ct_template' | |
); | |
foreach ($cpt_to_remove as $custom_post_type) { | |
$key = array_search($custom_post_type, $query['post_type']); |
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
/** | |
* Oxy-Dummy activation (thank you Sridhar Katakam) | |
* Paste this code snippet in your Oxygen's customization plugin | |
* or copy the file to /wp-content/plugins/customization-plugin/ | |
*/ | |
remove_filter( 'template', 'ct_oxygen_template_name' ); | |
remove_filter( 'template_directory', 'ct_disable_theme_load', 1, 1 ); | |
remove_filter( 'stylesheet_directory', 'ct_disable_theme_load', 1, 1 ); |
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
/** | |
* Add Oxygen's global colors to Gutenberg's backend editor palette | |
*/ | |
function pavenum_gutenberg_oxygen_palette() { | |
$gutenberg_colors = []; | |
$oxy_colors = oxy_get_global_colors(); | |
foreach( $oxy_colors['colors'] as $oxy_color) { | |
$gutenberg_colors[] = [ 'name' => $oxy_color['name'], 'slug' => 'color-' . $oxy_color['id'], 'color' => $oxy_color['value'] ]; |
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 | |
/** | |
* composer require sentry/sentry-sdk | |
*/ | |
use Sentry; | |
Env::init(); | |
// Bedrock application config... | |
if (env('SENTRY_DSN')) { | |
Sentry\init([ | |
'dsn' => env('SENTRY_DSN'), |
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('style_loader_src', 'modify_lato_google_font'); | |
function modify_lato_google_font( $src ) { | |
$catch= preg_match('/family=Lato/', $src, $matches ); | |
if($catch) { | |
$parts = preg_split('/&subset=/', $src); | |
$src = $parts[0] . '|Oswald:regular,700|EB+Garamond,400'; | |
//error_log(var_export($src, true), 0); | |
if(!is_admin() && ( is_home() || in_category(12) )) { |