Skip to content

Allowed sync data to reside within child themes #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cptuisync.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function cptuisync_taxonomy_path() {
* @return string
*/
function cptuisync_directory() {
$defaultDir = get_template_directory() . '/cptui';
$defaultDir = get_stylesheet_directory() . '/cptui';
if(!is_dir($defaultDir)) {
mkdir($defaultDir, null, true);
}
Expand Down
11 changes: 6 additions & 5 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ Save Custom Post Type UI (CPT UI) content types to a file so they can be added t

When you update or save a custom post type or taxonomy in CPT UI, the export code will be automatically dumped into your theme in the `cptui` folder.

All you have to do is include those files (`cptui/post_types.php` and `cptui/taxonomies.php`) in your theme and all your post types and taxonomies will work in your different environments without having to install CPT UI on live or staging.
All you have to do is include those files (`cptui/post_types.php` and `cptui/taxonomies.php`) in your theme using the code below and all your post types and taxonomies will work in your different environments without having to install CPT UI on live or staging.

In functions.php, add:
`
// only load if cptui not intialised
if(!function_exists('cptui_init')) {
require 'cptui/post_types.php';
require 'cptui/taxonomies.php';
// only load if Custom Post Type UI plugin is not intialised
if( !function_exists( 'cptui_init' ) ) {
include 'cptui/post_types.php';
include 'cptui/taxonomies.php';
}
`

Expand Down