Changeset 1950458
- Timestamp:
- 10/02/2018 07:54:28 PM (7 years ago)
- Location:
- child-themes-helper
- Files:
-
- 52 added
- 3 deleted
- 5 edited
-
tags/1.1 (deleted)
-
tags/1.1.1 (deleted)
-
tags/1.1.2 (deleted)
-
tags/1.1.3 (added)
-
tags/1.1.3/LICENSE (added)
-
tags/1.1.3/README.md (added)
-
tags/1.1.3/assets (added)
-
tags/1.1.3/assets/fonts (added)
-
tags/1.1.3/assets/fonts/Anton-Regular.ttf (added)
-
tags/1.1.3/assets/fonts/BadScript-Regular.ttf (added)
-
tags/1.1.3/assets/fonts/BalooTammudu-Regular.ttf (added)
-
tags/1.1.3/assets/fonts/ConcertOne-Regular.ttf (added)
-
tags/1.1.3/assets/fonts/Courgette-Regular.ttf (added)
-
tags/1.1.3/assets/fonts/DancingScript-Bold.ttf (added)
-
tags/1.1.3/assets/fonts/GloriaHallelujah.ttf (added)
-
tags/1.1.3/assets/fonts/GreatVibes-Regular.ttf (added)
-
tags/1.1.3/assets/fonts/KaushanScript-Regular.ttf (added)
-
tags/1.1.3/assets/fonts/Lobster-Regular.ttf (added)
-
tags/1.1.3/assets/fonts/Monoton-Regular.ttf (added)
-
tags/1.1.3/assets/fonts/OpenSansCondensed-Bold.ttf (added)
-
tags/1.1.3/assets/fonts/OpenSansCondensed-Light.ttf (added)
-
tags/1.1.3/assets/fonts/OpenSansCondensed-LightItalic.ttf (added)
-
tags/1.1.3/assets/fonts/Orbitron-Black.ttf (added)
-
tags/1.1.3/assets/fonts/Orbitron-Bold.ttf (added)
-
tags/1.1.3/assets/fonts/Oswald-Bold.ttf (added)
-
tags/1.1.3/assets/fonts/Pacifico-Regular.ttf (added)
-
tags/1.1.3/assets/fonts/PermanentMarker-Regular.ttf (added)
-
tags/1.1.3/assets/fonts/Rancho-Regular.ttf (added)
-
tags/1.1.3/assets/fonts/Roboto-Black.ttf (added)
-
tags/1.1.3/assets/fonts/Roboto-Italic.ttf (added)
-
tags/1.1.3/assets/fonts/Roboto-Medium.ttf (added)
-
tags/1.1.3/assets/fonts/Roboto-MediumItalic.ttf (added)
-
tags/1.1.3/assets/fonts/Roboto-Regular.ttf (added)
-
tags/1.1.3/assets/fonts/Sacramento-Regular.ttf (added)
-
tags/1.1.3/assets/fonts/samples (added)
-
tags/1.1.3/classes (added)
-
tags/1.1.3/classes/class_activeThemeInfo.php (added)
-
tags/1.1.3/classes/class_ajax_functions.php (added)
-
tags/1.1.3/classes/class_childThemesHelper.php (added)
-
tags/1.1.3/classes/class_colorPicker.php (added)
-
tags/1.1.3/classes/class_common_functions.php (added)
-
tags/1.1.3/classes/class_createScreenShot.php (added)
-
tags/1.1.3/classes/class_fontMeta.php (added)
-
tags/1.1.3/css (added)
-
tags/1.1.3/css/color_picker_grid.css (added)
-
tags/1.1.3/css/style.css (added)
-
tags/1.1.3/js (added)
-
tags/1.1.3/js/color_picker.js (added)
-
tags/1.1.3/js/js_common_fn.js (added)
-
tags/1.1.3/js/pasChildThemes.js (added)
-
tags/1.1.3/lib (added)
-
tags/1.1.3/lib/common_functions.php (added)
-
tags/1.1.3/lib/plugin_constants.php (added)
-
tags/1.1.3/pasChildThemes.php (added)
-
tags/1.1.3/readme.txt (added)
-
trunk/classes/class_ajax_functions.php (modified) (5 diffs)
-
trunk/classes/class_childThemesHelper.php (modified) (1 diff)
-
trunk/classes/class_common_functions.php (modified) (1 diff)
-
trunk/pasChildThemes.php (modified) (1 diff)
-
trunk/readme.txt (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
child-themes-helper/trunk/classes/class_ajax_functions.php
r1947069 r1950458 7 7 if ( ! class_exists( 'pas_cth_AJAXFunctions' ) ) { 8 8 class pas_cth_AJAXFunctions { 9 public $activeThemeInfo; 9 10 private $pluginDirectory; 10 11 private $pluginName; 11 12 private $pluginFolder; 12 public $activeThemeInfo;13 13 private $colorPicker; 14 14 private $libraryFunctions; … … 403 403 'themeURI' => sanitize_text_field( $_POST['themeURI'] ) 404 404 ]; 405 406 405 if ( 0 === strlen( trim( $inputs['childThemeName'] ) ) ) { 407 406 $this->libraryFunctions->displayError( "Notice", … … 459 458 $styleFile = fopen( $childThemePath . PAS_CTH_SEPARATOR . "style.css", "w" ); 460 459 $newlineChar = "\n"; 461 /* 462 $inputs = [ 463 'themeURI' => sanitize_text_field( $_POST['themeURI'] ), 464 'description' => sanitize_textarea_field( $_POST['description'] ), 465 'authorName' => sanitize_text_field( $_POST['authorName'] ), 466 'authorURI' => sanitize_text_field( $_POST['authorURI'] ), 467 'templateTheme' => sanitize_text_field( $_POST['templateTheme'] ), 468 'version' => sanitize_text_field( $_POST['version'] ) 469 ]; 470 */ 460 471 461 fwrite( $styleFile, "/*" . $newlineChar ); 472 462 fwrite( $styleFile, " Theme Name: " . $childThemeName . $newlineChar ); … … 482 472 // Create the functions.php file for the child theme. Use the wp_enqueue_style( ) function 483 473 // to correctly set up the stylesheets for the child theme. 474 475 $stylesheetURL = dirname(get_stylesheet_uri()); 476 $stylesheetURL = $this->libraryFunctions->setDelimiters($stylesheetURL); 477 $stylesheetURL = $this->libraryFunctions->dirUp($stylesheetURL, 1); 478 $stylesheetURL .= PAS_CTH_SEPARATOR . $childThemeStylesheet . PAS_CTH_SEPARATOR . "style.css"; 479 484 480 $functionsFile = fopen( $childThemePath . PAS_CTH_SEPARATOR . "functions.php", "w" ); 485 481 fwrite( $functionsFile, "<" . "?" . "PHP" . $newlineChar ); … … 492 488 " get_template_directory_uri( ) . " . 493 489 " '/style.css' );" . $newlineChar ); 494 fwrite( $functionsFile, "\twp_enqueue_style( '" . $childThemeStylesheet . "-style', " . 495 "dirname( __FILE__ ) . '/style.css' );" . $newlineChar ); 490 fwrite( $functionsFile, "\twp_enqueue_style( '" . 491 $childThemeStylesheet . "-style', " . 492 "'$stylesheetURL' );" . $newlineChar ); 496 493 fwrite( $functionsFile, "}" . $newlineChar ); 497 494 fwrite( $functionsFile, "?>" ); -
child-themes-helper/trunk/classes/class_childThemesHelper.php
r1947069 r1950458 406 406 echo "<br><br>"; // replace with CSS in future release; 407 407 echo "<form>"; 408 echo "<input type='hidden' name='themeRoot' value='" . $this->activeThemeInfo->childThemeRoot . "'>"; 408 409 echo "<input type='hidden' name='action' value='createChildTheme'>"; 409 410 echo "<input type='hidden' name='href' value='" . admin_url( "themes.php" ) . "'>"; -
child-themes-helper/trunk/classes/class_common_functions.php
r1947599 r1950458 347 347 } 348 348 349 public function setDelimiters($path, $delimiter = PAS_CTH_SEPARATOR) { 350 $path = str_replace( "\\", "|+|", $path ); 351 $path = str_replace( "/", "|+|", $path ); 352 $path = str_replace( "|+|", $delimiter, $path ); 353 return $path; 354 } 355 public function dirUp($path, $levels = 1) { 356 $delimiter = PAS_CTH_SEPARATOR; 357 $folders = explode($delimiter, $path); 358 for ($ndx = 0; $ndx < $levels; $ndx++) { 359 unset($folders[count($folders) - 1] ); 360 } 361 return implode($delimiter, $folders); 362 } 363 349 364 } 350 365 } -
child-themes-helper/trunk/pasChildThemes.php
r1948824 r1950458 4 4 Plugin URI: http://www.paulswarthout.com/Child-Themes-Helper/ 5 5 Description: ( 1 ) Copies files from the template theme to the child theme, perfectly duplicating the path structure. ( 2 ) Removes file from the child theme, and removes any empty folders that were made empty by the removal of the child theme file. ( 3 ) Creates new child themes from installed template themes. 6 Version: 1.1. 26 Version: 1.1.3 7 7 Author: Paul A. Swarthout 8 8 Author URI: http://www.PaulSwarthout.com -
child-themes-helper/trunk/readme.txt
r1948824 r1950458 6 6 Requires at least: 4.7.0 7 7 Tested up to: 4.9.8 8 Stable tag: 1.1. 28 Stable tag: 1.1.3 9 9 Requires PHP: 5.5.38 10 10 License: GPLv2 or later … … 32 32 1. **Notes** 33 33 - *Screenshot* 34 The temporary graphic is referred to as the ScreenShot because the filename is "screenshot.png" and is located in the root folder of your theme. The name, nor the location is determined by the WordPress core.34 The temporary graphic is referred to as the ScreenShot because the filename is "screenshot.png" and is located in the root folder of your theme. The filename and the location are defined by the WordPress core and cannot be changed by this (or any) plugin. 35 35 36 Your browser will attempt to cache the screenshot. If you modify the ScreenShot graphic and you do not see any changes when you generate a new one,you will need to clear your browser's image and file cache.36 Your browser will cache the screenshot file whenever possible. If you modify the ScreenShot graphic and you do not see any changes when you generate a new one, then you will need to clear your browser's image and file cache. 37 37 38 38 If you generate a screenshot graphic and you only see the background (i.e., no words), just generate the screenshot again. This happens when the selected font does not exist in the assets/fonts folder of the Child Themes Helper plugin. If you are updating from version 1.0, you will see this happen the first time that you generate a screenshot since the original fonts were deleted and replaced by Google Fonts. 39 39 40 Most developers will replace the screenshot file with the theme's header image. This feature is meant to provide a *temporary* graphic. 40 Most developers will replace this generated screenshot file with a graphic of their own. This feature is meant to provide a *temporary* graphic that quickly and easily identifies the child theme name and its parent theme. 41 42 In a future release, there will be a lock feature on the options page to prevent accidental overwrites of the screenshot file. Also, in a future release, there will be the ability to select an existing graphic and crop it as necessary, instead of generating one. 41 43 42 44 - *Child Themes Helper access* … … 47 49 48 50 - *Child Themes Helper plugin code* 49 This plugin can be found on [GitHub](https://github.com/PaulSwarthout/pasChildThemes). 51 The GitHub repository for this plugin can be found [here](https://github.com/PaulSwarthout/pasChildThemes). 52 53 - *Development versions* 54 Versions 1\.1\.3 and 1\.0 are available for download and install. 50 55 51 56 == Installation == … … 60 65 - Reminder: Only 1 theme can be active at a time. This plugin works with a child theme. Even though a child theme and a parent theme go together, only the child theme or the parent theme can be marked as active. 61 66 67 - *If you downloaded the Child Themes Helper plugin, directly, from the [WordPress Plugin Page](https://wordpress.org/plugins/child-themes-helper/)*, then follow these instructions to install. 68 1. If you have already tried this plugin and you are trying a different version through this installation method, I highly recommend that you deactivate the plugin and delete it before following the next steps. There are multiple files that existed in earlier versions that do not exist or are no longer used in later versions. If you don't want to delete it, first, then at least deactivate it. 69 1. Using your favorite FTP client, find the wp-content/plugins folder and create the child-themes-helper sub folder. 70 1. Unzip the downloaded file and copy the contents to the wp-content/plugins/child-themes-helper folder on your web server. Overwrite anything that previously existed. 71 1. Activate the Child Themes Helper plugin. 72 1. You're ready to go. You should see the menu option "Child Themes Helper" on your dashboard menu just below the Appearance menu item. 73 62 74 == Frequently Asked Questions == 75 76 = Why do the prompts sometimes disappear without making any changes? = 77 78 You have to click precisely on the button. If you click anywhere else in the prompt, besides the buttons (near, but not on the button, for example), the prompt will disappear without doing anything. 79 This was supposed to be a feature to prevent "stuck" prompts that couldn't be removed should an error occur. 80 However, all such errors were fixed prior to releasing this plugin as version 1.0. 81 This problem will be remedied in a future release and only the "dismiss" button in the lower right corner will cause the prompt to just vanish. 63 82 64 83 = I generated a screenshot but it didn't change. Why not? = … … 82 101 83 102 == Changelog == 103 = 1.1.3 = 104 When creating a child theme, the path to the child theme stylesheet was wrong in functions.php. I used dirname( __FILE__ ) . "/style.css", but this created a server rooted path not a URL path to the child theme's stylesheet. This is now fixed. 105 106 Updates to the readme.txt file. 107 108 = 1.1.2 = 109 Discovered a non-unique "global" variable. Variables outside classes are global by their very nature. They must be unique across all of WordPress and any plugins or themes written or not yet written. This plugin prefixes all objects with global scope with the prefix "pas_cth_". The $pluginDirectory variable in pasChildThemes.php needed to be renamed to $pas_cth_pluginDirectory. 110 84 111 = 1.1.1 = 85 **oops:** Version 1\.1 was missing some files. Caused it to crash. Files that were new to 1.1 didn't get added to the WordPress plugin repository. 112 Version 1\.1 was missing some files. This caused the plugin to crash when activated. 113 Files that were new to version 1.1 didn't get added to the WordPress plugin repository. 86 114 87 115 = 1.1 = … … 106 134 == Upgrade Notice == 107 135 108 No additional versions available yet. 136 = 1.1.3 = 137 - Fixed a bug: The path to the child theme's stylesheet in the functions.php was incorrect. 138 - If you only use the Child Themes Helper for its primary purpose of copying files from the parent theme to a child theme, then this change will not effect you and there is no reason to update at this time. 139 - However, if you plan on creating a new child theme with this plugin, then you should update this plugin first.
Note: See TracChangeset
for help on using the changeset viewer.