/** * Returns a list of date archives that can be included. * * @since 4.1.3 * * @return array The date archives. */ public function archives() { $result = aioseo()->core->db ->start( 'posts', false, 'SELECT DISTINCT' ) ->select( 'YEAR(post_date) AS year, MONTH(post_date) AS month' ) ->where( 'post_type', 'post' ) ->where( 'post_status', 'publish' ) ->whereRaw( "post_password=''" ) ->orderBy( '`year` DESC, `month` DESC' ) ->run() ->result(); $dates = []; foreach ( $result as $date ) { $dates[ $date->year ][ $date->month ] = 1; } return $dates; } /** * Returns the publish date for a given term. * This is the publish date of the oldest post that is assigned to the term. * * @since 4.1.3 * * @param int $termId The term ID. * @return int The publish date timestamp. */ public function getTermPublishDate( $termId ) { $termRelationshipsTable = aioseo()->core->db->db->prefix . 'term_relationships'; $post = aioseo()->core->db ->start( 'posts as p' ) ->select( 'MIN(`p`.`post_date_gmt`) as publish_date' ) ->whereRaw( " ( `p`.`ID` IN ( SELECT `tr`.`object_id` FROM `$termRelationshipsTable` as tr WHERE `tr`.`term_taxonomy_id` = '$termId' ) )" ) ->run() ->result(); return ! empty( $post[0]->publish_date ) ? strtotime( $post[0]->publish_date ) : 0; } /** * Returns a comma-separated string of excluded object IDs. * * @since 4.1.3 * * @param array $attributes The attributes. * @param boolean $posts Whether the objects are posts. * @return string The excluded object IDs. */ private function getExcludedObjects( $attributes, $posts = true ) { $excludedObjects = $posts ? aioseo()->sitemap->helpers->excludedPosts() : aioseo()->sitemap->helpers->excludedTerms(); $key = $posts ? 'excluded_posts' : 'excluded_terms'; if ( ! empty( $attributes[ $key ] ) ) { $ids = explode( ',', $excludedObjects ); $extraIds = []; if ( is_array( $attributes[ $key ] ) ) { $extraIds = $attributes[ $key ]; } if ( is_string( $attributes[ $key ] ) ) { $extraIds = array_map( 'trim', explode( ',', $attributes[ $key ] ) ); } $ids = array_filter( array_merge( $ids, $extraIds ), 'is_numeric' ); $excludedObjects = esc_sql( implode( ', ', $ids ) ); } return $excludedObjects; } }
Fatal error: Uncaught Error: Class "AIOSEO\Plugin\Common\Sitemap\Html\Query" not found in /htdocs/wp-content/plugins/all-in-one-seo-pack/app/Common/Sitemap/Html/Frontend.php:39 Stack trace: #0 /htdocs/wp-content/plugins/all-in-one-seo-pack/app/Common/Sitemap/Html/Sitemap.php(55): AIOSEO\Plugin\Common\Sitemap\Html\Frontend->__construct() #1 /htdocs/wp-content/plugins/all-in-one-seo-pack/app/AIOSEO.php(312): AIOSEO\Plugin\Common\Sitemap\Html\Sitemap->__construct() #2 /htdocs/wp-content/plugins/all-in-one-seo-pack/app/AIOSEO.php(97): AIOSEO\Plugin\AIOSEO->load() #3 /htdocs/wp-content/plugins/all-in-one-seo-pack/app/AIOSEO.php(76): AIOSEO\Plugin\AIOSEO->init() #4 /htdocs/wp-content/plugins/all-in-one-seo-pack/app/AIOSEO.php(414): AIOSEO\Plugin\AIOSEO::instance() #5 /htdocs/wp-content/plugins/all-in-one-seo-pack/all_in_one_seo_pack.php(96): aioseo() #6 /htdocs/wp-settings.php(522): include_once('/htdocs/wp-cont...') #7 /htdocs/wp-config.php(98): require_once('/htdocs/wp-sett...') #8 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #9 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #10 /htdocs/index.php(17): require('/htdocs/wp-blog...') #11 {main} thrown in /htdocs/wp-content/plugins/all-in-one-seo-pack/app/Common/Sitemap/Html/Frontend.php on line 39