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
// Altera o termo Post para Noticia no WordPress | |
// Testado na versão 3.9.1 | |
function erikasarti_post_para_noticia_menu() { | |
// altera as labels do menu do painel administrativo | |
global $menu; | |
global $submenu; | |
$menu[5][0] = 'Notícias'; | |
$submenu['edit.php'][5][0] = 'Notícias'; |
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
// Define uma imagem anexada ao post como imagem destacada | |
function erikasarti_imagem_destacada_automatica() { | |
global $post; | |
$already_has_thumb = has_post_thumbnail($post->ID); | |
if (!$already_has_thumb) { | |
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
include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); | |
if ( is_plugin_active( 'pasta-do-plugin/arquivo-do-plugin.php' ) ) { | |
// Aqui vai o código do que você quer fazer | |
} |
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
// Desabilita os boxes do painel administrativo | |
function erikasarti_remove_wordpress_dashboard() { | |
remove_meta_box('dashboard_right_now', 'dashboard', 'normal'); // Agora | |
remove_meta_box('dashboard_activity', 'dashboard', 'normal'); // Atividade | |
remove_meta_box('dashboard_quick_press', 'dashboard', 'side'); // Rascunho rápido | |
remove_meta_box('dashboard_primary', 'dashboard', 'side'); // Novidades do WordPress | |
} |
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
// Desabilita o box "Bem-vindo ao WordPress!" no painel administrativo | |
remove_action('welcome_panel', 'wp_welcome_panel'); |
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
// 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 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 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 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; |
OlderNewer