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
// Muda o logotipo e o link na tela de login do painel administrativo | |
function loginpage_custom_link() { | |
return get_bloginfo('url'); | |
} | |
add_filter('login_headerurl','loginpage_custom_link'); | |
function change_title_on_logo() { | |
return 'Voltar para ' . get_bloginfo('name'); |
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
// Muda o logotipo na tela de login do painel administrativo | |
function my_custom_login_logo() { | |
echo ' | |
<style type="text/css"> | |
.login h1 a { | |
background-image:url('.get_bloginfo('template_directory').'/login.png) !important; | |
background-size: 300px 150px; | |
height: 150px;} | |
</style>'; |
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
// Mostra a data da última atualização do post | |
Atualizado em <?php the_modified_time('d/m/Y'); ?> | |
// Mostra a data da última atualização do post dentro da tag <time> | |
Atualizado em <time datetime="<?php the_modified_time('Y-m-d'); ?>"><?php the_modified_time('d/m/Y'); ?></time> |
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_action('admin_notices', 'meu_aviso'); | |
function meu_aviso() { | |
global $current_user ; | |
$user_id = $current_user->ID; | |
if ( ! get_user_meta($user_id, 'ignorar_aviso') ) { | |
echo '<div class="updated"><p>'; | |
printf(__('<strong>Aviso!</strong> O manual de atualização do WordPress foi atualizado e a nova versão está disponível na Intranet. <a href="%1$s">Não mostrar essa mensagem novamente</a>'), '?ignorar_aviso=0'); | |
echo '</p></div>'; | |
} |
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 erikasarti_dequeue_css() { | |
wp_dequeue_style( 'wp-block-library' ); | |
} | |
add_action( 'wp_enqueue_scripts', 'erikasarti_dequeue_css', 100 ); |
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
// Remove um nome de usuário reservado no WordPress Multisite | |
function erikasarti_remove_usuario_multisite( $user_login ) { | |
global $wpdb; | |
$success = false; | |
if ( false !== $wpdb->delete( $wpdb->signups, array( 'user_login' => sanitize_text_field( $user_login ) ) ) ) { | |
$success = true; |
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
// REMOVE O CÓDIGO DESNECESSÁRIO NOS SITES QUE NÃO USAM EMOJIS | |
remove_action('wp_head', 'print_emoji_detection_script', 7); | |
remove_action('wp_print_styles', 'print_emoji_styles'); | |
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' ); | |
remove_action( 'admin_print_styles', 'print_emoji_styles' ); | |
add_filter( 'emoji_svg_url', '__return_false' ); |
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
// Criar um widget no painel administrativo do WordPress | |
function erikasarti_dashboard_widget_manual() { | |
echo '<p>Olá, este é um widget personalizado.</p>'; | |
echo '<p>Você pode <a href="http://erikasarti.com/" target="_blank">acrescentar um link</a> ou <strong>marcações html</strong> nele.</p>'; | |
} | |
function erikasarti_adiciona_dashboard_widget_manual() { | |
add_meta_box('id', 'Meu widget personalizado', 'erikasarti_dashboard_widget_manual', 'dashboard', 'side', 'high'); | |
} |
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
// Desabilita widgets | |
function erikasarti_remove_widget() { | |
unregister_widget( 'WP_Widget_Archives' ); // Arquivos | |
unregister_widget( 'WP_Widget_Media_Audio' ); // Áudios | |
unregister_widget( 'WP_Widget_Block' ); // Bloco | |
unregister_widget( 'WP_Widget_Categories' ); // Categorias | |
unregister_widget( 'WP_Widget_Recent_Comments' ); // Comentários | |
unregister_widget( 'WP_Widget_Media_Gallery' ); // Galeria |
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
// Desabilita o box "Bem-vindo ao WordPress!" no painel administrativo | |
remove_action('welcome_panel', 'wp_welcome_panel'); |
NewerOlder