been made yet. */ protected function get_unindexed_post_type_archives( $limit = false ) { $post_types_with_archive_pages = $this->get_post_types_with_archive_pages(); $indexed_post_types = $this->get_indexed_post_type_archives(); $unindexed_post_types = \array_diff( $post_types_with_archive_pages, $indexed_post_types ); if ( $limit ) { return \array_slice( $unindexed_post_types, 0, $limit ); } return $unindexed_post_types; } /** * Returns the names of all the post types that have archive pages. * * @return array The list of names of all post types that have archive pages. */ protected function get_post_types_with_archive_pages() { // We only want to index archive pages of public post types that have them. $post_types_with_archive = $this->post_type->get_indexable_post_archives(); // We only need the post type names, not the objects. $post_types = []; foreach ( $post_types_with_archive as $post_type_with_archive ) { $post_types[] = $post_type_with_archive->name; } return $post_types; } /** * Retrieves the list of post type names for which an archive indexable exists. * * @return array The list of names of post types with unindexed archive pages. */ protected function get_indexed_post_type_archives() { $results = $this->repository->query() ->select( 'object_sub_type' ) ->where( 'object_type', 'post-type-archive' ) ->where_equal( 'version', $this->version ) ->find_array(); if ( $results === false ) { return []; } $callback = static function ( $result ) { return $result['object_sub_type']; }; return \array_map( $callback, $results ); } /** * Returns a limited number of unindexed posts. * * @param int $limit Limit the maximum number of unindexed posts that are counted. * * @return int|false The limited number of unindexed posts. False if the query fails. */ public function get_limited_unindexed_count( $limit ) { return $this->get_total_unindexed( $limit ); } } Au carrefour du terroir - Voix du Planteur| Le monde agricole à votre portée en un clic

Browsing tag

Au carrefour du terroir