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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
/* ---------------- | |
Copia / clona um role user para um novo | |
----------------- */ | |
add_action('init', 'cloneRole'); | |
function cloneRole() | |
{ |
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
/* ---------------- | |
Pega a URL da página pelo nome | |
Alan | |
----------------- */ | |
function page_url($title) { | |
echo get_permalink( get_page_by_title( $title ) ); | |
} |
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 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 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 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 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 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 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); | |
} |
OlderNewer