Plugin Directory

Changeset 1117387


Ignore:
Timestamp:
03/21/2015 08:40:46 AM (11 years ago)
Author:
tychay
Message:

Updated to reflect new standard for Child Themeing

According to http://codex.wordpress.org/Child_Themes#How_to_Create_a_Child_Theme The new rule is to not @import the css file directly but use functions.php to enqueue the old css file. This reflects that and should fix broken-ness in ChildThemeing new themes in the current version of WordPress.

Location:
one-click-child-theme/trunk
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • one-click-child-theme/trunk/child-theme-css.php

    r427950 r1117387  
    55Template:       <?php echo $parent_theme_template, "\n"; ?>
    66
    7 (optional values you can add: Theme URI, Author URI, Version)
     7(optional values you can add: Theme URI, Author URI, Version, License, License URI, Tags, Text Domain)
    88*/
    9 
    10 @import url("../<?php echo $parent_theme_name; ?>/style.css");
  • one-click-child-theme/trunk/one-click-child-theme.php

    r427950 r1117387  
    44Plugin Name:  One-Click Child Theme
    55Plugin URI:   http://terrychay.com/wordpress-plugins/one-click-child-theme
    6 Version:      1.2
     6Version:      1.4
    77Description:  Allows you to easily child theme any theme from the theme
    88              options on the wp-admin instead of going into shell or
     
    1212
    1313**************************************************************************/
    14 /*  Copyright 2011  terry chay  (email : tychay@automattic.com)
     14/*  Copyright 2011-2015  terry chay  (email : tychay@php.net)
    1515
    1616    This program is free software; you can redistribute it and/or modify
     
    3131    function __construct() {
    3232        $this->plugin_dir = dirname(__FILE__);
    33         // it has to be buried liek this or you get an error "You do not have sufficient permissions to access this page"
     33        // it has to be buried like this or you get an error:
     34        //  "You do not have sufficient permissions to access this page"
    3435        add_filter( 'admin_menu', array( $this, 'createMenu' ) );
    3536    }
     
    3940
    4041    /**
    41      * Show the theme page which has a form allowing you to child theme currently selected theme.
     42     * Show the theme page which has a form allowing you to child theme
     43     * currently selected theme.
    4244     */
    4345    function showThemePage() {
     
    8183     *
    8284     * 1. style.css: Follows the rules outlined in {@link http://codex.wordpress.org/Child_Themes the Codex}
    83      * 2. rtl.css: right to left language support, if not avaialble in parent, it
    84      *    uses TwentyEleven's rtl
    85      * 3. screenshot.png: screenshot if available in the parent
     85     * 2. function.php: Followed the updated rules outlined in the Codex. Note
     86     *    that since WordPress ?.? functions.php hierarchy is automatically
     87     *    included.
     88     * 3. rtl.css: right to left language support, if not avaialble in parent, it
     89     *    uses TwentyFifteen's rtl
     90     * 4. screenshot.png: screenshot if available in the parent
    8691     *
    8792     * @author terry chay <tychay@autoamttic.com>
     
    117122        file_put_contents( $new_theme_path.'/style.css', $css );
    118123
     124        // Copy functions.php
     125        copy( $this->plugin_dir.'/functions.php', $new_theme_path.'/functions.php' );
     126
    119127        // RTL support
    120128        $rtl_theme = ( file_exists( $theme_root.'/'.$parent_theme_name.'/rtl.css' ) )
    121129            ? $parent_theme_name
    122             : 'twentyeleven'; //use the latest default theme rtl file
     130            : 'twentyfifteen'; //use the latest default theme rtl file
    123131        ob_start();
    124132        require $this->plugin_dir.'/rtl-css.php';
Note: See TracChangeset for help on using the changeset viewer.