ice_post ) { $slice_post_ids[] = $slice_post_key; // Sanitize before adding to cache otherwise the post is going to be sanitized every time it is fetched from the cache $sanitized_post = sanitize_post( $slice_post, 'raw' ); wp_cache_add( $slice_post_key, $sanitized_post, 'posts' ); } $this->set_slice_post_ids( $slice_post_ids ); } } private function reset_slice_posts() { foreach ( $this->get_slice_post_ids() as $slice_post_id ) { wp_cache_delete( $slice_post_id, 'posts' ); } $this->set_slice_post_ids( array() ); } /** * @param $attachment_id * @param $meta_key * * @return string */ private function get_post_meta_cache_key( $attachment_id, $meta_key ) { return "$attachment_id-$meta_key"; } private function get_slice_post_meta() { $slice_post_meta = $this->slice_post_meta; if ( $this->is_multisite ) { $slice_post_meta = $this->array_utils->get_array_value( $slice_post_meta, $this->current_site_id ); } return $this->array_utils->ensure_array( $slice_post_meta ); } private function set_slice_post_meta( $slice_post_meta ) { if ( $this->is_multisite ) { $this->slice_post_meta[ $this->current_site_id ] = $slice_post_meta; } else { $this->slice_post_meta = $slice_post_meta; } } private function get_slice_post_ids() { $slice_post_ids = $this->slice_post_ids; if ( $this->is_multisite ) { $slice_post_ids = $this->array_utils->get_array_value( $slice_post_ids, $this->current_site_id ); } return $this->array_utils->ensure_array( $slice_post_ids ); } private function set_slice_post_ids( $slice_post_ids ) { if ( $this->is_multisite ) { $this->slice_post_ids[ $this->current_site_id ] = $slice_post_ids; } else { $this->slice_post_ids = $slice_post_ids; } } /** * @param $attachment_id * @param $meta_key * @param $meta_value * * @return void */ private function update_post_meta( $attachment_id, $meta_key, $meta_value ) { $cache_key = $this->get_post_meta_cache_key( $attachment_id, $meta_key ); $slice_post_meta = $this->get_slice_post_meta(); if ( empty( $slice_post_meta[ $cache_key ] ) ) { $slice_post_meta[ $cache_key ] = new \stdClass(); } $slice_post_meta[ $cache_key ]->meta_value = $meta_value; $this->set_slice_post_meta( $slice_post_meta ); } } WordPress › Error

There has been a critical error on this website.

Learn more about troubleshooting WordPress.