*/ public function get_metadata(): array { $this->build_basic(); $this->build_headline(); $this->build_url(); return $this->metadata; } /** * Populates the `headline` field in the metadata object. * * @since 3.4.0 */ private function build_headline(): void { $site_date_format = Utils::get_date_format(); if ( is_year() ) { /* translators: %s: Archive year */ $this->metadata['headline'] = sprintf( __( 'Yearly Archive - %s', 'wp-parsely' ), get_the_time( 'Y' ) ); } elseif ( is_month() ) { /* translators: %s: Archive month, formatted as F, Y */ $this->metadata['headline'] = sprintf( __( 'Monthly Archive - %s', 'wp-parsely' ), get_the_time( 'F, Y' ) ); } elseif ( is_day() ) { /* translators: %s: Archive day, formatted as F jS, Y */ $this->metadata['headline'] = sprintf( __( 'Daily Archive - %s', 'wp-parsely' ), get_the_time( $site_date_format ) ); } elseif ( is_time() ) { $site_time_format = Utils::get_time_format(); /* translators: %s: Archive time, formatted as F jS g:i:s A */ $this->metadata['headline'] = sprintf( __( 'Hourly, Minutely, or Secondly Archive - %s', 'wp-parsely' ), get_the_time( "{$site_date_format} {$site_time_format}" ) ); } } }