[]; $post = null; if ( $indexable->object_type === 'post' ) { $post = \get_post( $indexable->object_id ); $blocks = $this->blocks->get_all_blocks_from_content( $post->post_content ); } $context = $this->context_prototype->of( [ 'indexable' => $indexable, 'blocks' => $blocks, 'post' => $post, 'page_type' => $page_type, ] ); $context->presentation = $this->presentation_memoizer->get( $indexable, $context, $page_type ); $this->cache[ $indexable->id ] = $context; } return $this->cache[ $indexable->id ]; } /** * Clears the memoization of either a specific indexable or all indexables. * * @param Indexable|int|string|null $indexable Optional. The indexable or indexable id to clear the memoization of. * * @return void */ public function clear( $indexable = null ) { if ( $indexable instanceof Indexable ) { unset( $this->cache[ $indexable->id ] ); return; } if ( $indexable !== null ) { unset( $this->cache[ $indexable ] ); return; } $this->cache = []; } } []; $post = null; if ( $indexable->object_type === 'post' ) { $post = \get_post( $indexable->object_id ); $blocks = $this->blocks->get_all_blocks_from_content( $post->post_content ); } $context = $this->context_prototype->of( [ 'indexable' => $indexable, 'blocks' => $blocks, 'post' => $post, 'page_type' => $page_type, ] ); $context->presentation = $this->presentation_memoizer->get( $indexable, $context, $page_type ); $this->cache[ $indexable->id ] = $context; } return $this->cache[ $indexable->id ]; } /** * Clears the memoization of either a specific indexable or all indexables. * * @param Indexable|int|string|null $indexable Optional. The indexable or indexable id to clear the memoization of. * * @return void */ public function clear( $indexable = null ) { if ( $indexable instanceof Indexable ) { unset( $this->cache[ $indexable->id ] ); return; } if ( $indexable !== null ) { unset( $this->cache[ $indexable ] ); return; } $this->cache = []; } } []; $post = null; if ( $indexable->object_type === 'post' ) { $post = \get_post( $indexable->object_id ); $blocks = $this->blocks->get_all_blocks_from_content( $post->post_content ); } $context = $this->context_prototype->of( [ 'indexable' => $indexable, 'blocks' => $blocks, 'post' => $post, 'page_type' => $page_type, ] ); $context->presentation = $this->presentation_memoizer->get( $indexable, $context, $page_type ); $this->cache[ $indexable->id ] = $context; } return $this->cache[ $indexable->id ]; } /** * Clears the memoization of either a specific indexable or all indexables. * * @param Indexable|int|string|null $indexable Optional. The indexable or indexable id to clear the memoization of. * * @return void */ public function clear( $indexable = null ) { if ( $indexable instanceof Indexable ) { unset( $this->cache[ $indexable->id ] ); return; } if ( $indexable !== null ) { unset( $this->cache[ $indexable ] ); return; } $this->cache = []; } } []; $post = null; if ( $indexable->object_type === 'post' ) { $post = \get_post( $indexable->object_id ); $blocks = $this->blocks->get_all_blocks_from_content( $post->post_content ); } $context = $this->context_prototype->of( [ 'indexable' => $indexable, 'blocks' => $blocks, 'post' => $post, 'page_type' => $page_type, ] ); $context->presentation = $this->presentation_memoizer->get( $indexable, $context, $page_type ); $this->cache[ $indexable->id ] = $context; } return $this->cache[ $indexable->id ]; } /** * Clears the memoization of either a specific indexable or all indexables. * * @param Indexable|int|string|null $indexable Optional. The indexable or indexable id to clear the memoization of. * * @return void */ public function clear( $indexable = null ) { if ( $indexable instanceof Indexable ) { unset( $this->cache[ $indexable->id ] ); return; } if ( $indexable !== null ) { unset( $this->cache[ $indexable ] ); return; } $this->cache = []; } } []; $post = null; if ( $indexable->object_type === 'post' ) { $post = \get_post( $indexable->object_id ); $blocks = $this->blocks->get_all_blocks_from_content( $post->post_content ); } $context = $this->context_prototype->of( [ 'indexable' => $indexable, 'blocks' => $blocks, 'post' => $post, 'page_type' => $page_type, ] ); $context->presentation = $this->presentation_memoizer->get( $indexable, $context, $page_type ); $this->cache[ $indexable->id ] = $context; } return $this->cache[ $indexable->id ]; } /** * Clears the memoization of either a specific indexable or all indexables. * * @param Indexable|int|string|null $indexable Optional. The indexable or indexable id to clear the memoization of. * * @return void */ public function clear( $indexable = null ) { if ( $indexable instanceof Indexable ) { unset( $this->cache[ $indexable->id ] ); return; } if ( $indexable !== null ) { unset( $this->cache[ $indexable ] ); return; } $this->cache = []; } } []; $post = null; if ( $indexable->object_type === 'post' ) { $post = \get_post( $indexable->object_id ); $blocks = $this->blocks->get_all_blocks_from_content( $post->post_content ); } $context = $this->context_prototype->of( [ 'indexable' => $indexable, 'blocks' => $blocks, 'post' => $post, 'page_type' => $page_type, ] ); $context->presentation = $this->presentation_memoizer->get( $indexable, $context, $page_type ); $this->cache[ $indexable->id ] = $context; } return $this->cache[ $indexable->id ]; } /** * Clears the memoization of either a specific indexable or all indexables. * * @param Indexable|int|string|null $indexable Optional. The indexable or indexable id to clear the memoization of. * * @return void */ public function clear( $indexable = null ) { if ( $indexable instanceof Indexable ) { unset( $this->cache[ $indexable->id ] ); return; } if ( $indexable !== null ) { unset( $this->cache[ $indexable ] ); return; } $this->cache = []; } } []; $post = null; if ( $indexable->object_type === 'post' ) { $post = \get_post( $indexable->object_id ); $blocks = $this->blocks->get_all_blocks_from_content( $post->post_content ); } $context = $this->context_prototype->of( [ 'indexable' => $indexable, 'blocks' => $blocks, 'post' => $post, 'page_type' => $page_type, ] ); $context->presentation = $this->presentation_memoizer->get( $indexable, $context, $page_type ); $this->cache[ $indexable->id ] = $context; } return $this->cache[ $indexable->id ]; } /** * Clears the memoization of either a specific indexable or all indexables. * * @param Indexable|int|string|null $indexable Optional. The indexable or indexable id to clear the memoization of. * * @return void */ public function clear( $indexable = null ) { if ( $indexable instanceof Indexable ) { unset( $this->cache[ $indexable->id ] ); return; } if ( $indexable !== null ) { unset( $this->cache[ $indexable ] ); return; } $this->cache = []; } } septembre, 2022 - JusteInfos- Information générale

Browsing monthly archive

septembre 2022