Opened 11 months ago
Last modified 11 months ago
#6570 new enhancement
Add full function reference to og:title meta head for code reference pages
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Component: | Developer Hub | Keywords: | close 2nd-opinion |
Cc: |
Description
Currently a search on Google for a code reference such as a 'get_meta_post' returns the code reference page for that function, which has the its og:title meta head set to,
get_post_meta() | Function | WordPress Developer Resources
It would be very useful to add the full function reference,
get_post_meta( int $post_id, string $key = "", bool $single = false ): mixed | Function | WordPress Developer Resources
as it would enable a quick reference without having to actually open the page.
I find myself forgetting some function variables, or their order, and having this information right there in the Google search results would be very handy.
Change History (2)
Note: See
TracTickets for help on using
tickets.
Unfortunately titles displayed in search engines are limited in characters, you can kind of see this in action if you search Google for
WP_REST_Application_Passwords_Controller
where you'll find that it discards the actual<title>
&og:title
and goes for the<h1>
instead.The description shown is also character limited, ~130char as in the example of
register_block_script_handle
, which if the function syntax was added, would leave little room for an actual human-readable description (and I honestly believe Search Engines would internally decide that code isn't human readable, so isn't a good result, and so would source it from elsewhere on the page, like the above<h1>
example).I don't really see this as being a viable change.