WordPress.org

Make WordPress Core

Opened 3 years ago

Last modified 7 months ago

#38618 new feature request

wp_description() and description-tag

Reported by: henry.wright Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: General Keywords: 2nd-opinion
Focuses: Cc:
PR Number:

Description

The wp_title() function is used by the title-tag theme feature to output specific page titles.

Ref https://developer.wordpress.org/reference/functions/wp_title/

What are your thoughts on having something like this for the meta description?

Change History (2)

#1 @desrosj
7 months ago

  • Component changed from Themes to General
  • Keywords 2nd-opinion added
  • Version 4.6.1 deleted

Thanks for this, @henrywright!

In 4.1, the title-tag theme support was introduced (see #18548). This feature, if a theme opted in, would eliminate the need to call wp_title(). Instead, WordPress would automatically output the <title> tag using wp_get_document_title().

There was an attempt to deprecate the wp_title() function [35294] in favor of the more flexible wp_get_document_title() and this new approach, but this was ultimately reverted (see [35624]).

With this in mind, I would not be in favor of a wp_title() counterpart, but would not be opposed to wp_get_document_description() counterpart to standardize the description tag in a similar manner. But, I also don't feel strongly that Core should include this, so going to leave this for a second opinion.

#2 @henry.wright
7 months ago

Thanks for explaining @desrosj. Although historically a document description has been plugin territory, wp_get_document_description() would be a nice introduction in my view. I can see it being useful when theming.

Note: See TracTickets for help on using tickets.