💎 PREMIUM: Changeset/ - High Quality

Changeset 2261368


Ignore:
Timestamp:
03/15/2020 04:33:44 PM (6 years ago)
Author:
bashari
Message:

1.0.6

File:
1 edited

Legend:

Unmodified
Added
Removed
  • dev-theme/trunk/dev-theme.php

    r2261357 r2261368  
    33 * Plugin Name: Dev Theme
    44 * Description: This plugin can duplicate your theme to a special development theme that you can edit and use, while real users using your current theme
    5  * Version: 1.0.6
     5 * Version: 1.0.5
    66 */
    77
     
    1717
    1818        add_filter( 'template', [$this, 'devtheme_user_template'] );
    19         add_filter( 'stylesheet', [$this, 'devtheme_user_stylesheet'] ); // only WP smaller 3*
     19        add_filter( 'stylesheet', [$this, 'devtheme_user_stylesheet'] ); //  only WP smaller 3*
    2020        add_filter( 'option_template', [$this, 'devtheme_user_template'] );
    2121        add_filter( 'option_stylesheet', [$this, 'devtheme_user_stylesheet'] );
     
    150150    }
    151151
     152    public function is_dev_theme() {
     153        return ($this->getRealThemeDirName() !== $this->getDevThemePath() && $this->getDevThemePath() === get_stylesheet_directory());
     154    }
     155
    152156    public function devtheme_titles( $title ) {
    153157        return "** DEV ** $title";
     
    188192            <table class="form-table">
    189193                <tbody>
    190                     <tr>
    191                         <th scope="row">Dev Theme</th>
    192                         <td><label for="devtheme_activate"><input id="devtheme_activate" name="devtheme_activate" type="checkbox" value="checked" <?php if ( $activate == 'checked' ) echo 'checked'; ?>> Activate</label></td>
    193                     </tr>
     194                <tr>
     195                    <th scope="row">Dev Theme</th>
     196                    <td><label for="devtheme_activate"><input id="devtheme_activate" name="devtheme_activate" type="checkbox" value="checked" <?php if ( $activate == 'checked' ) echo 'checked'; ?>> Activate</label></td>
     197                </tr>
    194198                </tbody>
    195199            </table>
     
    264268        <table class="form-table">
    265269            <tbody>
    266                 <tr>
    267                     <td>
    268                         <a href="<?php echo admin_url('admin.php?page=dev-theme&deploy_dev_theme_to_main_theme'); ?>" class="button blue">Copy from dev theme to main theme (<?php echo $this->getRealThemeDirName(); ?>)</a>
    269                     </td>
    270                 </tr>
    271                 <tr>
    272                     <td>
    273                         <a href="<?php echo admin_url('admin.php?page=dev-theme&deploy_main_theme_to_dev_theme'); ?>" class="button blue">Copy from main theme (<?php echo $this->getRealThemeDirName(); ?>) to dev theme (this will override dev theme)</a>
    274                     </td>
    275                 </tr>
     270            <tr>
     271                <td>
     272                    <a href="<?php echo admin_url('admin.php?page=dev-theme&deploy_dev_theme_to_main_theme'); ?>" class="button blue">Copy from dev theme to main theme (<?php echo $this->getRealThemeDirName(); ?>)</a>
     273                </td>
     274            </tr>
     275            <tr>
     276                <td>
     277                    <a href="<?php echo admin_url('admin.php?page=dev-theme&deploy_main_theme_to_dev_theme'); ?>" class="button blue">Copy from main theme (<?php echo $this->getRealThemeDirName(); ?>) to dev theme (this will override dev theme)</a>
     278                </td>
     279            </tr>
    276280            </tbody>
    277281        </table>
     
    292296
    293297$dev_theme = new Dev_Theme();
     298
     299function dth_is_dev_theme() {
     300    global $dev_theme;
     301    return $dev_theme->is_dev_theme();
     302}
Note: See TracChangeset for help on using the changeset viewer.