Changeset 893680
- Timestamp:
- 04/15/2014 03:26:00 PM (12 years ago)
- Location:
- child-themify
- Files:
-
- 12 added
- 2 deleted
- 6 edited
-
tags/1.0.3 (added)
-
tags/1.0.3/assets (added)
-
tags/1.0.3/assets/js (added)
-
tags/1.0.3/assets/js/legacy.js (added)
-
tags/1.0.3/assets/js/legacy.min.js (added)
-
tags/1.0.3/child-themify.php (added)
-
tags/1.0.3/includes (added)
-
tags/1.0.3/includes/legacy.php (added)
-
tags/1.0.3/includes/plugin.php (added)
-
tags/1.0.3/languages (added)
-
tags/1.0.3/languages/child-themify.pot (added)
-
tags/1.0.3/readme.txt (added)
-
trunk/assets/js/child-themify.js (deleted)
-
trunk/assets/js/child-themify.min.js (deleted)
-
trunk/assets/js/legacy.js (modified) (1 diff)
-
trunk/assets/js/legacy.min.js (modified) (1 diff)
-
trunk/child-themify.php (modified) (2 diffs)
-
trunk/includes/plugin.php (modified) (4 diffs)
-
trunk/languages/child-themify.pot (modified) (2 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
child-themify/trunk/assets/js/legacy.js
r840162 r893680 1 /*! Child Themify - v1.0. 21 /*! Child Themify - v1.0.3 2 2 * Copyright (c) 2014 John P. Bloch */ 3 3 (function (window, l10n) { -
child-themify/trunk/assets/js/legacy.min.js
r840162 r893680 1 /*! Child Themify - v1.0. 21 /*! Child Themify - v1.0.3 2 2 * Copyright (c) 2014 John P. Bloch */ 3 3 !function(a,b){if(!("string"!=typeof b.link||b.link.length<1)){var c,d,e,f,g=a.document,h=g.getElementById("customize-current-theme-link");if(h){h=h.parentNode;for(c in h.childNodes)if(h.childNodes.hasOwnProperty(c)&&void 0!==h.childNodes[c].nodeName&&"UL"===h.childNodes[c].nodeName.toUpperCase()){d=h.childNodes[c];break}d&&(f=g.createElement("a"),f.appendChild(g.createTextNode(b.createAChildTheme)),f.href=b.link,e=g.createElement("li"),e.appendChild(f),d.appendChild(e))}}}(window,window.childThemify); -
child-themify/trunk/child-themify.php
r840162 r893680 3 3 * Plugin Name: Child Themify 4 4 * Description: Create child themes at the click of a button. 5 * Version: 1.0. 25 * Version: 1.0.3 6 6 * Plugin URI: https://github.com/johnpbloch/child-themify 7 7 * Author: John P. Bloch … … 11 11 define( 'CTF_PATH', WP_PLUGIN_DIR . '/' . basename( dirname( __FILE__ ) ) . '/' . basename( __FILE__ ) ); 12 12 define( 'CTF_URL', WP_PLUGIN_URL . '/' . basename( dirname( __FILE__ ) ) . '/' . basename( __FILE__ ) ); 13 define( 'CTF_VERSION', '1.0. 2' );13 define( 'CTF_VERSION', '1.0.3' ); 14 14 15 15 -
child-themify/trunk/includes/plugin.php
r837756 r893680 31 31 32 32 /** 33 * @param WP_Theme $theme 34 * 33 35 * @return string 34 36 */ 35 public function nonce() { 36 return wp_create_nonce( $this->nonceName() ); 37 } 38 39 /** 37 public function nonce( WP_Theme $theme = null ) { 38 return wp_create_nonce( $this->nonceName( $theme ) ); 39 } 40 41 /** 42 * @param WP_Theme $theme 43 * 40 44 * @return string 41 45 */ 42 public function nonceName() { 43 return "child_themify"; 46 public function nonceName( WP_Theme $theme = null ) { 47 $nonce_name = 'child_themify'; 48 if ( $theme ) { 49 $nonce_name .= '_' . $theme->get_stylesheet(); 50 } 51 return $nonce_name; 44 52 } 45 53 … … 188 196 189 197 public function loadThemesPage() { 190 if ( ! $this->isChildThemifyPage() ) { 191 if ( ! is_multisite() ) { 192 add_action( 'admin_footer', array( $this, 'linkThemes' ) ); 193 } 194 return; 195 } 196 $this->loadFile( ABSPATH . 'wp-admin/admin-header.php' ); 197 $this->showInterface(); 198 $this->loadFile( ABSPATH . 'wp-admin/admin-footer.php' ); 199 exit; 198 if ( $this->isChildThemifyPage() ) { 199 $this->loadFile( ABSPATH . 'wp-admin/admin-header.php' ); 200 $this->showInterface(); 201 $this->loadFile( ABSPATH . 'wp-admin/admin-footer.php' ); 202 exit; 203 } 200 204 } 201 205 … … 206 210 public function isChildThemifyPage() { 207 211 return ( ! empty( $_GET['action'] ) && $_GET['action'] === 'child-themify' ); 208 }209 210 public function linkThemes() {211 if ( ! $this->checkCapability() ) {212 return;213 }214 $js = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? 'js' : 'min.js';215 $filename = "assets/js/child-themify.$js";216 wp_enqueue_script( 'child-themify', plugins_url( $filename, CTF_PATH ), array( 'theme' ), CTF_VERSION, true );217 wp_localize_script( 'child-themify', 'childThemify', array(218 'createAChildTheme' => __( 'Create a child theme', 'child-themify' ),219 'nonce' => $this->nonce(),220 ) );221 212 } 222 213 … … 225 216 add_filter( 'theme_action_links', array( $this, 'addActionLink' ), 10, 2 ); 226 217 add_action( 'load-themes.php', array( $this, 'loadThemesPage' ) ); 218 if ( version_compare( $GLOBALS['wp_version'], '3.9.9', '<' ) ) { 219 add_action( 'admin_footer-themes.php', array( $this, 'override_tmpl_theme_single' ) ); 220 } 221 add_action( 'tmpl-theme-single_actions', array( $this, 'tmpl_theme_single_actions' ) ); 222 add_filter( 'wp_prepare_themes_for_js', array( $this, 'prepare_themes' ) ); 223 } 224 225 public function override_tmpl_theme_single() { 226 ?> 227 <script> 228 var tts = document.getElementById('tmpl-theme-single'); 229 if (tts.parentNode) { 230 tts.parentNode.removeChild(tts); 231 } 232 </script> 233 <script id="tmpl-theme-single" type="text/template"> 234 <div class="theme-backdrop"></div> 235 <div class="theme-wrap"> 236 <div class="theme-header"> 237 <button class="left dashicons dashicons-no"><span class="screen-reader-text"><?php _e( 'Show previous theme' ); ?></span></button> 238 <button class="right dashicons dashicons-no"><span class="screen-reader-text"><?php _e( 'Show next theme' ); ?></span></button> 239 <button class="close dashicons dashicons-no"><span class="screen-reader-text"><?php _e( 'Close overlay' ); ?></span></button> 240 </div> 241 <div class="theme-about"> 242 <div class="theme-screenshots"> 243 <# if ( data.screenshot[0] ) { #> 244 <div class="screenshot"> 245 <img src="{{ data.screenshot[0] }}" alt="" /> 246 </div> 247 <# } else { #> 248 <div class="screenshot blank"></div> 249 <# } #> 250 </div> 251 252 <div class="theme-info"> 253 <# if ( data.active ) { #> 254 <span class="current-label"><?php _e( 'Current Theme' ); ?></span> 255 <# } #> 256 <h3 class="theme-name">{{{ data.name }}}<span class="theme-version"><?php printf( __( 'Version: %s' ), '{{{ data.version }}}' ); ?></span></h3> 257 <h4 class="theme-author"><?php printf( __( 'By %s' ), '{{{ data.authorAndUri }}}' ); ?></h4> 258 259 <# if ( data.hasUpdate ) { #> 260 <div class="theme-update-message"> 261 <h4 class="theme-update"><?php _e( 'Update Available' ); ?></h4> 262 {{{ data.update }}} 263 </div> 264 <# } #> 265 <p class="theme-description">{{{ data.description }}}</p> 266 267 <# if ( data.parent ) { #> 268 <p class="parent-theme"><?php printf( __( 'This is a child theme of %s.' ), '<strong>{{{ data.parent }}}</strong>' ); ?></p> 269 <# } #> 270 271 <# if ( data.tags ) { #> 272 <p class="theme-tags"><span><?php _e( 'Tags:' ); ?></span> {{{ data.tags }}}</p> 273 <# } #> 274 </div> 275 </div> 276 277 <div class="theme-actions"> 278 <div class="active-theme"> 279 <a href="{{{ data.actions.customize }}}" class="button button-primary customize load-customize hide-if-no-customize"><?php _e( 'Customize' ); ?></a> 280 <?php echo implode( ' ', $GLOBALS['current_theme_actions'] ); ?> 281 <?php do_action( 'tmpl-theme-single_actions', 'active' ); ?> 282 </div> 283 <div class="inactive-theme"> 284 <# if ( data.actions.activate ) { #> 285 <a href="{{{ data.actions.activate }}}" class="button button-primary activate"><?php _e( 'Activate' ); ?></a> 286 <# } #> 287 <a href="{{{ data.actions.customize }}}" class="button button-secondary load-customize hide-if-no-customize"><?php _e( 'Live Preview' ); ?></a> 288 <a href="{{{ data.actions.preview }}}" class="button button-secondary hide-if-customize"><?php _e( 'Preview' ); ?></a> 289 <?php do_action( 'tmpl-theme-single_actions', 'inactive' ); ?> 290 </div> 291 292 <# if ( ! data.active && data.actions['delete'] ) { #> 293 <a href="{{{ data.actions['delete'] }}}" class="button button-secondary delete-theme"><?php _e( 'Delete' ); ?></a> 294 <# } #> 295 </div> 296 </div> 297 </script> 298 <?php 299 // End single theme template shim 300 } 301 302 public function tmpl_theme_single_actions() { 303 ?> 304 <# if ( data.actions.childThemify ) { #> 305 <a href="{{{ data.actions.childThemify }}}" class="button button-secondary" title="<?php esc_attr_e( 'Create a child theme', 'child-themify' ); ?>"><?php esc_attr_e( 'Create a child theme', 'child-themify' ); ?></a> 306 <# } #> 307 <?php 308 // End single action for CTF 309 } 310 311 public function prepare_themes( $themes ) { 312 if ( $this->checkCapability() ) { 313 foreach ( $themes as $slug => $data ) { 314 $theme = wp_get_theme( $slug ); 315 $download_link = $this->getLink( $theme ); 316 317 $themes[$slug]['actions']['childThemify'] = $download_link ? $download_link : false; 318 } 319 } 320 return $themes; 227 321 } 228 322 -
child-themify/trunk/languages/child-themify.pot
r840162 r893680 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Child Themify 1.0. 2\n"5 "Project-Id-Version: Child Themify 1.0.3\n" 6 6 "Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/child-themify\n" 7 "POT-Creation-Date: 2014-0 1-17 07:45:26+00:00\n"7 "POT-Creation-Date: 2014-04-15 15:23:02+00:00\n" 8 8 "MIME-Version: 1.0\n" 9 9 "Content-Type: text/plain; charset=UTF-8\n" … … 17 17 msgstr "" 18 18 19 #: includes/legacy.php:39 includes/plugin.php: 6219 #: includes/legacy.php:39 includes/plugin.php:70 20 20 msgctxt "The placeholder is for a theme's name" 21 21 msgid "Create a child theme from %s" 22 22 msgstr "" 23 23 24 #: includes/legacy.php:42 includes/plugin.php: 6524 #: includes/legacy.php:42 includes/plugin.php:73 25 25 msgid "Name your child theme" 26 26 msgstr "" 27 27 28 #: includes/legacy.php:44 includes/plugin.php: 6728 #: includes/legacy.php:44 includes/plugin.php:75 29 29 msgid "Let's go!" 30 30 msgstr "" 31 31 32 #: includes/legacy.php:106 includes/legacy.php:169 includes/plugin.php:1 4533 #: includes/plugin.php: 21832 #: includes/legacy.php:106 includes/legacy.php:169 includes/plugin.php:153 33 #: includes/plugin.php:305 34 34 msgid "Create a child theme" 35 35 msgstr "" 36 36 37 #: includes/legacy.php:125 includes/plugin.php:1 6537 #: includes/legacy.php:125 includes/plugin.php:173 38 38 msgid "Could not access the filesystem!" 39 39 msgstr "" 40 40 41 #: includes/legacy.php:146 includes/plugin.php:1 8641 #: includes/legacy.php:146 includes/plugin.php:194 42 42 msgid "Your child theme was created successfully." 43 msgstr "" 44 45 #: includes/plugin.php:237 46 msgid "Show previous theme" 47 msgstr "" 48 49 #: includes/plugin.php:238 50 msgid "Show next theme" 51 msgstr "" 52 53 #: includes/plugin.php:239 54 msgid "Close overlay" 55 msgstr "" 56 57 #: includes/plugin.php:254 58 msgid "Current Theme" 59 msgstr "" 60 61 #: includes/plugin.php:256 62 msgid "Version: %s" 63 msgstr "" 64 65 #: includes/plugin.php:257 66 msgid "By %s" 67 msgstr "" 68 69 #: includes/plugin.php:261 70 msgid "Update Available" 71 msgstr "" 72 73 #: includes/plugin.php:268 74 msgid "This is a child theme of %s." 75 msgstr "" 76 77 #: includes/plugin.php:272 78 msgid "Tags:" 79 msgstr "" 80 81 #: includes/plugin.php:279 82 msgid "Customize" 83 msgstr "" 84 85 #: includes/plugin.php:285 86 msgid "Activate" 87 msgstr "" 88 89 #: includes/plugin.php:287 90 msgid "Live Preview" 91 msgstr "" 92 93 #: includes/plugin.php:288 94 msgid "Preview" 95 msgstr "" 96 97 #: includes/plugin.php:293 98 msgid "Delete" 43 99 msgstr "" 44 100 -
child-themify/trunk/readme.txt
r840394 r893680 3 3 Tags: themes, child, theme 4 4 Requires at least: 3.4.2 5 Tested up to: 3. 86 Stable tag: 1.0. 25 Tested up to: 3.9 6 Stable tag: 1.0.3 7 7 License: GPL-2.0+ 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 33 33 == Changelog == 34 34 35 = 1.0.3 = 36 * Released: 2014-04-15 37 * Standardized theme action links shim. See https://github.com/johnpbloch/child-themify/issues/2 for more information 38 * Maintenance, code cleanup, bug fixes 39 35 40 = 1.0.2 = 36 41 * Released: 2014-01-13 … … 47 52 == Upgrade Notice == 48 53 49 This version fixes the plugin in WordPress 3.854 This version cleans up 3.8+ compatibility and ensures 3.9 compatibility 50 55
Note: See TracChangeset
for help on using the changeset viewer.