* @param int $post_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. * * @return void */ 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. * * @return void */ 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 ); } } } https://www.praxis-dr-guenther.de/post-sitemap.xml 2021-04-04T13:12:54+00:00 https://www.praxis-dr-guenther.de/page-sitemap.xml 2024-09-24T19:03:48+00:00 https://www.praxis-dr-guenther.de/service-sitemap.xml 2021-05-04T21:13:51+00:00 https://www.praxis-dr-guenther.de/ic_doctor-sitemap.xml 2019-07-19T03:16:16+00:00 https://www.praxis-dr-guenther.de/mp-event-sitemap.xml 2019-07-02T03:55:50+00:00 https://www.praxis-dr-guenther.de/mp-column-sitemap.xml 2019-07-02T02:41:17+00:00 https://www.praxis-dr-guenther.de/ic_mega_menu-sitemap.xml 2019-07-22T02:07:05+00:00 https://www.praxis-dr-guenther.de/category-sitemap.xml 2021-04-04T13:12:54+00:00 https://www.praxis-dr-guenther.de/post_tag-sitemap.xml 2019-06-11T08:16:33+00:00 https://www.praxis-dr-guenther.de/testimonial_category-sitemap.xml 2019-06-25T02:46:31+00:00 https://www.praxis-dr-guenther.de/ic_doctor_location-sitemap.xml 2019-07-19T03:16:16+00:00 https://www.praxis-dr-guenther.de/ic_doctor_service-sitemap.xml 2019-07-19T03:16:16+00:00 https://www.praxis-dr-guenther.de/mp-event_category-sitemap.xml 2019-07-02T03:55:50+00:00 https://www.praxis-dr-guenther.de/author-sitemap.xml 2023-06-16T14:07:14+00:00