Plugin Directory

Changeset 1231528

Timestamp:
08/26/2015 09:58:13 PM (9 years ago)
Author:
dougal
Message:

Version 1.3. Working with modern versions of WordPress again. Just for fun.

Location:
theme-preview
Files:
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • theme-preview/tags/1.3/readme.txt

    r193857 r1231528  
    33Donate link: http://dougal.gunters.org/donate
    44Tags: themes, presentation, testing, preview, css, admin, themepreview, theme preview, preview theme
    5 Requires at least: 1.5
    6 Tested up to: 3.0-alpha
    7 Stable Tag: 1.2
     5Requires at least:
     6Tested up to:
     7Stable Tag: 1.
    88
    99Allows you test how a theme looks on your site without activating it.
     
    4444* Restrict preview ability by user Roles/Capabilities.
    4545
     46
     47
     48
     49
     50
    4651== Changelog ==
     52
     53
     54
    4755= 1.2 2010-01-14 =
    4856* Tested with WordPress 3.0-alpha
     57
  • theme-preview/tags/1.3/theme-preview.php

    r193858 r1231528  
    66 * Author: Dougal Campbell
    77 * Author URI: http://dougal.gunters.org/
    8  * Version: 1.2
     8 * Version: 1.
    99 */
    1010
     
    2121 *  * Use cookies to allow persistent theme previews.
    2222 *
     23
     24
     25
     26
    2327 * DEMO:
    2428 *  http://dougal.gunters.org/blog/2005/03/09/theme-preview-plugin/
    2529 */
    2630
    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 */
     32add_action('setup_theme', 'gr_preview_theme_init');
    3033
    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;
    3437
    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');
     38function 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
    3856}
    3957
    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 */
    4558function use_preview_theme($themename) {
    4659    global $gr_preview_theme;
     
    5568}
    5669
    57 ?>
  • theme-preview/trunk/readme.txt

    r193857 r1231528  
    33Donate link: http://dougal.gunters.org/donate
    44Tags: themes, presentation, testing, preview, css, admin, themepreview, theme preview, preview theme
    5 Requires at least: 1.5
    6 Tested up to: 3.0-alpha
    7 Stable Tag: 1.2
     5Requires at least:
     6Tested up to:
     7Stable Tag: 1.
    88
    99Allows you test how a theme looks on your site without activating it.
     
    4444* Restrict preview ability by user Roles/Capabilities.
    4545
     46
     47
     48
     49
     50
    4651== Changelog ==
     52
     53
     54
    4755= 1.2 2010-01-14 =
    4856* Tested with WordPress 3.0-alpha
     57
  • theme-preview/trunk/theme-preview.php

    r193858 r1231528  
    66 * Author: Dougal Campbell
    77 * Author URI: http://dougal.gunters.org/
    8  * Version: 1.2
     8 * Version: 1.
    99 */
    1010
     
    2121 *  * Use cookies to allow persistent theme previews.
    2222 *
     23
     24
     25
     26
    2327 * DEMO:
    2428 *  http://dougal.gunters.org/blog/2005/03/09/theme-preview-plugin/
    2529 */
    2630
    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 */
     32add_action('setup_theme', 'gr_preview_theme_init');
    3033
    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;
    3437
    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');
     38function 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
    3856}
    3957
    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 */
    4558function use_preview_theme($themename) {
    4659    global $gr_preview_theme;
     
    5568}
    5669
    57 ?>
Note: See TracChangeset for help on using the changeset viewer.