Plugin Directory

Changeset 893680


Ignore:
Timestamp:
04/15/2014 03:26:00 PM (12 years ago)
Author:
JohnPBloch
Message:

Release 1.0.3

Location:
child-themify
Files:
12 added
2 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • child-themify/trunk/assets/js/legacy.js

    r840162 r893680  
    1 /*! Child Themify - v1.0.2
     1/*! Child Themify - v1.0.3
    22* Copyright (c) 2014 John P. Bloch */
    33(function (window, l10n) {
  • child-themify/trunk/assets/js/legacy.min.js

    r840162 r893680  
    1 /*! Child Themify - v1.0.2
     1/*! Child Themify - v1.0.3
    22* Copyright (c) 2014 John P. Bloch */
    33!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  
    33 * Plugin Name: Child Themify
    44 * Description: Create child themes at the click of a button.
    5  * Version: 1.0.2
     5 * Version: 1.0.3
    66 * Plugin URI: https://github.com/johnpbloch/child-themify
    77 * Author: John P. Bloch
     
    1111define( 'CTF_PATH', WP_PLUGIN_DIR . '/' . basename( dirname( __FILE__ ) ) . '/' . basename( __FILE__ ) );
    1212define( 'CTF_URL', WP_PLUGIN_URL . '/' . basename( dirname( __FILE__ ) ) . '/' . basename( __FILE__ ) );
    13 define( 'CTF_VERSION', '1.0.2' );
     13define( 'CTF_VERSION', '1.0.3' );
    1414
    1515
  • child-themify/trunk/includes/plugin.php

    r837756 r893680  
    3131
    3232    /**
     33     * @param WP_Theme $theme
     34     *
    3335     * @return string
    3436     */
    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     *
    4044     * @return string
    4145     */
    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;
    4452    }
    4553
     
    188196
    189197    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        }
    200204    }
    201205
     
    206210    public function isChildThemifyPage() {
    207211        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         ) );
    221212    }
    222213
     
    225216        add_filter( 'theme_action_links', array( $this, 'addActionLink' ), 10, 2 );
    226217        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;
    227321    }
    228322
  • child-themify/trunk/languages/child-themify.pot

    r840162 r893680  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Child Themify 1.0.2\n"
     5"Project-Id-Version: Child Themify 1.0.3\n"
    66"Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/child-themify\n"
    7 "POT-Creation-Date: 2014-01-17 07:45:26+00:00\n"
     7"POT-Creation-Date: 2014-04-15 15:23:02+00:00\n"
    88"MIME-Version: 1.0\n"
    99"Content-Type: text/plain; charset=UTF-8\n"
     
    1717msgstr ""
    1818
    19 #: includes/legacy.php:39 includes/plugin.php:62
     19#: includes/legacy.php:39 includes/plugin.php:70
    2020msgctxt "The placeholder is for a theme's name"
    2121msgid "Create a child theme from %s"
    2222msgstr ""
    2323
    24 #: includes/legacy.php:42 includes/plugin.php:65
     24#: includes/legacy.php:42 includes/plugin.php:73
    2525msgid "Name your child theme"
    2626msgstr ""
    2727
    28 #: includes/legacy.php:44 includes/plugin.php:67
     28#: includes/legacy.php:44 includes/plugin.php:75
    2929msgid "Let's go!"
    3030msgstr ""
    3131
    32 #: includes/legacy.php:106 includes/legacy.php:169 includes/plugin.php:145
    33 #: includes/plugin.php:218
     32#: includes/legacy.php:106 includes/legacy.php:169 includes/plugin.php:153
     33#: includes/plugin.php:305
    3434msgid "Create a child theme"
    3535msgstr ""
    3636
    37 #: includes/legacy.php:125 includes/plugin.php:165
     37#: includes/legacy.php:125 includes/plugin.php:173
    3838msgid "Could not access the filesystem!"
    3939msgstr ""
    4040
    41 #: includes/legacy.php:146 includes/plugin.php:186
     41#: includes/legacy.php:146 includes/plugin.php:194
    4242msgid "Your child theme was created successfully."
     43msgstr ""
     44
     45#: includes/plugin.php:237
     46msgid "Show previous theme"
     47msgstr ""
     48
     49#: includes/plugin.php:238
     50msgid "Show next theme"
     51msgstr ""
     52
     53#: includes/plugin.php:239
     54msgid "Close overlay"
     55msgstr ""
     56
     57#: includes/plugin.php:254
     58msgid "Current Theme"
     59msgstr ""
     60
     61#: includes/plugin.php:256
     62msgid "Version: %s"
     63msgstr ""
     64
     65#: includes/plugin.php:257
     66msgid "By %s"
     67msgstr ""
     68
     69#: includes/plugin.php:261
     70msgid "Update Available"
     71msgstr ""
     72
     73#: includes/plugin.php:268
     74msgid "This is a child theme of %s."
     75msgstr ""
     76
     77#: includes/plugin.php:272
     78msgid "Tags:"
     79msgstr ""
     80
     81#: includes/plugin.php:279
     82msgid "Customize"
     83msgstr ""
     84
     85#: includes/plugin.php:285
     86msgid "Activate"
     87msgstr ""
     88
     89#: includes/plugin.php:287
     90msgid "Live Preview"
     91msgstr ""
     92
     93#: includes/plugin.php:288
     94msgid "Preview"
     95msgstr ""
     96
     97#: includes/plugin.php:293
     98msgid "Delete"
    4399msgstr ""
    44100
  • child-themify/trunk/readme.txt

    r840394 r893680  
    33Tags: themes, child, theme
    44Requires at least: 3.4.2
    5 Tested up to: 3.8
    6 Stable tag: 1.0.2
     5Tested up to: 3.9
     6Stable tag: 1.0.3
    77License: GPL-2.0+
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3333== Changelog ==
    3434
     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
    3540= 1.0.2 =
    3641* Released: 2014-01-13
     
    4752== Upgrade Notice ==
    4853
    49 This version fixes the plugin in WordPress 3.8
     54This version cleans up 3.8+ compatibility and ensures 3.9 compatibility
    5055
Note: See TracChangeset for help on using the changeset viewer.