B B A B XB A B B A 0B XB B B A 0B hB A 5BK 5BK 5BK 8 5BK P 5BK 5BK @ ,BK p5BK P5BK 5BK 5BK D yBK 4BK 4BK 5BK 4BK 4BK 4BK 5BK 4BK 4BK 4BK 4BK 4BK 4BK 4BK 4BK 4BK X4BK 4BK `4BK x4BK 4BK 4BK 4BK 5BK 85BK x5BK @ BK @ S B `5BK x5BK 5BK @ NA 5BK 5BK H5BK @ NA 05BK 5BK @ NA 5BK @ `BK 5BK 5BK 5BK @ NA 85BK @ @BK P5BK `5BK x5BK 5BK 5BK 5BK D @sBK 5BK x5BK H5BK 5BK @ S B P5BK h5BK E З'BK 0{BK x4BK 85BK 4BK @ F 5BK @ H0BK @ mBK @ @A 05BK H5BK `5BK 5BK @ HCK @ hA 5BK 5BK @ BK 5BK 0 5BK P5BK 5BK @ gA h5BK @ @A 5BK @ BK 5BK 5BK 5BK 5BK 5BK @ A 8 5BK @ hA ` 5BK @ CK x 5BK 5BK 5BK @ gA 5BK 5BK 5BK P 5BK 5BK @ 8A H 5BK @ BK @ A 5BK 5BK P5BK 5BK 5BK @ hA 5BK @ XBK 5BK 5BK 5BK @ gA p5BK @ @A 5BK @ hA 5BK 5BK P5BK 5BK 5BK 5BK p 5BK 5BK ` 5BK 85BK @ B h5BK @ BK @ A 5BK 5BK 5BK 5BK 5BK 5BK @ A 0 5BK @ BK @ BK p 5BK 5BK 5BK P5BK @ B 5BK P5BK @5BK @ A p5BK @ BK 5BK @ @BK @ B 5BK 5BK 5BK 5BK 5BK 5BK 05BK @ A h5BK @ \BK 5BK 5BK 5BK @ A st_id The post ID. * @param string $main_taxonomy The main taxonomy. * * @return int|false The ID of the primary term, or `false` if the post ID is invalid. */ private function get_primary_term_id( $post_id, $main_taxonomy ) { $primary_term = $this->primary_term_repository->find_by_post_id_and_taxonomy( $post_id, $main_taxonomy, false ); if ( $primary_term ) { return $primary_term->term_id; } return \get_post_meta( $post_id, WPSEO_Meta::$meta_prefix . 'primary_' . $main_taxonomy, true ); } /** * Removes the primary category. * * @param int $post_id The post id to set primary taxonomy for. * @param string $main_taxonomy Name of the taxonomy that is set to be the primary one. */ private function remove_primary_term( $post_id, $main_taxonomy ) { $primary_term = $this->primary_term_repository->find_by_post_id_and_taxonomy( $post_id, $main_taxonomy, false ); if ( $primary_term ) { $primary_term->delete(); } // Remove it from the post meta. \delete_post_meta( $post_id, WPSEO_Meta::$meta_prefix . 'primary_' . $main_taxonomy ); } /** * Builds the hierarchy for a post. * * @param WP_Post $post The post. */ public function build_post_hierarchy( $post ) { if ( $this->post_type_helper->is_excluded( $post->post_type ) ) { return; } $indexable = $this->indexable_repository->find_by_id_and_type( $post->ID, 'post' ); if ( $indexable instanceof Indexable ) { $this->indexable_hierarchy_builder->build( $indexable ); } } }