Skip to content

Commit

Permalink
🚀 RELEASE: 2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
stevengliebe committed Aug 10, 2020
1 parent 0e28ccd commit 8cddd61
Showing 1 changed file with 37 additions and 37 deletions.
74 changes: 37 additions & 37 deletions framework.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/

// No direct access
if ( ! defined( 'ABSPATH' ) ) {
if (! defined( 'ABSPATH' )) {
exit;
}

Expand All @@ -31,52 +31,52 @@
/**
* Framework constants
*/
if ( ! defined( 'CTFW_VERSION' ) ) define( 'CTFW_VERSION', '2.6.6' );
if (! defined( 'CTFW_VERSION' )) define( 'CTFW_VERSION', '2.7' );

/**
* Theme constants
*/
if ( ! defined( 'CTFW_THEME_VERSION' ) ) define( 'CTFW_THEME_VERSION', $theme_data->Version ); // parent theme version
if ( ! defined( 'CTFW_THEME_NAME' ) ) define( 'CTFW_THEME_NAME', $theme_data->Name ); // parent theme name, specified in style.css
if ( ! defined( 'CTFW_THEME_SLUG' ) ) define( 'CTFW_THEME_SLUG', $theme_data->template ); // parent theme's folder (theme slug)
if ( ! defined( 'CTFW_THEME_AUTHOR' ) ) define( 'CTFW_THEME_AUTHOR', strip_tags( $theme_data->Author ) ); // parent theme's author
if ( ! defined( 'CTFW_THEME_PATH' ) ) define( 'CTFW_THEME_PATH', get_template_directory() ); // parent theme path
if ( ! defined( 'CTFW_THEME_URL' ) ) define( 'CTFW_THEME_URL', get_template_directory_uri() ); // parent theme URI
if ( ! defined( 'CTFW_THEME_CHILD_PATH' ) ) define( 'CTFW_THEME_CHILD_PATH', get_stylesheet_directory() ); // child theme path
if ( ! defined( 'CTFW_THEME_CHILD_URL' ) ) define( 'CTFW_THEME_CHILD_URL', get_stylesheet_directory_uri() ); // child theme URI
if (! defined( 'CTFW_THEME_VERSION' )) define( 'CTFW_THEME_VERSION', $theme_data->Version ); // parent theme version
if (! defined( 'CTFW_THEME_NAME' )) define( 'CTFW_THEME_NAME', $theme_data->Name ); // parent theme name, specified in style.css
if (! defined( 'CTFW_THEME_SLUG' )) define( 'CTFW_THEME_SLUG', $theme_data->template ); // parent theme's folder (theme slug)
if (! defined( 'CTFW_THEME_AUTHOR' )) define( 'CTFW_THEME_AUTHOR', strip_tags( $theme_data->Author ) ); // parent theme's author
if (! defined( 'CTFW_THEME_PATH' )) define( 'CTFW_THEME_PATH', get_template_directory() ); // parent theme path
if (! defined( 'CTFW_THEME_URL' )) define( 'CTFW_THEME_URL', get_template_directory_uri() ); // parent theme URI
if (! defined( 'CTFW_THEME_CHILD_PATH' )) define( 'CTFW_THEME_CHILD_PATH', get_stylesheet_directory() ); // child theme path
if (! defined( 'CTFW_THEME_CHILD_URL' )) define( 'CTFW_THEME_CHILD_URL', get_stylesheet_directory_uri() ); // child theme URI

/**
* Theme directory constants
*
* Theme and framework structures mirror each other.
*/
if ( ! defined( 'CTFW_THEME_INC_DIR' ) ) define( 'CTFW_THEME_INC_DIR', 'includes' ); // includes directory
if ( ! defined( 'CTFW_THEME_ADMIN_DIR' ) ) define( 'CTFW_THEME_ADMIN_DIR', CTFW_THEME_INC_DIR . '/admin' ); // admin directory
if ( ! defined( 'CTFW_THEME_CLASS_DIR' ) ) define( 'CTFW_THEME_CLASS_DIR', CTFW_THEME_INC_DIR . '/classes' ); // classes directory
if ( ! defined( 'CTFW_THEME_LIB_DIR' ) ) define( 'CTFW_THEME_LIB_DIR', CTFW_THEME_INC_DIR . '/libraries' ); // libraries directory
if ( ! defined( 'CTFW_THEME_PAGE_TPL_DIR' ) ) define( 'CTFW_THEME_PAGE_TPL_DIR', 'page-templates' ); // page templates directory
if ( ! defined( 'CTFW_THEME_PARTIAL_DIR' ) ) define( 'CTFW_THEME_PARTIAL_DIR', 'partials' ); // partials directory (re-usable template parts)
if ( ! defined( 'CTFW_THEME_WIDGET_DIR' ) ) define( 'CTFW_THEME_WIDGET_DIR', 'widget-templates' ); // widget templates directory
if ( ! defined( 'CTFW_THEME_CSS_DIR' ) ) define( 'CTFW_THEME_CSS_DIR', 'css' ); // stylesheets directory
if ( ! defined( 'CTFW_THEME_JS_DIR' ) ) define( 'CTFW_THEME_JS_DIR', 'js' ); // JavaScript directory
if ( ! defined( 'CTFW_THEME_IMG_DIR' ) ) define( 'CTFW_THEME_IMG_DIR', 'images' ); // images directory
if ( ! defined( 'CTFW_THEME_BG_DIR' ) ) define( 'CTFW_THEME_BG_DIR', CTFW_THEME_IMG_DIR . '/backgrounds' ); // background images directory
if ( ! defined( 'CTFW_THEME_COLOR_DIR' ) ) define( 'CTFW_THEME_COLOR_DIR', 'colors' ); // color schemes directory
if ( ! defined( 'CTFW_THEME_LANG_DIR' ) ) define( 'CTFW_THEME_LANG_DIR', 'languages' ); // languages directory
if (! defined( 'CTFW_THEME_INC_DIR' )) define( 'CTFW_THEME_INC_DIR', 'includes' ); // includes directory
if (! defined( 'CTFW_THEME_ADMIN_DIR' )) define( 'CTFW_THEME_ADMIN_DIR', CTFW_THEME_INC_DIR . '/admin' ); // admin directory
if (! defined( 'CTFW_THEME_CLASS_DIR' )) define( 'CTFW_THEME_CLASS_DIR', CTFW_THEME_INC_DIR . '/classes' ); // classes directory
if (! defined( 'CTFW_THEME_LIB_DIR' )) define( 'CTFW_THEME_LIB_DIR', CTFW_THEME_INC_DIR . '/libraries' ); // libraries directory
if (! defined( 'CTFW_THEME_PAGE_TPL_DIR' )) define( 'CTFW_THEME_PAGE_TPL_DIR', 'page-templates' ); // page templates directory
if (! defined( 'CTFW_THEME_PARTIAL_DIR' )) define( 'CTFW_THEME_PARTIAL_DIR', 'partials' ); // partials directory (re-usable template parts)
if (! defined( 'CTFW_THEME_WIDGET_DIR' )) define( 'CTFW_THEME_WIDGET_DIR', 'widget-templates' ); // widget templates directory
if (! defined( 'CTFW_THEME_CSS_DIR' )) define( 'CTFW_THEME_CSS_DIR', 'css' ); // stylesheets directory
if (! defined( 'CTFW_THEME_JS_DIR' )) define( 'CTFW_THEME_JS_DIR', 'js' ); // JavaScript directory
if (! defined( 'CTFW_THEME_IMG_DIR' )) define( 'CTFW_THEME_IMG_DIR', 'images' ); // images directory
if (! defined( 'CTFW_THEME_BG_DIR' )) define( 'CTFW_THEME_BG_DIR', CTFW_THEME_IMG_DIR . '/backgrounds' ); // background images directory
if (! defined( 'CTFW_THEME_COLOR_DIR' )) define( 'CTFW_THEME_COLOR_DIR', 'colors' ); // color schemes directory
if (! defined( 'CTFW_THEME_LANG_DIR' )) define( 'CTFW_THEME_LANG_DIR', 'languages' ); // languages directory

/**
* Framework directory constants
*
* Note use of theme constants. Theme and framework structures mirror each other.
*/
if ( ! defined( 'CTFW_DIR' ) ) define( 'CTFW_DIR', basename( dirname( __FILE__) ) ); // framework directory (where this file is)
if ( ! defined( 'CTFW_INC_DIR' ) ) define( 'CTFW_INC_DIR', CTFW_DIR . '/' . CTFW_THEME_INC_DIR ); // framework includes directory
if ( ! defined( 'CTFW_ADMIN_DIR' ) ) define( 'CTFW_ADMIN_DIR', CTFW_DIR . '/' . CTFW_THEME_ADMIN_DIR ); // framework admin directory
if ( ! defined( 'CTFW_CLASS_DIR' ) ) define( 'CTFW_CLASS_DIR', CTFW_DIR . '/' . CTFW_THEME_CLASS_DIR ); // framework classes directory
if ( ! defined( 'CTFW_LIB_DIR' ) ) define( 'CTFW_LIB_DIR', CTFW_DIR . '/' . CTFW_THEME_LIB_DIR ); // framework libraries directory
if ( ! defined( 'CTFW_CSS_DIR' ) ) define( 'CTFW_CSS_DIR', CTFW_DIR . '/' . CTFW_THEME_CSS_DIR ); // framework stylesheets directory
if ( ! defined( 'CTFW_JS_DIR' ) ) define( 'CTFW_JS_DIR', CTFW_DIR . '/' . CTFW_THEME_JS_DIR ); // framework JavaScript directory
if ( ! defined( 'CTFW_IMG_DIR' ) ) define( 'CTFW_IMG_DIR', CTFW_DIR . '/' . CTFW_THEME_IMG_DIR ); // framework images directory
if (! defined( 'CTFW_DIR' )) define( 'CTFW_DIR', basename( dirname( __FILE__) ) ); // framework directory (where this file is)
if (! defined( 'CTFW_INC_DIR' )) define( 'CTFW_INC_DIR', CTFW_DIR . '/' . CTFW_THEME_INC_DIR ); // framework includes directory
if (! defined( 'CTFW_ADMIN_DIR' )) define( 'CTFW_ADMIN_DIR', CTFW_DIR . '/' . CTFW_THEME_ADMIN_DIR ); // framework admin directory
if (! defined( 'CTFW_CLASS_DIR' )) define( 'CTFW_CLASS_DIR', CTFW_DIR . '/' . CTFW_THEME_CLASS_DIR ); // framework classes directory
if (! defined( 'CTFW_LIB_DIR' )) define( 'CTFW_LIB_DIR', CTFW_DIR . '/' . CTFW_THEME_LIB_DIR ); // framework libraries directory
if (! defined( 'CTFW_CSS_DIR' )) define( 'CTFW_CSS_DIR', CTFW_DIR . '/' . CTFW_THEME_CSS_DIR ); // framework stylesheets directory
if (! defined( 'CTFW_JS_DIR' )) define( 'CTFW_JS_DIR', CTFW_DIR . '/' . CTFW_THEME_JS_DIR ); // framework JavaScript directory
if (! defined( 'CTFW_IMG_DIR' )) define( 'CTFW_IMG_DIR', CTFW_DIR . '/' . CTFW_THEME_IMG_DIR ); // framework images directory

/********************************************
* INCLUDES
Expand Down Expand Up @@ -186,16 +186,16 @@
function ctfw_load_includes( $includes ) {

// Loop conditions
foreach ( $includes as $condition => $files ) {
foreach ($includes as $condition => $files) {

// Check condition
$do_includes = false;
switch( $condition ) {
switch($condition) {

// Admin Only
case 'admin':

if ( is_admin() ) {
if (is_admin()) {
$do_includes = true;
}

Expand All @@ -204,7 +204,7 @@ function ctfw_load_includes( $includes ) {
// Frontend Only
case 'frontend':

if ( ! is_admin() ) {
if (! is_admin()) {
$do_includes = true;
}

Expand All @@ -220,9 +220,9 @@ function ctfw_load_includes( $includes ) {
}

// Loop files if condition met
if ( $do_includes ) {
if ($do_includes) {

foreach ( $files as $file ) {
foreach ($files as $file) {
locate_template( $file, true ); // include from child theme first, then parent theme
}

Expand Down

0 comments on commit 8cddd61

Please sign in to comment.