SHARE
TWEET

Untitled

a guest Jun 15th, 2019 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. add_action('admin_notices', 'meu_aviso');
  2.  
  3. function meu_aviso() {
  4.   global $current_user ;
  5.   $user_id = $current_user->ID;
  6.   if ( ! get_user_meta($user_id, 'ignorar_aviso') ) {
  7.     echo '<div class="updated"><p>';
  8.     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');
  9.     echo '</p></div>';
  10.   }
  11. }
  12.  
  13. add_action('admin_init', 'ignorar_aviso');
  14.  
  15. function ignorar_aviso() {
  16.   global $current_user;
  17.   $user_id = $current_user->ID;
  18.   if ( isset($_GET['ignorar_aviso']) && '0' == $_GET['ignorar_aviso'] ) {
  19.     add_user_meta($user_id, 'ignorar_aviso', 'true', true);
  20.     }
  21. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top