[
  {
    "path": "custom/custom.js",
    "content": "jQuery(document).ready(function($){\n\t// Custom jQuery goes here\n});\n"
  },
  {
    "path": "custom/functions.php",
    "content": "<?php\n/**\n * Functions.php\n *\n * @package  Theme_Customisations\n * @author   WooThemes\n * @since    1.0.0\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly.\n}\n\n/**\n * functions.php\n * Add PHP snippets here\n */\n"
  },
  {
    "path": "custom/style.css",
    "content": "/**\r\n * Add any custom CSS here.\r\n *\r\n * This file will be loaded after all other theme stylesheets.\r\n */"
  },
  {
    "path": "readme.txt",
    "content": "=== Theme Customisations ===\nContributors: jameskoster, woothemes\nTags: theme, edit, edits, customise, customisation, customize, customization, css, php, jquery\nRequires at least: 3.0.0\nTested up to: 4.5.2\nStable tag: 1.0.0\nLicense: GPLv2 or later\nLicense URI: http://www.gnu.org/licenses/gpl-2.0.html\n\nA handy little plugin to contain your theme/plugin customisation snippets.\n\n== Description ==\n\nThink of this plugin as an alternative to adding code snippets to the functions.php, or style.css file in your child theme. Why? It keeps all of your changes in one location, independent of the other components that make up your web site. That means you can safely perform theme / plugin updates without the worry of losing your modifications as well as easily deactivating your customisations to check for conflicts.\n\n*Note:* This plugin doesn't actually do anything on its own. It is purely a convenient place for you to store your own theme/plugin customisations.\n\n== Installation ==\n\n1. Upload `theme-customisations` to the `/wp-content/plugins/` directory\n2. Add your customisations to the plugin either locally or via Plugins > Editor in the Dashboard\n3. Activate the plugin through the 'Plugins' menu in WordPress\n4. Done!\n\n== Usage ==\n\n* Add any CSS snippets to `custom/style.css`. This file is found in this plugin.\n* Add any PHP snippets to `custom/functions.php`. This file is found in this plugin.\n* Add any jQuery snippets to `custom/custom.js`. This file is found in this plugin.\n* Add custom top level template files (page.php, single.php etc) to `custom/templates/`. You will need to create the templates folder.\n* Add any WooCommerce template files to `custom/templates/woocommerce`. You will need to create the templates and woocommerce folders.\n* Activate the plugin.\n\n== Frequently Asked Questions ==\n\n= Isn't this what child themes are for? =\n\nWell, kind of. Sure, you can put your modifications in a child theme, but there are many places (including woothemes.com and wordpress.org) to download and use child themes. If you decide to use a child theme built by a third party and make modifications there, you would lose them when performing updates. Also if you make all your modifications in your own custom child theme then realise that you want to use a child theme from your favorite theme vendor, you'll have to move all of your modifications somewhere else. To avoid that hassle, use this plugin.\n\n= What templates can I override via this plugin? =\n\nAs you know, to override a parent themes template file via child theme you can just copy/paste it into your child theme. This is the one drawback of using this plugin - you can only override top level templates - not template partials. This means that you could add a `page.php` template file to the `/custom/templates/` dir of this plugin and it would work fine. You could not however add a `header.php` or `footer.php` template file. Those would not work.\n\n= Should I put all my customisations in this single plugin? =\n\nThat's entirely up to you. There's nothing to stop you from duplicating this plugin and changing the name. That way you could theoretically keep each of your customisations in their own individual plugins. This can be very handy when debugging, or if you want to quickly enable/disable a specific customisations temporarily.\n"
  },
  {
    "path": "theme-customisations.php",
    "content": "<?php\n/**\n * Plugin Name:       Theme Customisations\n * Description:       A handy little plugin to contain your theme customisation snippets.\n * Plugin URI:        http://github.com/woothemes/theme-customisations\n * Version:           1.0.0\n * Author:            WooThemes\n * Author URI:        https://www.woocommerce.com/\n * Requires at least: 3.0.0\n * Tested up to:      4.4.2\n *\n * @package Theme_Customisations\n */\n\nif ( ! defined( 'ABSPATH' ) ) {\n\texit; // Exit if accessed directly.\n}\n\n/**\n * Main Theme_Customisations Class\n *\n * @class Theme_Customisations\n * @version\t1.0.0\n * @since 1.0.0\n * @package\tTheme_Customisations\n */\nfinal class Theme_Customisations {\n\n\t/**\n\t * Set up the plugin\n\t */\n\tpublic function __construct() {\n\t\tadd_action( 'init', array( $this, 'theme_customisations_setup' ), -1 );\n\t\trequire_once( 'custom/functions.php' );\n\t}\n\n\t/**\n\t * Setup all the things\n\t */\n\tpublic function theme_customisations_setup() {\n\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'theme_customisations_css' ), 999 );\n\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'theme_customisations_js' ) );\n\t\tadd_filter( 'template_include',   array( $this, 'theme_customisations_template' ), 11 );\n\t\tadd_filter( 'wc_get_template',    array( $this, 'theme_customisations_wc_get_template' ), 11, 5 );\n\t}\n\n\t/**\n\t * Enqueue the CSS\n\t *\n\t * @return void\n\t */\n\tpublic function theme_customisations_css() {\n\t\twp_enqueue_style( 'custom-css', plugins_url( '/custom/style.css', __FILE__ ) );\n\t}\n\n\t/**\n\t * Enqueue the Javascript\n\t *\n\t * @return void\n\t */\n\tpublic function theme_customisations_js() {\n\t\twp_enqueue_script( 'custom-js', plugins_url( '/custom/custom.js', __FILE__ ), array( 'jquery' ) );\n\t}\n\n\t/**\n\t * Look in this plugin for template files first.\n\t * This works for the top level templates (IE single.php, page.php etc). However, it doesn't work for\n\t * template parts yet (content.php, header.php etc).\n\t *\n\t * Relevant trac ticket; https://core.trac.wordpress.org/ticket/13239\n\t *\n\t * @param  string $template template string.\n\t * @return string $template new template string.\n\t */\n\tpublic function theme_customisations_template( $template ) {\n\t\tif ( file_exists( untrailingslashit( plugin_dir_path( __FILE__ ) ) . '/custom/templates/' . basename( $template ) ) ) {\n\t\t\t$template = untrailingslashit( plugin_dir_path( __FILE__ ) ) . '/custom/templates/' . basename( $template );\n\t\t}\n\n\t\treturn $template;\n\t}\n\n\t/**\n\t * Look in this plugin for WooCommerce template overrides.\n\t *\n\t * For example, if you want to override woocommerce/templates/cart/cart.php, you\n\t * can place the modified template in <plugindir>/custom/templates/woocommerce/cart/cart.php\n\t *\n\t * @param string $located is the currently located template, if any was found so far.\n\t * @param string $template_name is the name of the template (ex: cart/cart.php).\n\t * @return string $located is the newly located template if one was found, otherwise\n\t *                         it is the previously found template.\n\t */\n\tpublic function theme_customisations_wc_get_template( $located, $template_name, $args, $template_path, $default_path ) {\n\t\t$plugin_template_path = untrailingslashit( plugin_dir_path( __FILE__ ) ) . '/custom/templates/woocommerce/' . $template_name;\n\n\t\tif ( file_exists( $plugin_template_path ) ) {\n\t\t\t$located = $plugin_template_path;\n\t\t}\n\n\t\treturn $located;\n\t}\n} // End Class\n\n/**\n * The 'main' function\n *\n * @return void\n */\nfunction theme_customisations_main() {\n\tnew Theme_Customisations();\n}\n\n/**\n * Initialise the plugin\n */\nadd_action( 'plugins_loaded', 'theme_customisations_main' );\n"
  }
]