Changeset 1231528
- Timestamp:
- 08/26/2015 09:58:13 PM (9 years ago)
- Location:
- theme-preview
- Files:
-
- 4 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
theme-preview/tags/1.3/readme.txt
r193857 r1231528 3 3 Donate link: http://dougal.gunters.org/donate 4 4 Tags: themes, presentation, testing, preview, css, admin, themepreview, theme preview, preview theme 5 Requires at least: 1.56 Tested up to: 3.0-alpha7 Stable Tag: 1. 25 Requires at least: 6 Tested up to: 7 Stable Tag: 1. 8 8 9 9 Allows you test how a theme looks on your site without activating it. … … 44 44 * Restrict preview ability by user Roles/Capabilities. 45 45 46 47 48 49 50 46 51 == Changelog == 52 53 54 47 55 = 1.2 2010-01-14 = 48 56 * Tested with WordPress 3.0-alpha 57 -
theme-preview/tags/1.3/theme-preview.php
r193858 r1231528 6 6 * Author: Dougal Campbell 7 7 * Author URI: http://dougal.gunters.org/ 8 * Version: 1. 28 * Version: 1. 9 9 */ 10 10 … … 21 21 * * Use cookies to allow persistent theme previews. 22 22 * 23 24 25 26 23 27 * DEMO: 24 28 * http://dougal.gunters.org/blog/2005/03/09/theme-preview-plugin/ 25 29 */ 26 30 27 /* Convenience variables */ 28 $gr_preview_theme = $_GET['preview_theme']; 29 $gr_preview_css = $_GET['preview_css']; 31 /* Hook on setup_theme so we can modify things */ 32 add_action('setup_theme', 'gr_preview_theme_init'); 30 33 31 / * If we don't override, CSS should come from same theme as template */32 if (! $gr_preview_css ) 33 $gr_preview_css = $gr_preview_theme;34 / 35 $gr_preview_theme = ''; 36 ; 34 37 35 /* Check for a valid theme directory, and set the template and stylesheet dirs */ 36 if($gr_preview_theme && file_exists(get_theme_root() . "/$gr_preview_theme")) { 37 add_filter('template','use_preview_theme'); 38 function gr_preview_theme_init() { 39 global $gr_preview_theme, $gr_preview_css; 40 41 $gr_preview_theme = $_GET['preview_theme']; 42 $gr_preview_css = $_GET['preview_css']; 43 44 if (! $gr_preview_css ) { 45 $gr_preview_css = $gr_preview_theme; 46 } 47 48 if($gr_preview_theme && file_exists(get_theme_root() . "/${gr_preview_theme}")) { 49 add_filter('template','use_preview_theme'); 50 } 51 52 if($gr_preview_css && file_exists(get_theme_root() . "/${gr_preview_css}")) { 53 add_filter('stylesheet','use_preview_css'); 54 } 55 38 56 } 39 57 40 if($gr_preview_css && file_exists(get_theme_root() . "/$gr_preview_css")) {41 add_filter('stylesheet','use_preview_css');42 }43 44 /* Filter callback functions */45 58 function use_preview_theme($themename) { 46 59 global $gr_preview_theme; … … 55 68 } 56 69 57 ?> -
theme-preview/trunk/readme.txt
r193857 r1231528 3 3 Donate link: http://dougal.gunters.org/donate 4 4 Tags: themes, presentation, testing, preview, css, admin, themepreview, theme preview, preview theme 5 Requires at least: 1.56 Tested up to: 3.0-alpha7 Stable Tag: 1. 25 Requires at least: 6 Tested up to: 7 Stable Tag: 1. 8 8 9 9 Allows you test how a theme looks on your site without activating it. … … 44 44 * Restrict preview ability by user Roles/Capabilities. 45 45 46 47 48 49 50 46 51 == Changelog == 52 53 54 47 55 = 1.2 2010-01-14 = 48 56 * Tested with WordPress 3.0-alpha 57 -
theme-preview/trunk/theme-preview.php
r193858 r1231528 6 6 * Author: Dougal Campbell 7 7 * Author URI: http://dougal.gunters.org/ 8 * Version: 1. 28 * Version: 1. 9 9 */ 10 10 … … 21 21 * * Use cookies to allow persistent theme previews. 22 22 * 23 24 25 26 23 27 * DEMO: 24 28 * http://dougal.gunters.org/blog/2005/03/09/theme-preview-plugin/ 25 29 */ 26 30 27 /* Convenience variables */ 28 $gr_preview_theme = $_GET['preview_theme']; 29 $gr_preview_css = $_GET['preview_css']; 31 /* Hook on setup_theme so we can modify things */ 32 add_action('setup_theme', 'gr_preview_theme_init'); 30 33 31 / * If we don't override, CSS should come from same theme as template */32 if (! $gr_preview_css ) 33 $gr_preview_css = $gr_preview_theme;34 / 35 $gr_preview_theme = ''; 36 ; 34 37 35 /* Check for a valid theme directory, and set the template and stylesheet dirs */ 36 if($gr_preview_theme && file_exists(get_theme_root() . "/$gr_preview_theme")) { 37 add_filter('template','use_preview_theme'); 38 function gr_preview_theme_init() { 39 global $gr_preview_theme, $gr_preview_css; 40 41 $gr_preview_theme = $_GET['preview_theme']; 42 $gr_preview_css = $_GET['preview_css']; 43 44 if (! $gr_preview_css ) { 45 $gr_preview_css = $gr_preview_theme; 46 } 47 48 if($gr_preview_theme && file_exists(get_theme_root() . "/${gr_preview_theme}")) { 49 add_filter('template','use_preview_theme'); 50 } 51 52 if($gr_preview_css && file_exists(get_theme_root() . "/${gr_preview_css}")) { 53 add_filter('stylesheet','use_preview_css'); 54 } 55 38 56 } 39 57 40 if($gr_preview_css && file_exists(get_theme_root() . "/$gr_preview_css")) {41 add_filter('stylesheet','use_preview_css');42 }43 44 /* Filter callback functions */45 58 function use_preview_theme($themename) { 46 59 global $gr_preview_theme; … … 55 68 } 56 69 57 ?>
Note: See TracChangeset
for help on using the changeset viewer.