Plugin Directory


Ignore:
Timestamp:
10/13/2026 12:30:44 PM (4 days ago)
Author:
themeum
Message:

Updated to 6.4.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kirki/trunk/includes/API/Frontend/Controllers/CollectionController.php

    r3636487 r3743904  
    110110                                }
    111111                        }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                                }
    115119                        }
    116120                }
    … …  
    154158                                );
    155159                        } 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,
    158163                                );
    159164                        } elseif ( isset( $context['type'] ) && $context['type'] === 'comment' ) {
    … …  
    162167                                        'comment' => get_comment( absint( $context['comment']['comment_ID'] ?? 0 ) ),
    163168                                );
     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                                );
    164173                        }
    165174                }
    166175
     176                // Never merge the raw request context here: only the values resolved above
     177                // have passed get_item_permissions_check().
    167178                $params = array(
    168179                        'blocks'       => $blocks,
    … …  
    176187                                        'q'                        => $query,
    177188                                ),
    178                                 $options,
    179                                 $context
     189                                $options
    180190                        ),
    181191                        'search_related_collection_ids' => [$collection_id => true],
Note: See TracChangeset for help on using the changeset viewer.