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
/* DETECTA SE É DISPOSITIVO MÓVEL | |
================================================== */ | |
function isMobile() { | |
return preg_match("/(android|avantgo|blackberry|bolt|boost|cricket|docomo|fone|hiptop|mini|mobi|palm|phone|pie|tablet|up\.browser|up\.link|webos|wos)/i", $_SERVER["HTTP_USER_AGENT"]); | |
} | |
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 aviso para atualizar o Wordpress | |
Alan | |
----------------- */ | |
function no_update_notification() { | |
if (!current_user_can('activate_plugins')) remove_action('admin_notices', 'update_nag', 3); | |
} |
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
/* ---------------- | |
Dá ao perfil "Editor" a permissão de editar o Menu em Aparência > Menus | |
Alan | |
----------------- */ | |
// pega o objeto "Role" do tipo "Editor" que é o caso do usuário "MMA" |
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
/* ---------------- | |
Deixa invisível o campo Plano de trabalho | |
Alan | |
----------------- */ | |
function ocultaPlanoDeTrabalho() { | |
echo '<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
/* ---------------- | |
Altera a logo na tela de login | |
Alan | |
----------------- */ | |
add_action( 'login_head', 'custom_login_logo' ); | |
function custom_login_logo() { |
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
/* ---------------- | |
Altera o label do campo de Nome de usuário para matrícula | |
Alan | |
----------------- */ | |
add_action('admin_head-user-new.php', 'setup_user_edit'); | |
add_action('admin_head-user-edit.php', 'setup_user_edit'); |
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
/* ---------------- | |
Altera os tamanhos de imagens | |
Alan | |
----------------- */ | |
function novos_tamanhos() { | |
add_image_size( 'banner', 824, 400, true ); | |
add_image_size( 'noticias-grande', 720, 345, 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
/* ---------------- | |
Pega a URL da página pelo nome | |
Alan | |
----------------- */ | |
function page_url($title) { | |
echo get_permalink( get_page_by_title( $title ) ); | |
} |
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
/* ---------------- | |
Copia / clona um role user para um novo | |
----------------- */ | |
add_action('init', 'cloneRole'); | |
function cloneRole() | |
{ |