- Timestamp:
- 10/13/2026 12:30:44 PM (4 days ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kirki/trunk/includes/API/Frontend/Controllers/CollectionController.php
r3636487 r3743904 110 110 } 111 111 }else { 112 $all_blocks = get_post_meta($post_id, 'kirki', true); 113 $all_styles = Page::get_page_styleblocks($post_id, false); 114 DataHelper::get_data_and_styles_from_root( $collection_data_id, $data_n_styles, $all_blocks['blocks'], $all_styles ); 112 // read_page_meta() resolves the most recent version to the right source 113 // either post_meta or the staging table, depending on the post's state. 114 $all_blocks = Page::read_page_meta( $post_id, 'kirki', false, null ); 115 $all_styles = Page::get_page_styleblocks( $post_id, false ); 116 if ( is_array( $all_blocks ) && isset( $all_blocks['blocks'] ) ) { 117 DataHelper::get_data_and_styles_from_root( $collection_data_id, $data_n_styles, $all_blocks['blocks'], $all_styles ); 118 } 115 119 } 116 120 } … … 154 158 ); 155 159 } elseif ( isset( $context['type'] ) && $context['type'] === 'term' ) { 156 $options = array( 157 'term' => get_term( absint( $context['id'] ?? 0 ) )->to_array(), 160 $term = get_term( absint( $context['id'] ?? 0 ) ); 161 $options = array( 162 'term' => $term instanceof \WP_Term ? $term->to_array() : null, 158 163 ); 159 164 } elseif ( isset( $context['type'] ) && $context['type'] === 'comment' ) { … … 162 167 'comment' => get_comment( absint( $context['comment']['comment_ID'] ?? 0 ) ), 163 168 ); 169 } elseif ( isset( $context['type'] ) && $context['type'] === 'kirki_utility' ) { 170 $options = array( 171 'kirki_utility_page_id' => absint( $context['kirki_utility_page_id'] ?? 0 ), 172 ); 164 173 } 165 174 } 166 175 176 // Never merge the raw request context here: only the values resolved above 177 // have passed get_item_permissions_check(). 167 178 $params = array( 168 179 'blocks' => $blocks, … … 176 187 'q' => $query, 177 188 ), 178 $options, 179 $context 189 $options 180 190 ), 181 191 'search_related_collection_ids' => [$collection_id => true],
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)