// ── Esconder Text Slider antigo e injetar Shots do CPT ──
function shots_replace_text_slider() {
// CSS para esconder o text slider antigo
echo '';
echo '';
// Injetar o novo widget após o H3 "Shots"
echo '';
}
add_action( 'wp_footer', 'shots_replace_text_slider' );
// ── Remover Font Awesome IE7 (desnecessário) ──
function shots_remove_ie7_css() {
wp_dequeue_style( 'font-awesome-ie7-css' );
wp_deregister_style( 'font-awesome-ie7-css' );
}
add_action( 'wp_enqueue_scripts', 'shots_remove_ie7_css', 20 );
// ── Otimizar Google Fonts ──
function shots_optimize_google_fonts() {
// Adicionar preconnect (carrega DNS antes)
echo '' . "\n";
echo '' . "\n";
}
add_action( 'wp_head', 'shots_optimize_google_fonts', 1 );
// Adicionar display=swap na URL das fontes
function shots_font_display_swap( $html, $handle ) {
if ( $handle === 'google-fonts' ) {
$html = str_replace( 'googleapis.com/css?', 'googleapis.com/css?display=swap&', $html );
}
return $html;
}
add_filter( 'style_loader_tag', 'shots_font_display_swap', 10, 2 );
// ── Remover emoji script ──
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
// ── Remover assets do Text Slider no front-end ──
function shots_remove_textslider_assets() {
wp_dequeue_style( 'text-slider-plugin-styles' );
wp_dequeue_script( 'text-sliderslider-plugin-script' );
wp_dequeue_script( 'text-slider-plugin-script' );
wp_dequeue_style( 'font-awesome-css' );
}
add_action( 'wp_enqueue_scripts', 'shots_remove_textslider_assets', 20 );
/* Forçar wp_mail a enviar como HTML */
add_filter( 'wp_mail_content_type', function() {
return 'text/html';
});
?>