Changeset 2261368
- Timestamp:
- 03/15/2020 04:33:44 PM (6 years ago)
- File:
-
- 1 edited
-
dev-theme/trunk/dev-theme.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dev-theme/trunk/dev-theme.php
r2261357 r2261368 3 3 * Plugin Name: Dev Theme 4 4 * 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. 65 * Version: 1.0.5 6 6 */ 7 7 … … 17 17 18 18 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* 20 20 add_filter( 'option_template', [$this, 'devtheme_user_template'] ); 21 21 add_filter( 'option_stylesheet', [$this, 'devtheme_user_stylesheet'] ); … … 150 150 } 151 151 152 public function is_dev_theme() { 153 return ($this->getRealThemeDirName() !== $this->getDevThemePath() && $this->getDevThemePath() === get_stylesheet_directory()); 154 } 155 152 156 public function devtheme_titles( $title ) { 153 157 return "** DEV ** $title"; … … 188 192 <table class="form-table"> 189 193 <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> 194 198 </tbody> 195 199 </table> … … 264 268 <table class="form-table"> 265 269 <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> 276 280 </tbody> 277 281 </table> … … 292 296 293 297 $dev_theme = new Dev_Theme(); 298 299 function 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.