brasofilo

Swap theme for user

Apr 27th, 2012
84
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. /*
  3.     Plugin Name: Trocar Tema
  4.     Version: 1.0
  5.     Author: brasofilo
  6.     Author URI: http://brasofilo.com
  7. */
  8.  
  9. /* Trocar de tema conforme o usuario */
  10. function change_theme( $template = '' ) {
  11.     global $current_user;
  12.     get_currentuserinfo();
  13.     if ( $current_user->user_login === 'SEU-NOME-DE-USUARIO' ) {
  14.         // NOME DO TEMPLATE ALTERNATIVO
  15.         $template = 'twentyten';
  16.     }  
  17.     return $template;
  18. }
  19. add_filter('template', 'change_theme');
  20. add_filter('option_template', 'change_theme');
  21. add_filter('option_stylesheet', 'change_theme');
RAW Paste Data