: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* @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.
* @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;
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.
* @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.
* Prints scripts or data in the head tag on the front end.
* Fires the wp_footer action.
* See {@see 'wp_footer'}.
* Prints scripts or data before the closing body tag on the front end.
do_action( 'wp_footer' );
* Fires the wp_body_open action.
* See {@see 'wp_body_open'}.
function wp_body_open() {
* Triggered after the opening body tag.
do_action( 'wp_body_open' );
* Displays the links to the general feeds.
* @param array $args Optional arguments.
function feed_links( $args = array() ) {
if ( ! current_theme_supports( 'automatic-feed-links' ) ) {
/* translators: Separator between site name and feed type in feed links. */
'separator' => _x( '»', 'feed link' ),
/* translators: 1: Site title, 2: Separator (raquo). */
'feedtitle' => __( '%1$s %2$s Feed' ),
/* translators: 1: Site 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.
* @param bool $show Whether to display the posts feed link. Default true.
if ( apply_filters( 'feed_links_show_posts_feed', true ) ) {
'<link rel="alternate" type="%s" title="%s" href="%s" />' . "\n",
esc_attr( sprintf( $args['feedtitle'], get_bloginfo( 'name' ), $args['separator'] ) ),
esc_url( get_feed_link() )
* Filters whether to display the comments feed link.
* @param bool $show Whether to display the comments feed link. Default true.
if ( apply_filters( 'feed_links_show_comments_feed', true ) ) {
'<link rel="alternate" type="%s" title="%s" href="%s" />' . "\n",
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.
* @param array $args Optional arguments.
function feed_links_extra( $args = array() ) {
/* translators: Separator between site name and feed type in feed links. */
'separator' => _x( '»', 'feed link' ),
/* translators: 1: Site name, 2: Separator (raquo), 3: Post title. */
'singletitle' => __( '%1$s %2$s %3$s Comments Feed' ),
/* translators: 1: Site name, 2: Separator (raquo), 3: Category name. */
'cattitle' => __( '%1$s %2$s %3$s Category Feed' ),
/* translators: 1: Site name, 2: Separator (raquo), 3: Tag name. */
'tagtitle' => __( '%1$s %2$s %3$s Tag Feed' ),
/* translators: 1: Site name, 2: Separator (raquo), 3: Term name, 4: Taxonomy singular name. */
'taxtitle' => __( '%1$s %2$s %3$s %4$s Feed' ),
/* translators: 1: Site name, 2: Separator (raquo), 3: Author name. */
'authortitle' => __( '%1$s %2$s Posts by %3$s Feed' ),
/* translators: 1: Site name, 2: Separator (raquo), 3: Search query. */
'searchtitle' => __( '%1$s %2$s Search Results for “%3$s” Feed' ),
/* translators: 1: Site name, 2: Separator (raquo), 3: Post type name. */
'posttypetitle' => __( '%1$s %2$s %3$s Feed' ),
$args = wp_parse_args( $args, $defaults );
/** This filter is documented in wp-includes/general-template.php */
$show_comments_feed = apply_filters( 'feed_links_show_comments_feed', true );
* Filters whether to display the post comments feed link.
* This filter allows to enable or disable the feed link for a singular post
* in a way that is independent of {@see 'feed_links_show_comments_feed'}
* (which controls the global comments feed). The result of that filter
* is accepted as a parameter.
* @param bool $show_comments_feed Whether to display the post comments feed link. Defaults to
* the {@see 'feed_links_show_comments_feed'} filter result.
$show_post_comments_feed = apply_filters( 'feed_links_extra_show_post_comments_feed', $show_comments_feed );
if ( $show_post_comments_feed && ( comments_open() || pings_open() || $post->comment_count > 0 ) ) {
the_title_attribute( array( 'echo' => false ) )
$feed_link = get_post_comments_feed_link( $post->ID );
} elseif ( is_post_type_archive() ) {
* Filters whether to display the post type archive feed link.
* @param bool $show Whether to display the post type archive feed link. Default true.
$show_post_type_archive_feed = apply_filters( 'feed_links_extra_show_post_type_archive_feed', true );
if ( $show_post_type_archive_feed ) {
$post_type = get_query_var( 'post_type' );
if ( is_array( $post_type ) ) {
$post_type = reset( $post_type );
$post_type_obj = get_post_type_object( $post_type );
$post_type_obj->labels->name
$href = get_post_type_archive_feed_link( $post_type_obj->name );
} elseif ( is_category() ) {
* Filters whether to display the category feed link.
* @param bool $show Whether to display the category feed link. Default true.
$show_category_feed = apply_filters( 'feed_links_extra_show_category_feed', true );
if ( $show_category_feed ) {
$term = get_queried_object();
$href = get_category_feed_link( $term->term_id );
* Filters whether to display the tag feed link.
* @param bool $show Whether to display the tag feed link. Default true.
$show_tag_feed = apply_filters( 'feed_links_extra_show_tag_feed', true );
$term = get_queried_object();
$href = get_tag_feed_link( $term->term_id );
* Filters whether to display the custom taxonomy feed link.
* @param bool $show Whether to display the custom taxonomy feed link. Default true.
$show_tax_feed = apply_filters( 'feed_links_extra_show_tax_feed', true );
$term = get_queried_object();
$tax = get_taxonomy( $term->taxonomy );
$tax->labels->singular_name
$href = get_term_feed_link( $term->term_id, $term->taxonomy );
} elseif ( is_author() ) {
* Filters whether to display the author feed link.
* @param bool $show Whether to display the author feed link. Default true.
$show_author_feed = apply_filters( 'feed_links_extra_show_author_feed', true );
if ( $show_author_feed ) {
$author_id = (int) get_query_var( 'author' );
get_the_author_meta( 'display_name', $author_id )
$href = get_author_feed_link( $author_id );
} elseif ( is_search() ) {
* Filters whether to display the search results feed link.
* @param bool $show Whether to display the search results feed link. Default true.
$show_search_feed = apply_filters( 'feed_links_extra_show_search_feed', true );
if ( $show_search_feed ) {
get_search_query( false )
$href = get_search_feed_link();
if ( isset( $title ) && isset( $href ) ) {
'<link rel="alternate" type="%s" title="%s" href="%s" />' . "\n",
* Displays the link to the Really Simple Discovery service endpoint.
* @link http://archipelago.phrasewise.com/rsd
'<link rel="EditURI" type="application/rsd+xml" title="RSD" href="%s" />' . "\n",
esc_url( site_url( 'xmlrpc.php?rsd', 'rpc' ) )
* Displays a referrer `strict-origin-when-cross-origin` meta tag.
* Outputs a referrer `strict-origin-when-cross-origin` meta tag that tells the browser not to send
* the full URL as a referrer to other sites when cross-origin assets are loaded.
* Typical usage is as a {@see 'wp_head'} callback:
* add_action( 'wp_head', 'wp_strict_cross_origin_referrer' );
function wp_strict_cross_origin_referrer() {
<meta name='referrer' content='strict-origin-when-cross-origin' />
* Displays site icon meta tags.
* @link https://www.whatwg.org/specs/web-apps/current-work/multipage/links.html#rel-icon HTML5 specification link icon.
function wp_site_icon() {
if ( ! has_site_icon() && ! is_customize_preview() ) {
$icon_32 = get_site_icon_url( 32 );
if ( empty( $icon_32 ) && is_customize_preview() ) {
$icon_32 = '/favicon.ico'; // Serve default favicon URL in customizer so element can be updated for preview.
$meta_tags[] = sprintf( '<link rel="icon" href="%s" sizes="32x32" />', esc_url( $icon_32 ) );
$icon_192 = get_site_icon_url( 192 );
$meta_tags[] = sprintf( '<link rel="icon" href="%s" sizes="192x192" />', esc_url( $icon_192 ) );
$icon_180 = get_site_icon_url( 180 );
$meta_tags[] = sprintf( '<link rel="apple-touch-icon" href="%s" />', esc_url( $icon_180 ) );
$icon_270 = get_site_icon_url( 270 );
$meta_tags[] = sprintf( '<meta name="msapplication-TileImage" content="%s" />', esc_url( $icon_270 ) );
* Filters the site icon meta tags, so plugins can add their own.
* @param string[] $meta_tags Array of Site Icon meta tags.
$meta_tags = apply_filters( 'site_icon_meta_tags', $meta_tags );
$meta_tags = array_filter( $meta_tags );
foreach ( $meta_tags as $meta_tag ) {
* Prints resource hints to browsers for pre-fetching, pre-rendering
* and pre-connecting to websites.
* Gives hints to browsers to prefetch specific pages or render them
* in the background, to perform DNS lookups or to begin the connection
* handshake (DNS, TCP, TLS) in the background.
* These performance improving indicators work by using `<link rel"…">`.
function wp_resource_hints() {
'dns-prefetch' => wp_dependencies_unique_hosts(),
foreach ( $hints as $relation_type => $urls ) {
* Filters domains and URLs for resource hints of the given relation type.
* @since 4.7.0 The `$urls` parameter accepts arrays of specific HTML attributes
* Array of resources and their attributes, or URLs to print for resource hints.
* @type array|string ...$0 {
* Array of resource attributes, or a URL string.
* @type string $href URL to include in resource hints. Required.
* @type string $as How the browser should treat the resource
* (`script`, `style`, `image`, `document`, etc).
* @type string $crossorigin Indicates the CORS policy of the specified resource.
* @type float $pr Expected probability that the resource hint will be used.
* @type string $type Type of the resource (`text/html`, `text/css`, etc).