Version Description
- Added: Create a blank functions.php file option
- Added a link to edit theme after the child theme is created.
- Changed the UI. Parent and Child Themes are nicely separated.
- Added a sidebar in the screen where child themes are created
- Fixed some wrong call to action (left from another plugin).
Download this release
Release Info
Developer | lordspace |
Plugin | Child Theme Creator by Orbisius |
Version | 1.2.2 |
Comparing to | |
See all releases |
Code changes from version 1.2.1 to 1.2.2
- assets/main.css +1 -1
- assets/main.min.css +1 -1
- nbproject/private/private.xml +7 -4
- orbisius-child-theme-creator.php +354 -120
- readme.txt +10 -3
assets/main.css
CHANGED
@@ -93,7 +93,7 @@
|
|
93 |
margin:5px;
|
94 |
border: 2px solid white; /* we need this because there is a shift otherwise on hover. */
|
95 |
display:inline-block; /* so 3 themes fit on one row */
|
96 |
-
width:
|
97 |
}
|
98 |
|
99 |
.orbisius_child_theme_creator_container .available-theme img.screenshot {
|
93 |
margin:5px;
|
94 |
border: 2px solid white; /* we need this because there is a shift otherwise on hover. */
|
95 |
display:inline-block; /* so 3 themes fit on one row */
|
96 |
+
width: 28%;
|
97 |
}
|
98 |
|
99 |
.orbisius_child_theme_creator_container .available-theme img.screenshot {
|
assets/main.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.orbisius_child_theme_creator_container .app-hide{display:none}.orbisius_child_theme_creator_container .app-hide-force{display:none!important}.orbisius_child_theme_creator_container .app-form-field-error{border-color:red}.orbisius_child_theme_creator_container .app-serious-notice{color:red;font-weight:700}.orbisius_child_theme_creator_container .app-alert-error{background:#D54E21;border:1px solid #eee;color:#fff;padding:3px;text-align:center}.orbisius_child_theme_creator_container .app-alert-success{background:green;border:1px solid #eee;color:#fff;padding:3px;text-align:center}.orbisius_child_theme_creator_container .app-alert-success a,.orbisius_child_theme_creator_container .app-alert-error a{color:#fff}.orbisius_child_theme_creator_container .app-alert-notice{background:#FFEC8B;border:1px solid #eee;padding:3px;text-align:center}.orbisius_child_theme_creator_container .app-button-positive{background:green;color:#fff;padding:3px;text-decoration:none}.orbisius_child_theme_creator_container .app-button-negative{background:red;color:#fff;padding:3px;text-decoration:none}.orbisius_child_theme_creator_container .highlight{background:#FF3}.orbisius_child_theme_creator_container .app-dialog-button-ok{background:green!important;color:#fff!important}.orbisius_child_theme_creator_container .app-dialog-button-cancel{background:red!important;color:#fff!important}.orbisius_child_theme_creator_container .app-button-left,.app-align-left{float:left}.orbisius_child_theme_creator_container .app-button-right,.orbisius_child_theme_creator_container .app-align-right{float:right}.orbisius_child_theme_creator_container .app-button-container{padding:10px;background:#ccc;margin-top:15px;margin-bottom:15px}.orbisius_child_theme_creator_container .available-theme{padding:10px;margin:5px;border:2px solid #fff;display:inline-block;width:
|
1 |
+
.orbisius_child_theme_creator_container .app-hide{display:none}.orbisius_child_theme_creator_container .app-hide-force{display:none!important}.orbisius_child_theme_creator_container .app-form-field-error{border-color:red}.orbisius_child_theme_creator_container .app-serious-notice{color:red;font-weight:700}.orbisius_child_theme_creator_container .app-alert-error{background:#D54E21;border:1px solid #eee;color:#fff;padding:3px;text-align:center}.orbisius_child_theme_creator_container .app-alert-success{background:green;border:1px solid #eee;color:#fff;padding:3px;text-align:center}.orbisius_child_theme_creator_container .app-alert-success a,.orbisius_child_theme_creator_container .app-alert-error a{color:#fff}.orbisius_child_theme_creator_container .app-alert-notice{background:#FFEC8B;border:1px solid #eee;padding:3px;text-align:center}.orbisius_child_theme_creator_container .app-button-positive{background:green;color:#fff;padding:3px;text-decoration:none}.orbisius_child_theme_creator_container .app-button-negative{background:red;color:#fff;padding:3px;text-decoration:none}.orbisius_child_theme_creator_container .highlight{background:#FF3}.orbisius_child_theme_creator_container .app-dialog-button-ok{background:green!important;color:#fff!important}.orbisius_child_theme_creator_container .app-dialog-button-cancel{background:red!important;color:#fff!important}.orbisius_child_theme_creator_container .app-button-left,.app-align-left{float:left}.orbisius_child_theme_creator_container .app-button-right,.orbisius_child_theme_creator_container .app-align-right{float:right}.orbisius_child_theme_creator_container .app-button-container{padding:10px;background:#ccc;margin-top:15px;margin-bottom:15px}.orbisius_child_theme_creator_container .available-theme{padding:10px;margin:5px;border:2px solid #fff;display:inline-block;width:28%}.orbisius_child_theme_creator_container .available-theme img.screenshot{max-height:75%;max-width:75%}.orbisius_child_theme_creator_container .available-theme:hover{border:2px solid #444;background:#ccc}.orbisius_child_theme_creator_container .saving_action{background:#ccc}.orbisius_ctc_theme_editor_container .highlight{background:#FF3}.orbisius_ctc_theme_editor_container .app-dialog-button-ok{background:green!important;color:#fff!important}.orbisius_ctc_theme_editor_container .app-dialog-button-cancel{background:red!important;color:#fff!important}.orbisius_ctc_theme_editor_container #theme_1,.orbisius_ctc_theme_editor_container #theme_2,.orbisius_ctc_theme_editor_container #theme_1_file,.orbisius_ctc_theme_editor_container #theme_2_file{max-width:40%}.orbisius_ctc_theme_editor_container .primary_buttons{margin-top:5px}
|
nbproject/private/private.xml
CHANGED
@@ -13,22 +13,25 @@
|
|
13 |
<url>orbisius-child-theme-creator.php</url>
|
14 |
<bookmark id="5">
|
15 |
<name/>
|
16 |
-
<line>
|
17 |
<key/>
|
18 |
</bookmark>
|
19 |
<bookmark id="4">
|
20 |
<name/>
|
21 |
-
<line>
|
22 |
<key/>
|
23 |
</bookmark>
|
24 |
<bookmark id="3">
|
25 |
<name/>
|
26 |
-
<line>
|
27 |
<key/>
|
28 |
</bookmark>
|
29 |
</file>
|
30 |
</editor-bookmarks>
|
31 |
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
|
32 |
-
<group
|
|
|
|
|
|
|
33 |
</open-files>
|
34 |
</project-private>
|
13 |
<url>orbisius-child-theme-creator.php</url>
|
14 |
<bookmark id="5">
|
15 |
<name/>
|
16 |
+
<line>1810</line>
|
17 |
<key/>
|
18 |
</bookmark>
|
19 |
<bookmark id="4">
|
20 |
<name/>
|
21 |
+
<line>1949</line>
|
22 |
<key/>
|
23 |
</bookmark>
|
24 |
<bookmark id="3">
|
25 |
<name/>
|
26 |
+
<line>2195</line>
|
27 |
<key/>
|
28 |
</bookmark>
|
29 |
</file>
|
30 |
</editor-bookmarks>
|
31 |
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
|
32 |
+
<group>
|
33 |
+
<file>file:/C:/projects/default/htdocs/wordpress313/wp-content/plugins/orbisius-child-theme-creator/orbisius-child-theme-creator.php</file>
|
34 |
+
<file>file:/C:/projects/default/htdocs/wordpress313/wp-content/plugins/orbisius-child-theme-creator/readme.txt</file>
|
35 |
+
</group>
|
36 |
</open-files>
|
37 |
</project-private>
|
orbisius-child-theme-creator.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Orbisius Child Theme Creator
|
4 |
Plugin URI: http://club.orbisius.com/products/wordpress-plugins/orbisius-child-theme-creator/
|
5 |
Description: This plugin allows you to quickly create child themes from any theme that you have currently installed on your site/blog.
|
6 |
-
Version: 1.2.
|
7 |
Author: Svetoslav Marinov (Slavi)
|
8 |
Author URI: http://orbisius.com
|
9 |
*/
|
@@ -437,19 +437,7 @@ function orbisius_child_theme_creator_settings_page() {
|
|
437 |
</div> <!-- .inside -->
|
438 |
</div> <!-- .postbox -->
|
439 |
|
440 |
-
|
441 |
-
<?php
|
442 |
-
$naked_domain = !empty($_SERVER['DEV_ENV']) ? 'orbclub.com.clients.com' : 'club.orbisius.com';
|
443 |
-
|
444 |
-
if (!empty($_SERVER['DEV_ENV']) && is_ssl()) {
|
445 |
-
$naked_domain = 'ssl.orbisius.com/club';
|
446 |
-
}
|
447 |
-
|
448 |
-
$params = '?' . http_build_query(array('p' => str_replace('.php', '', basename(__FILE__)), 'layout' => 'plugin', ));
|
449 |
-
echo '<div class="orbisius_ext_content"></div>' . "\n";
|
450 |
-
echo "<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://$naked_domain/wpu/widget/$params';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'orbsius-js');</script>";
|
451 |
-
?>
|
452 |
-
<!-- /Orbisius JS Widget -->
|
453 |
|
454 |
<?php
|
455 |
$plugin_data = get_plugin_data(__FILE__);
|
@@ -482,7 +470,7 @@ function orbisius_child_theme_creator_settings_page() {
|
|
482 |
|
483 |
<!-- Twitter: Tweet:js -->
|
484 |
<a href="https://twitter.com/share" class="twitter-share-button"
|
485 |
-
data-lang="en" data-text="Checkout
|
486 |
data-count="none" data-via="orbisius" data-related="orbisius"
|
487 |
data-url="<?php echo $product_page_tweet_link;?>">Tweet</a>
|
488 |
<!-- /Twitter: Tweet:js -->
|
@@ -522,11 +510,11 @@ function orbisius_child_theme_creator_settings_page() {
|
|
522 |
}
|
523 |
?>
|
524 |
<script>
|
525 |
-
var
|
526 |
validate_form : function () {
|
527 |
try {
|
528 |
-
var msg = jQuery('#
|
529 |
-
var email = jQuery('#
|
530 |
|
531 |
email = email.replace(/\s+/, '');
|
532 |
email = email.replace(/\.+/, '.');
|
@@ -534,20 +522,20 @@ function orbisius_child_theme_creator_settings_page() {
|
|
534 |
|
535 |
if ( msg == '' ) {
|
536 |
alert('Enter your message.');
|
537 |
-
jQuery('#
|
538 |
return false;
|
539 |
} else {
|
540 |
// all is good clear borders
|
541 |
-
jQuery('#
|
542 |
}
|
543 |
|
544 |
if ( email == '' || email.indexOf('@') <= 2 || email.indexOf('.') == -1) {
|
545 |
alert('Enter your email and make sure it is valid.');
|
546 |
-
jQuery('#
|
547 |
return false;
|
548 |
} else {
|
549 |
// all is good clear borders
|
550 |
-
jQuery('#
|
551 |
}
|
552 |
|
553 |
return true;
|
@@ -575,18 +563,18 @@ function orbisius_child_theme_creator_settings_page() {
|
|
575 |
$hid_data = http_build_query($hidden_data);
|
576 |
echo "<input type='hidden' name='data[sys_info]' value='$hid_data' />\n";
|
577 |
?>
|
578 |
-
<textarea class="widefat" id='
|
579 |
<br/>Your Email: <input type="text" class=""
|
580 |
-
id="
|
581 |
value="<?php echo esc_attr($email); ?>"
|
582 |
/>
|
583 |
<br/><input type="submit" class="button-primary" value="<?php _e('Send Feedback') ?>"
|
584 |
-
onclick="return
|
585 |
<br/>
|
586 |
What data will be sent
|
587 |
<a href='javascript:void(0);'
|
588 |
-
onclick='jQuery(".
|
589 |
-
<div class="hide app_hide
|
590 |
<textarea class="widefat" rows="4" readonly="readonly" disabled="disabled"><?php
|
591 |
foreach ($hidden_data as $key => $val) {
|
592 |
if (is_array($val)) {
|
@@ -604,7 +592,7 @@ function orbisius_child_theme_creator_settings_page() {
|
|
604 |
|
605 |
</div> <!-- .meta-box-sortables -->
|
606 |
|
607 |
-
</div> <!-- #postbox-container-1 .postbox-container -->
|
608 |
|
609 |
</div> <!-- #post-body .metabox-holder .columns-2 -->
|
610 |
|
@@ -704,15 +692,17 @@ function orbisius_child_theme_creator_tools_action() {
|
|
704 |
$installer = new orbisius_child_theme_creator($parent_theme_base_dirname);
|
705 |
$installer->custom_info($child_custom_info);
|
706 |
|
707 |
-
// Does the user want to copy the functions.php?
|
708 |
-
if (!empty($_REQUEST['copy_functions_php'])) {
|
709 |
-
$installer->add_files('functions.php');
|
710 |
-
}
|
711 |
-
|
712 |
$installer->check_permissions();
|
713 |
$installer->copy_main_files();
|
714 |
$installer->generate_style();
|
715 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
716 |
$success[] = "The child theme has been successfully created.";
|
717 |
$success[] = $installer->get_details();
|
718 |
|
@@ -783,11 +773,11 @@ function orbisius_child_theme_creator_tools_action() {
|
|
783 |
|
784 |
<?php
|
785 |
$buff = '';
|
786 |
-
$buff .= "<h2>Available Themes</h2>\n";
|
787 |
|
788 |
// call to action.
|
789 |
-
$buff .= "<div class='
|
790 |
-
$buff .= "
|
791 |
$buff .= "</p></div>\n";
|
792 |
|
793 |
$buff .= "<div id='availablethemes' class='theme_container'>\n";
|
@@ -889,6 +879,9 @@ function orbisius_child_theme_creator_tools_action() {
|
|
889 |
. "Switch theme to the new theme after it is created</label></li>\n";
|
890 |
}
|
891 |
|
|
|
|
|
|
|
892 |
// This allows the users to specify title and description of the target child theme
|
893 |
$customize_info_container_id = 'orbisius_ctc_cust_info_' . md5($src);
|
894 |
|
@@ -946,9 +939,13 @@ function orbisius_child_theme_creator_tools_action() {
|
|
946 |
$buff .= "</div> <!-- /available-theme -->\n";
|
947 |
}
|
948 |
|
949 |
-
$buff .= "
|
|
|
950 |
$child_themes_cnt = 0;
|
951 |
-
|
|
|
|
|
|
|
952 |
// list child themes
|
953 |
// we use the same CSS as in WP's appearances but put only the buttons we want.
|
954 |
foreach ($themes as $theme_basedir_name => $theme_obj) {
|
@@ -977,94 +974,263 @@ function orbisius_child_theme_creator_tools_action() {
|
|
977 |
$edit_theme_link = orbisius_child_theme_creator_util::get_theme_editor_link( array('theme_1' => $theme_basedir_name) );
|
978 |
$author_line .= " | <a href='$edit_theme_link' title='Edit with Orbisius Theme Editor'>Edit</a>\n";
|
979 |
|
980 |
-
$
|
981 |
-
$
|
982 |
-
$
|
983 |
-
$
|
984 |
-
$
|
985 |
}
|
986 |
|
987 |
if ( $child_themes_cnt == 0 ) {
|
988 |
-
$
|
989 |
}
|
990 |
|
991 |
-
$
|
992 |
-
|
993 |
-
//var_dump($themes);
|
994 |
-
echo $buff;
|
995 |
?>
|
996 |
|
997 |
-
|
998 |
-
<
|
999 |
-
|
1000 |
-
<p>
|
1001 |
-
The support is handled on our Club Orbisius site: <a href="http://club.orbisius.com/forums/forum/community-support-forum/wordpress-plugins/orbisius-child-theme-creator/" target="_blank" title="[new window]">http://club.orbisius.com/</a>.
|
1002 |
-
Please do NOT use the WordPress forums or other places to seek support.
|
1003 |
-
</p>
|
1004 |
-
</div>
|
1005 |
-
<?php if (1) : ?>
|
1006 |
-
<?php
|
1007 |
-
$plugin_data = orbisius_child_theme_creator_get_plugin_data();
|
1008 |
|
1009 |
-
|
1010 |
-
|
1011 |
-
|
1012 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1013 |
|
1014 |
-
|
1015 |
-
|
1016 |
-
<!--
|
1017 |
-
|
1018 |
-
|
1019 |
-
|
1020 |
-
|
1021 |
-
|
1022 |
-
|
1023 |
-
<a class="addthis_button_myspace" addthis:url="<?php echo $app_link ?>" addthis:title="<?php echo $app_title ?>" addthis:description="<?php echo $app_descr ?>"></a>
|
1024 |
-
<a class="addthis_button_google" addthis:url="<?php echo $app_link ?>" addthis:title="<?php echo $app_title ?>" addthis:description="<?php echo $app_descr ?>"></a>
|
1025 |
-
<a class="addthis_button_digg" addthis:url="<?php echo $app_link ?>" addthis:title="<?php echo $app_title ?>" addthis:description="<?php echo $app_descr ?>"></a>
|
1026 |
-
<a class="addthis_button_delicious" addthis:url="<?php echo $app_link ?>" addthis:title="<?php echo $app_title ?>" addthis:description="<?php echo $app_descr ?>"></a>
|
1027 |
-
<a class="addthis_button_stumbleupon" addthis:url="<?php echo $app_link ?>" addthis:title="<?php echo $app_title ?>" addthis:description="<?php echo $app_descr ?>"></a>
|
1028 |
-
<a class="addthis_button_tumblr" addthis:url="<?php echo $app_link ?>" addthis:title="<?php echo $app_title ?>" addthis:description="<?php echo $app_descr ?>"></a>
|
1029 |
-
<a class="addthis_button_favorites" addthis:url="<?php echo $app_link ?>" addthis:title="<?php echo $app_title ?>" addthis:description="<?php echo $app_descr ?>"></a>
|
1030 |
-
<a class="addthis_button_compact"></a>
|
1031 |
-
</div>
|
1032 |
-
<!-- The JS code is in the footer -->
|
1033 |
-
|
1034 |
-
<script type="text/javascript">
|
1035 |
-
var addthis_config = { "data_track_clickback": true };
|
1036 |
-
var addthis_share = {
|
1037 |
-
templates: {twitter: 'Check out {{title}} #wordpress #plugin at {{lurl}} (via @orbisius)'}
|
1038 |
-
};
|
1039 |
-
</script>
|
1040 |
-
<!-- AddThis Button START part2 -->
|
1041 |
-
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js"></script>
|
1042 |
-
<!-- AddThis Button END part2 -->
|
1043 |
-
</p>
|
1044 |
-
<?php endif ?>
|
1045 |
-
|
1046 |
-
<h2>Want to hear about future plugins? Join our mailing List! (no spam)</h2>
|
1047 |
-
<p>
|
1048 |
-
Get the latest news and updates about this and future cool <a href="http://profiles.wordpress.org/lordspace/"
|
1049 |
-
target="_blank" title="Opens a page with the pugins we developed. [New Window/Tab]">plugins we develop</a>.
|
1050 |
-
</p>
|
1051 |
-
|
1052 |
-
<p>
|
1053 |
-
<!-- // MAILCHIMP SUBSCRIBE CODE \\ -->
|
1054 |
-
1) Subscribe by going to <a href="http://eepurl.com/guNzr" target="_blank">http://eepurl.com/guNzr</a>
|
1055 |
-
<!-- \\ MAILCHIMP SUBSCRIBE CODE // -->
|
1056 |
-
OR
|
1057 |
-
2) by using our QR code. [Scan it with your mobile device].<br/>
|
1058 |
-
<img src="<?php echo plugin_dir_url(__FILE__); ?>/i/guNzr.qr.2.png" alt="" />
|
1059 |
-
</p>
|
1060 |
-
|
1061 |
-
<h2>Demo</h2>
|
1062 |
-
<p>
|
1063 |
-
<iframe width="560" height="315" src="http://www.youtube.com/embed/BZUVq6ZTv-o" frameborder="0" allowfullscreen></iframe>
|
1064 |
-
|
1065 |
-
<br/>Video Link: <a href="http://www.youtube.com/watch?v=BZUVq6ZTv-o&feature=youtu.be" target="_blank">http://www.youtube.com/watch?v=BZUVq6ZTv-o&feature=youtu.be</a>
|
1066 |
-
</p>
|
1067 |
-
</div> <!-- /wrap -->
|
1068 |
<?php
|
1069 |
}
|
1070 |
|
@@ -1252,7 +1418,9 @@ class orbisius_child_theme_creator {
|
|
1252 |
$app_link = $plugin_data['PluginURI'];
|
1253 |
$app_title = $plugin_data['Name'];
|
1254 |
|
1255 |
-
$parent_theme_data = version_compare($wp_version, '3.4', '>=')
|
|
|
|
|
1256 |
|
1257 |
$theme_name = "$parent_theme_data->Name $this->target_name_suffix";
|
1258 |
$theme_uri = $parent_theme_data->ThemeURI;
|
@@ -1320,10 +1488,13 @@ class orbisius_child_theme_creator {
|
|
1320 |
}
|
1321 |
|
1322 |
$themes_url = admin_url('themes.php');
|
|
|
|
|
1323 |
|
1324 |
$this->info_result = "$parent_theme_data->Name " . $this->target_name_suffix . ' has been created in ' . $this->target_dir_path
|
1325 |
. ' based on ' . $parent_theme_data->Name . ' theme.'
|
1326 |
-
. "\n<br/>Next go to <a href='$themes_url'><strong>Appearance > Themes</strong></a> and Activate the new theme
|
|
|
1327 |
}
|
1328 |
|
1329 |
/**
|
@@ -1342,12 +1513,73 @@ class orbisius_child_theme_creator {
|
|
1342 |
error_log($msg . "\n", 3, ini_get('error_log'));
|
1343 |
}
|
1344 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1345 |
}
|
1346 |
|
1347 |
/**
|
1348 |
* Util funcs
|
1349 |
*/
|
1350 |
class orbisius_child_theme_creator_util {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1351 |
/**
|
1352 |
* This cleans filenames but leaves some of the / because some files can be dir1/file.txt.
|
1353 |
* $jail_root must be added because it will also prefix the path with a directory i.e. jail
|
@@ -1809,7 +2041,6 @@ function orbisius_ctc_theme_editor() {
|
|
1809 |
</ul>
|
1810 |
</div>
|
1811 |
|
1812 |
-
|
1813 |
<!-- new folder -->
|
1814 |
<!--
|
1815 |
<div id='theme_1_new_folder_container' class="theme_1_new_folder_container app-hide">
|
@@ -1887,6 +2118,9 @@ function orbisius_ctc_theme_editor() {
|
|
1887 |
</td>
|
1888 |
</tr>
|
1889 |
</table>
|
|
|
|
|
|
|
1890 |
<?php
|
1891 |
}
|
1892 |
|
3 |
Plugin Name: Orbisius Child Theme Creator
|
4 |
Plugin URI: http://club.orbisius.com/products/wordpress-plugins/orbisius-child-theme-creator/
|
5 |
Description: This plugin allows you to quickly create child themes from any theme that you have currently installed on your site/blog.
|
6 |
+
Version: 1.2.2
|
7 |
Author: Svetoslav Marinov (Slavi)
|
8 |
Author URI: http://orbisius.com
|
9 |
*/
|
437 |
</div> <!-- .inside -->
|
438 |
</div> <!-- .postbox -->
|
439 |
|
440 |
+
<?php orbisius_child_theme_creator_util::output_orb_widget(); ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
441 |
|
442 |
<?php
|
443 |
$plugin_data = get_plugin_data(__FILE__);
|
470 |
|
471 |
<!-- Twitter: Tweet:js -->
|
472 |
<a href="https://twitter.com/share" class="twitter-share-button"
|
473 |
+
data-lang="en" data-text="Checkout Orbisius Child Theme Creator #WordPress #plugin.Create Child Themes in Seconds"
|
474 |
data-count="none" data-via="orbisius" data-related="orbisius"
|
475 |
data-url="<?php echo $product_page_tweet_link;?>">Tweet</a>
|
476 |
<!-- /Twitter: Tweet:js -->
|
510 |
}
|
511 |
?>
|
512 |
<script>
|
513 |
+
var octc_quick_contact = {
|
514 |
validate_form : function () {
|
515 |
try {
|
516 |
+
var msg = jQuery('#octc_msg').val().trim();
|
517 |
+
var email = jQuery('#octc_email').val().trim();
|
518 |
|
519 |
email = email.replace(/\s+/, '');
|
520 |
email = email.replace(/\.+/, '.');
|
522 |
|
523 |
if ( msg == '' ) {
|
524 |
alert('Enter your message.');
|
525 |
+
jQuery('#octc_msg').focus().val(msg).css('border', '1px solid red');
|
526 |
return false;
|
527 |
} else {
|
528 |
// all is good clear borders
|
529 |
+
jQuery('#octc_msg').css('border', '');
|
530 |
}
|
531 |
|
532 |
if ( email == '' || email.indexOf('@') <= 2 || email.indexOf('.') == -1) {
|
533 |
alert('Enter your email and make sure it is valid.');
|
534 |
+
jQuery('#octc_email').focus().val(email).css('border', '1px solid red');
|
535 |
return false;
|
536 |
} else {
|
537 |
// all is good clear borders
|
538 |
+
jQuery('#octc_email').css('border', '');
|
539 |
}
|
540 |
|
541 |
return true;
|
563 |
$hid_data = http_build_query($hidden_data);
|
564 |
echo "<input type='hidden' name='data[sys_info]' value='$hid_data' />\n";
|
565 |
?>
|
566 |
+
<textarea class="widefat" id='octc_msg' name='data[msg]' required="required"></textarea>
|
567 |
<br/>Your Email: <input type="text" class=""
|
568 |
+
id="octc_email" name='data[sender_email]' placeholder="Email" required="required"
|
569 |
value="<?php echo esc_attr($email); ?>"
|
570 |
/>
|
571 |
<br/><input type="submit" class="button-primary" value="<?php _e('Send Feedback') ?>"
|
572 |
+
onclick="return octc_quick_contact.validate_form();" />
|
573 |
<br/>
|
574 |
What data will be sent
|
575 |
<a href='javascript:void(0);'
|
576 |
+
onclick='jQuery(".octc_data_to_be_sent").toggle();'>(show/hide)</a>
|
577 |
+
<div class="hide app_hide octc_data_to_be_sent">
|
578 |
<textarea class="widefat" rows="4" readonly="readonly" disabled="disabled"><?php
|
579 |
foreach ($hidden_data as $key => $val) {
|
580 |
if (is_array($val)) {
|
592 |
|
593 |
</div> <!-- .meta-box-sortables -->
|
594 |
|
595 |
+
</div> <!-- #postbox-container-1 .postbox-container sidebar -->
|
596 |
|
597 |
</div> <!-- #post-body .metabox-holder .columns-2 -->
|
598 |
|
692 |
$installer = new orbisius_child_theme_creator($parent_theme_base_dirname);
|
693 |
$installer->custom_info($child_custom_info);
|
694 |
|
|
|
|
|
|
|
|
|
|
|
695 |
$installer->check_permissions();
|
696 |
$installer->copy_main_files();
|
697 |
$installer->generate_style();
|
698 |
|
699 |
+
// Does the user want to copy the functions.php?
|
700 |
+
if (!empty($_REQUEST['create_blank_functions_file'])) {
|
701 |
+
$installer->create_blank('functions.php');
|
702 |
+
} elseif (!empty($_REQUEST['copy_functions_php'])) {
|
703 |
+
$installer->add_files('functions.php');
|
704 |
+
}
|
705 |
+
|
706 |
$success[] = "The child theme has been successfully created.";
|
707 |
$success[] = $installer->get_details();
|
708 |
|
773 |
|
774 |
<?php
|
775 |
$buff = '';
|
776 |
+
$buff .= "<h2>Available Parent Themes</h2>\n";
|
777 |
|
778 |
// call to action.
|
779 |
+
$buff .= "<div class='updated0'><p>\n";
|
780 |
+
$buff .= "Pick a parent theme you want to use from the list below and then click on the <strong>Create Child Theme</strong> button.";
|
781 |
$buff .= "</p></div>\n";
|
782 |
|
783 |
$buff .= "<div id='availablethemes' class='theme_container'>\n";
|
879 |
. "Switch theme to the new theme after it is created</label></li>\n";
|
880 |
}
|
881 |
|
882 |
+
$buff .= "<li><label><input type='checkbox' id='create_blank_functions_file' name='create_blank_functions_file' value='1' /> "
|
883 |
+
. "Create a blank functions.php file</label></li>\n";
|
884 |
+
|
885 |
// This allows the users to specify title and description of the target child theme
|
886 |
$customize_info_container_id = 'orbisius_ctc_cust_info_' . md5($src);
|
887 |
|
939 |
$buff .= "</div> <!-- /available-theme -->\n";
|
940 |
}
|
941 |
|
942 |
+
$buff .= "</div> <!-- /availablethemes -->\n";
|
943 |
+
|
944 |
$child_themes_cnt = 0;
|
945 |
+
$buff_child_themes = '';
|
946 |
+
$buff_child_themes .= "<div class='child_themes'>\n";
|
947 |
+
$buff_child_themes .= "<h2>Child Themes</h2>\n";
|
948 |
+
|
949 |
// list child themes
|
950 |
// we use the same CSS as in WP's appearances but put only the buttons we want.
|
951 |
foreach ($themes as $theme_basedir_name => $theme_obj) {
|
974 |
$edit_theme_link = orbisius_child_theme_creator_util::get_theme_editor_link( array('theme_1' => $theme_basedir_name) );
|
975 |
$author_line .= " | <a href='$edit_theme_link' title='Edit with Orbisius Theme Editor'>Edit</a>\n";
|
976 |
|
977 |
+
$buff_child_themes .= "<div class='available-theme'>\n";
|
978 |
+
$buff_child_themes .= "<img class='screenshot' src='$src' alt='' />\n";
|
979 |
+
$buff_child_themes .= "<h3>$theme_obj->Name</h3>\n";
|
980 |
+
$buff_child_themes .= "<div class='theme-author'>By $author_line</div>\n";
|
981 |
+
$buff_child_themes .= "</div> <!-- /available-theme -->\n";
|
982 |
}
|
983 |
|
984 |
if ( $child_themes_cnt == 0 ) {
|
985 |
+
$buff_child_themes .= "<div>No child themes found.</div>\n";
|
986 |
}
|
987 |
|
988 |
+
$buff_child_themes .= "</div> <!-- /child themes -->\n";
|
989 |
+
|
|
|
|
|
990 |
?>
|
991 |
|
992 |
+
<div class="wrap orbisius_child_theme_creator_container">
|
993 |
+
<div id="icon-options-general" class="icon32"></div>
|
994 |
+
<!--<h2>Name String</h2>-->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
995 |
|
996 |
+
<div id="poststuff">
|
997 |
+
|
998 |
+
<div id="post-body" class="metabox-holder columns-2">
|
999 |
+
|
1000 |
+
<!-- main content -->
|
1001 |
+
<div id="post-body-content">
|
1002 |
+
|
1003 |
+
<div class="meta-box-sortables ui-sortable">
|
1004 |
+
|
1005 |
+
<div class="postbox">
|
1006 |
+
<!--<h3><span>Main Content Header</span></h3>-->
|
1007 |
+
<div class="inside">
|
1008 |
+
<?php echo $buff; ?>
|
1009 |
+
</div> <!-- .inside -->
|
1010 |
+
</div> <!-- .postbox -->
|
1011 |
+
|
1012 |
+
<div class="postbox">
|
1013 |
+
<!--<h3><span>Main Content Header</span></h3>-->
|
1014 |
+
<div class="inside">
|
1015 |
+
<?php echo $buff_child_themes; ?>
|
1016 |
+
</div> <!-- .inside -->
|
1017 |
+
</div> <!-- .postbox -->
|
1018 |
+
|
1019 |
+
</div> <!-- .meta-box-sortables .ui-sortable -->
|
1020 |
+
|
1021 |
+
</div> <!-- post-body-content -->
|
1022 |
+
|
1023 |
+
<!-- sidebar -->
|
1024 |
+
<div id="postbox-container-1" class="postbox-container">
|
1025 |
+
|
1026 |
+
<div class="meta-box-sortables">
|
1027 |
+
|
1028 |
+
<div class="postbox">
|
1029 |
+
<h3><span>Hire Us</span></h3>
|
1030 |
+
<div class="inside">
|
1031 |
+
Hire us to create a plugin/web/mobile app for your business.
|
1032 |
+
<br/><a href="http://orbisius.com/page/free-quote/?utm_source=orbisius-child-theme-creator&utm_medium=plugin-settings&utm_campaign=product"
|
1033 |
+
title="If you want a custom web/mobile app/plugin developed contact us. This opens in a new window/tab"
|
1034 |
+
class="button-primary" target="_blank">Get a Free Quote</a>
|
1035 |
+
</div> <!-- .inside -->
|
1036 |
+
</div> <!-- .postbox -->
|
1037 |
+
|
1038 |
+
<div class="postbox">
|
1039 |
+
<h3><span>Newsletter</span></h3>
|
1040 |
+
<div class="inside">
|
1041 |
+
<!-- Begin MailChimp Signup Form -->
|
1042 |
+
<div id="mc_embed_signup">
|
1043 |
+
<?php
|
1044 |
+
$current_user = wp_get_current_user();
|
1045 |
+
$email = empty($current_user->user_email) ? '' : $current_user->user_email;
|
1046 |
+
?>
|
1047 |
+
|
1048 |
+
<form action="http://WebWeb.us2.list-manage.com/subscribe/post?u=005070a78d0e52a7b567e96df&id=1b83cd2093" method="post"
|
1049 |
+
id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank">
|
1050 |
+
<input type="hidden" value="settings" name="SRC2" />
|
1051 |
+
<input type="hidden" value="orbisius-child-theme-creator" name="SRC" />
|
1052 |
+
|
1053 |
+
<span>Get notified about cool plugins we release</span>
|
1054 |
+
<!--<div class="indicates-required"><span class="app_asterisk">*</span> indicates required
|
1055 |
+
</div>-->
|
1056 |
+
<div class="mc-field-group">
|
1057 |
+
<label for="mce-EMAIL">Email <span class="app_asterisk">*</span></label>
|
1058 |
+
<input type="email" value="<?php echo esc_attr($email); ?>" name="EMAIL" class="required email" id="mce-EMAIL">
|
1059 |
+
</div>
|
1060 |
+
<div id="mce-responses" class="clear">
|
1061 |
+
<div class="response" id="mce-error-response" style="display:none"></div>
|
1062 |
+
<div class="response" id="mce-success-response" style="display:none"></div>
|
1063 |
+
</div> <div class="clear"><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button-primary"></div>
|
1064 |
+
</form>
|
1065 |
+
</div>
|
1066 |
+
<!--End mc_embed_signup-->
|
1067 |
+
</div> <!-- .inside -->
|
1068 |
+
</div> <!-- .postbox -->
|
1069 |
+
|
1070 |
+
<?php orbisius_child_theme_creator_util::output_orb_widget(); ?>
|
1071 |
+
|
1072 |
+
<?php
|
1073 |
+
$plugin_data = get_plugin_data(__FILE__);
|
1074 |
+
$product_name = trim($plugin_data['Name']);
|
1075 |
+
$product_page = trim($plugin_data['PluginURI']);
|
1076 |
+
$product_descr = trim($plugin_data['Description']);
|
1077 |
+
$product_descr_short = substr($product_descr, 0, 50) . '...';
|
1078 |
+
|
1079 |
+
$base_name_slug = basename(__FILE__);
|
1080 |
+
$base_name_slug = str_replace('.php', '', $base_name_slug);
|
1081 |
+
$product_page .= (strpos($product_page, '?') === false) ? '?' : '&';
|
1082 |
+
$product_page .= "utm_source=$base_name_slug&utm_medium=plugin-settings&utm_campaign=product";
|
1083 |
+
|
1084 |
+
$product_page_tweet_link = $product_page;
|
1085 |
+
$product_page_tweet_link = str_replace('plugin-settings', 'tweet', $product_page_tweet_link);
|
1086 |
+
?>
|
1087 |
+
|
1088 |
+
<div class="postbox">
|
1089 |
+
<div class="inside">
|
1090 |
+
<!-- Twitter: code -->
|
1091 |
+
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="http://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
|
1092 |
+
<!-- /Twitter: code -->
|
1093 |
+
|
1094 |
+
<!-- Twitter: Orbisius_Follow:js -->
|
1095 |
+
<a href="https://twitter.com/orbisius" class="twitter-follow-button"
|
1096 |
+
data-align="right" data-show-count="false">Follow @orbisius</a>
|
1097 |
+
<!-- /Twitter: Orbisius_Follow:js -->
|
1098 |
+
|
1099 |
+
|
1100 |
+
|
1101 |
+
<!-- Twitter: Tweet:js -->
|
1102 |
+
<a href="https://twitter.com/share" class="twitter-share-button"
|
1103 |
+
data-lang="en" data-text="Checkout Orbisius Child Theme Creator #WordPress #plugin.Create Child Themes in Seconds"
|
1104 |
+
data-count="none" data-via="orbisius" data-related="orbisius"
|
1105 |
+
data-url="<?php echo $product_page_tweet_link;?>">Tweet</a>
|
1106 |
+
<!-- /Twitter: Tweet:js -->
|
1107 |
+
|
1108 |
+
|
1109 |
+
<br/>
|
1110 |
+
<a href="<?php echo $product_page; ?>" target="_blank" title="[new window]">Product Page</a>
|
1111 |
+
|
|
1112 |
+
<span>Support: <a href="http://club.orbisius.com/forums/forum/community-support-forum/wordpress-plugins/orbisius-child-theme-creator/?utm_source=orbisius-child-theme-creator&utm_medium=plugin-settings&utm_campaign=product"
|
1113 |
+
target="_blank" title="[new window]">Forums</a>
|
1114 |
+
|
1115 |
+
<!--|
|
1116 |
+
<a href="http://docs.google.com/viewer?url=https%3A%2F%2Fdl.dropboxusercontent.com%2Fs%2Fwz83vm9841lz3o9%2FOrbisius_LikeGate_Documentation.pdf" target="_blank">Documentation</a>
|
1117 |
+
-->
|
1118 |
+
</span>
|
1119 |
+
</div>
|
1120 |
+
|
1121 |
+
<h3><span>Troubleshooting</span></h3>
|
1122 |
+
<div class="inside">
|
1123 |
+
If your site becomes broken because of a child theme check:
|
1124 |
+
<a href="http://club.orbisius.com/products/wordpress-plugins/orbisius-theme-fixer/?utm_source=orbisius-child-theme-creator&utm_medium=settings_troubleshooting&utm_campaign=product"
|
1125 |
+
target="_blank" title="[new window]">Orbisius Theme Fixer</a>
|
1126 |
+
</div>
|
1127 |
+
</div> <!-- .postbox -->
|
1128 |
+
|
1129 |
+
|
1130 |
+
<div class="postbox"> <!-- quick-contact -->
|
1131 |
+
<?php
|
1132 |
+
$current_user = wp_get_current_user();
|
1133 |
+
$email = empty($current_user->user_email) ? '' : $current_user->user_email;
|
1134 |
+
$quick_form_action = is_ssl()
|
1135 |
+
? 'https://ssl.orbisius.com/apps/quick-contact/'
|
1136 |
+
: 'http://apps.orbisius.com/quick-contact/';
|
1137 |
+
|
1138 |
+
if (!empty($_SERVER['DEV_ENV'])) {
|
1139 |
+
$quick_form_action = 'http://localhost/projects/quick-contact/';
|
1140 |
+
}
|
1141 |
+
?>
|
1142 |
+
<script>
|
1143 |
+
var octc_quick_contact = {
|
1144 |
+
validate_form : function () {
|
1145 |
+
try {
|
1146 |
+
var msg = jQuery('#octc_msg').val().trim();
|
1147 |
+
var email = jQuery('#octc_email').val().trim();
|
1148 |
+
|
1149 |
+
email = email.replace(/\s+/, '');
|
1150 |
+
email = email.replace(/\.+/, '.');
|
1151 |
+
email = email.replace(/\@+/, '@');
|
1152 |
+
|
1153 |
+
if ( msg == '' ) {
|
1154 |
+
alert('Enter your message.');
|
1155 |
+
jQuery('#octc_msg').focus().val(msg).css('border', '1px solid red');
|
1156 |
+
return false;
|
1157 |
+
} else {
|
1158 |
+
// all is good clear borders
|
1159 |
+
jQuery('#octc_msg').css('border', '');
|
1160 |
+
}
|
1161 |
+
|
1162 |
+
if ( email == '' || email.indexOf('@') <= 2 || email.indexOf('.') == -1) {
|
1163 |
+
alert('Enter your email and make sure it is valid.');
|
1164 |
+
jQuery('#octc_email').focus().val(email).css('border', '1px solid red');
|
1165 |
+
return false;
|
1166 |
+
} else {
|
1167 |
+
// all is good clear borders
|
1168 |
+
jQuery('#octc_email').css('border', '');
|
1169 |
+
}
|
1170 |
+
|
1171 |
+
return true;
|
1172 |
+
} catch(e) {};
|
1173 |
+
}
|
1174 |
+
};
|
1175 |
+
</script>
|
1176 |
+
<h3><span>Quick Question or Suggestion</span></h3>
|
1177 |
+
<div class="inside">
|
1178 |
+
<div>
|
1179 |
+
<form method="post" action="<?php echo $quick_form_action; ?>" target="_blank">
|
1180 |
+
<?php
|
1181 |
+
global $wp_version;
|
1182 |
+
$plugin_data = get_plugin_data(__FILE__);
|
1183 |
+
|
1184 |
+
$hidden_data = array(
|
1185 |
+
'site_url' => site_url(),
|
1186 |
+
'wp_ver' => $wp_version,
|
1187 |
+
'first_name' => $current_user->first_name,
|
1188 |
+
'last_name' => $current_user->last_name,
|
1189 |
+
'product_name' => $plugin_data['Name'],
|
1190 |
+
'product_ver' => $plugin_data['Version'],
|
1191 |
+
'woocommerce_ver' => defined('WOOCOMMERCE_VERSION') ? WOOCOMMERCE_VERSION : 'n/a',
|
1192 |
+
);
|
1193 |
+
$hid_data = http_build_query($hidden_data);
|
1194 |
+
echo "<input type='hidden' name='data[sys_info]' value='$hid_data' />\n";
|
1195 |
+
?>
|
1196 |
+
<textarea class="widefat" id='octc_msg' name='data[msg]' required="required"></textarea>
|
1197 |
+
<br/>Your Email: <input type="text" class=""
|
1198 |
+
id="octc_email" name='data[sender_email]' placeholder="Email" required="required"
|
1199 |
+
value="<?php echo esc_attr($email); ?>"
|
1200 |
+
/>
|
1201 |
+
<br/><input type="submit" class="button-primary" value="<?php _e('Send Feedback') ?>"
|
1202 |
+
onclick="return octc_quick_contact.validate_form();" />
|
1203 |
+
<br/>
|
1204 |
+
What data will be sent
|
1205 |
+
<a href='javascript:void(0);'
|
1206 |
+
onclick='jQuery(".octc_data_to_be_sent").toggle();'>(show/hide)</a>
|
1207 |
+
<div class="hide app_hide octc_data_to_be_sent">
|
1208 |
+
<textarea class="widefat" rows="4" readonly="readonly" disabled="disabled"><?php
|
1209 |
+
foreach ($hidden_data as $key => $val) {
|
1210 |
+
if (is_array($val)) {
|
1211 |
+
$val = var_export($val, 1);
|
1212 |
+
}
|
1213 |
+
|
1214 |
+
echo "$key: $val\n";
|
1215 |
+
}
|
1216 |
+
?></textarea>
|
1217 |
+
</div>
|
1218 |
+
</form>
|
1219 |
+
</div>
|
1220 |
+
</div> <!-- .inside -->
|
1221 |
+
</div> <!-- .postbox --> <!-- /quick-contact -->
|
1222 |
+
|
1223 |
+
</div> <!-- .meta-box-sortables -->
|
1224 |
|
1225 |
+
</div> <!-- #postbox-container-1 .postbox-container sidebar -->
|
1226 |
+
|
1227 |
+
</div> <!-- #post-body .metabox-holder .columns-2 -->
|
1228 |
+
|
1229 |
+
<br class="clear">
|
1230 |
+
</div> <!-- #poststuff -->
|
1231 |
+
|
1232 |
+
<?php orbisius_child_theme_creator_util::output_orb_widget('author'); ?>
|
1233 |
+
</div> <!-- .wrap -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1234 |
<?php
|
1235 |
}
|
1236 |
|
1418 |
$app_link = $plugin_data['PluginURI'];
|
1419 |
$app_title = $plugin_data['Name'];
|
1420 |
|
1421 |
+
$parent_theme_data = version_compare($wp_version, '3.4', '>=')
|
1422 |
+
? wp_get_theme($this->parent_theme_basedir)
|
1423 |
+
: (object) get_theme_data($this->target_dir_path . 'style.css');
|
1424 |
|
1425 |
$theme_name = "$parent_theme_data->Name $this->target_name_suffix";
|
1426 |
$theme_uri = $parent_theme_data->ThemeURI;
|
1488 |
}
|
1489 |
|
1490 |
$themes_url = admin_url('themes.php');
|
1491 |
+
$edit_new_theme_url = admin_url('themes.php?page=orbisius_child_theme_creator_theme_editor_action&theme_1='
|
1492 |
+
. urlencode($this->target_base_dirname));
|
1493 |
|
1494 |
$this->info_result = "$parent_theme_data->Name " . $this->target_name_suffix . ' has been created in ' . $this->target_dir_path
|
1495 |
. ' based on ' . $parent_theme_data->Name . ' theme.'
|
1496 |
+
. "\n<br/>Next go to <a href='$themes_url'><strong>Appearance > Themes</strong></a> and Activate the new theme "
|
1497 |
+
. "or <a href='$edit_new_theme_url'>edit the new theme</a>.";
|
1498 |
}
|
1499 |
|
1500 |
/**
|
1513 |
error_log($msg . "\n", 3, ini_get('error_log'));
|
1514 |
}
|
1515 |
|
1516 |
+
/**
|
1517 |
+
*
|
1518 |
+
* @param str $file
|
1519 |
+
*/
|
1520 |
+
public function create_blank($file) {
|
1521 |
+
if ($file == 'functions.php') {
|
1522 |
+
$file_tpl = <<<BUFF_EOF
|
1523 |
+
/*
|
1524 |
+
* Generated By Orbisius Child Theme Creator - your favorite plugin for Child Theme creation :)
|
1525 |
+
* https://wordpress.org/plugins/orbisius-child-theme-creator/
|
1526 |
+
*
|
1527 |
+
* Unlike style.css, the functions.php of a child theme does not override its counterpart from the parent.
|
1528 |
+
* Instead, it is loaded in addition to the parent’s functions.php. (Specifically, it is loaded right before the parent theme's functions.php).
|
1529 |
+
* Source: http://codex.wordpress.org/Child_Themes#Using_functions.php
|
1530 |
+
*
|
1531 |
+
* Be sure not to define functions, that already exist in the parent theme!
|
1532 |
+
* A common pattern is to prefix function names with the (child) theme name.
|
1533 |
+
* Also if the parent theme supports pluggable functions you can use function_exists( 'put_the_function_name_here' ) checks.
|
1534 |
+
*/
|
1535 |
+
|
1536 |
+
BUFF_EOF;
|
1537 |
+
|
1538 |
+
$file_tpl = '<?php' . "\n" . $file_tpl . "\n\n"; // no need to close php
|
1539 |
+
|
1540 |
+
$file = $this->target_dir_path . $file;
|
1541 |
+
file_put_contents($file, $file_tpl, LOCK_EX);
|
1542 |
+
}
|
1543 |
+
}
|
1544 |
}
|
1545 |
|
1546 |
/**
|
1547 |
* Util funcs
|
1548 |
*/
|
1549 |
class orbisius_child_theme_creator_util {
|
1550 |
+
/**
|
1551 |
+
* Loads news from Club Orbsius Site.
|
1552 |
+
* <?php orbisius_child_theme_creator_util::output_orb_widget(); ?>
|
1553 |
+
*/
|
1554 |
+
public static function output_orb_widget($obj = '', $return = 0) {
|
1555 |
+
$buff = '';
|
1556 |
+
?>
|
1557 |
+
<!-- Orbisius JS Widget -->
|
1558 |
+
<?php
|
1559 |
+
$naked_domain = !empty($_SERVER['DEV_ENV']) ? 'orbclub.com.clients.com' : 'club.orbisius.com';
|
1560 |
+
|
1561 |
+
if (!empty($_SERVER['DEV_ENV']) && is_ssl()) {
|
1562 |
+
$naked_domain = 'ssl.orbisius.com/club';
|
1563 |
+
}
|
1564 |
+
|
1565 |
+
// obj could be 'author'
|
1566 |
+
$obj = empty($obj) ? str_replace('.php', '', basename(__FILE__)) : sanitize_title($obj);
|
1567 |
+
$obj_id = 'orb_widget_' . sha1($obj);
|
1568 |
+
|
1569 |
+
$params = '?' . http_build_query(array('p' => $obj, 't' => $obj_id, 'layout' => 'plugin', ));
|
1570 |
+
$buff .= "<div id='$obj_id' class='$obj_id orbisius_ext_content'></div>\n";
|
1571 |
+
$buff .= "<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://$naked_domain/wpu/widget/$params';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'orbsius-js-$obj_id');</script>";
|
1572 |
+
?>
|
1573 |
+
<!-- /Orbisius JS Widget -->
|
1574 |
+
<?php
|
1575 |
+
|
1576 |
+
if ($return) {
|
1577 |
+
return $buff;
|
1578 |
+
} else {
|
1579 |
+
echo $buff;
|
1580 |
+
}
|
1581 |
+
}
|
1582 |
+
|
1583 |
/**
|
1584 |
* This cleans filenames but leaves some of the / because some files can be dir1/file.txt.
|
1585 |
* $jail_root must be added because it will also prefix the path with a directory i.e. jail
|
2041 |
</ul>
|
2042 |
</div>
|
2043 |
|
|
|
2044 |
<!-- new folder -->
|
2045 |
<!--
|
2046 |
<div id='theme_1_new_folder_container' class="theme_1_new_folder_container app-hide">
|
2118 |
</td>
|
2119 |
</tr>
|
2120 |
</table>
|
2121 |
+
|
2122 |
+
<br/>
|
2123 |
+
<?php orbisius_child_theme_creator_util::output_orb_widget(); ?>
|
2124 |
<?php
|
2125 |
}
|
2126 |
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: lordspace,orbisius
|
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=7APYDVPBCSY9A
|
4 |
Tags: theme,child theme,childtheme,childthemes,parent theme,child themes,CSS,styling,resposive design,design,custom themeing, shared hosting,theme editor theme,themes,wp,wordpress,orbisius,theme creator,custom theme,theme generator,css,css editor
|
5 |
Requires at least: 3.4
|
6 |
-
Tested up to: 4
|
7 |
-
Stable tag: 1.2.
|
8 |
License: GPLv2 or later
|
9 |
|
10 |
Create Child Themes quickly and easily from any theme that you have currently installed on your site/blog.
|
@@ -39,7 +39,7 @@ It features two editors and you can pick snippets from one theme and paste into
|
|
39 |
* Since (v1.1.3) Send selected theme and parent theme (if any) to yourself or a colleague.
|
40 |
* Since (v1.1.3) Implemented theme files to be listed recursively (i.e. all files from the selected theme)
|
41 |
* Since (v1.1.9) Both editors have the same buttons (in older versions only the left editor had all of the buttons).
|
42 |
-
|
43 |
= Important Reasons to Create Child Themes =
|
44 |
* Keep your changes when the parent theme is updated.
|
45 |
* Reduce duplicated code i.e. you need to copy and customize only the files that need to be customized
|
@@ -136,6 +136,13 @@ Let's talk.
|
|
136 |
|
137 |
== Changelog ==
|
138 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
139 |
= 1.2.1 =
|
140 |
* Fixed: A notice in the settings
|
141 |
* Fixed a typo
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=7APYDVPBCSY9A
|
4 |
Tags: theme,child theme,childtheme,childthemes,parent theme,child themes,CSS,styling,resposive design,design,custom themeing, shared hosting,theme editor theme,themes,wp,wordpress,orbisius,theme creator,custom theme,theme generator,css,css editor
|
5 |
Requires at least: 3.4
|
6 |
+
Tested up to: 4.0.1
|
7 |
+
Stable tag: 1.2.2
|
8 |
License: GPLv2 or later
|
9 |
|
10 |
Create Child Themes quickly and easily from any theme that you have currently installed on your site/blog.
|
39 |
* Since (v1.1.3) Send selected theme and parent theme (if any) to yourself or a colleague.
|
40 |
* Since (v1.1.3) Implemented theme files to be listed recursively (i.e. all files from the selected theme)
|
41 |
* Since (v1.1.9) Both editors have the same buttons (in older versions only the left editor had all of the buttons).
|
42 |
+
* Since (v1.2.2) Can create a blank functions.php file (Thanks Tobias Kaupat for the suggestion)
|
43 |
= Important Reasons to Create Child Themes =
|
44 |
* Keep your changes when the parent theme is updated.
|
45 |
* Reduce duplicated code i.e. you need to copy and customize only the files that need to be customized
|
136 |
|
137 |
== Changelog ==
|
138 |
|
139 |
+
= 1.2.2 =
|
140 |
+
* Added: Create a blank functions.php file option
|
141 |
+
* Added a link to edit theme after the child theme is created.
|
142 |
+
* Changed the UI. Parent and Child Themes are nicely separated.
|
143 |
+
* Added a sidebar in the screen where child themes are created
|
144 |
+
* Fixed some wrong call to action (left from another plugin).
|
145 |
+
|
146 |
= 1.2.1 =
|
147 |
* Fixed: A notice in the settings
|
148 |
* Fixed a typo
|