Skip to content

Commit 52fd854

Browse files
committed
Fixing the inclusion of the content models. (important)
1 parent e2c4f24 commit 52fd854

File tree

4 files changed

+18
-6
lines changed

4 files changed

+18
-6
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ vendor/.DS_Store
1717
.DS_Store
1818
vendor/.DS_Store
1919
vendor/.DS_Store
20+
vendor/.DS_Store

includes/classes/class-tour-operator.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public function __construct() {
101101
// init legacy.
102102
$this->legacy = legacy\Tour_Operator::get_instance();
103103
// Setup plugin.
104-
add_action( 'init', array( $this, 'setup' ), 10 );
104+
add_action( 'init', array( $this, 'setup' ), 9 );
105105
}
106106

107107
/**
@@ -227,6 +227,7 @@ public function setup() {
227227
$this->patterns = new Patterns();
228228
$this->templates = new Templates();
229229

230+
do_action( 'qm/debug', $this->templates );
230231

231232
// Files that wont load with the badly written spl_autoregister function.
232233
require_once LSX_TO_PATH . 'includes/classes/class-post-connections.php';

vendor/.DS_Store

2 KB
Binary file not shown.

vendor/content-models/includes/json-initializer/class-content-model-json-initializer.php

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,21 @@ public static function maybe_register_content_models_from_json() {
4242
return;
4343
}
4444

45-
$post_types = glob( CONTENT_MODEL_JSON_PATH . '/post-types/*.json' );
46-
$post_types = array_map(
47-
fn( $file ) => json_decode( file_get_contents( $file ), true ),
48-
$post_types
49-
);
45+
global $CONTENT_MODEL_JSON_PATH;
46+
if ( ! isset( $CONTENT_MODEL_JSON_PATH ) ) {
47+
return;
48+
}
49+
50+
$post_types = [];
51+
52+
foreach ( $CONTENT_MODEL_JSON_PATH as $json_path ) {
53+
$types = glob( $json_path . '/post-types/*.json' );
54+
$types = array_map(
55+
fn( $file ) => json_decode( file_get_contents( $file ), true ),
56+
$types
57+
);
58+
$post_types = array_merge( $post_types, $types );
59+
}
5060

5161
self::register_content_models_from_json( $post_types );
5262
self::delete_dangling_content_models( $post_types );

0 commit comments

Comments
 (0)