public function is_post_type_active_and_query_based($post_type);
/** * Filters the post type link URL and returns a query-based representation, if set for the according post type. * * @since 3.0.0 * @wp-hook post_type_link * * @param string $post_link Post URL. * @param WP_Post $post Post object. * * @return string The (filtered) post type link URL. */ public function unprettify_permalink($post_link, WP_Post $post) { if (!$this->post_type_repository->is_post_type_active_and_query_based($post->post_type)) { return $post_link; } $post_type = get_post_type_object($post->post_type); if ($post_type->query_var && !$this->is_draft_or_pending($post)) { $args = [$post_type->query_var => $post->post_name]; } else { $args = ['p' => $post->ID]; } return site_url(add_query_arg($args, '')); }