Opened 6 years ago
Last modified 4 years ago
#43791 new enhancement
Add the call to pingback_url to core instead of themes
Reported by: | joyously | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 4.9.5 |
Component: | Pings/Trackbacks | Keywords: | has-patch needs-testing 2nd-opinion |
Focuses: | Cc: |
Description
The <head>
section contains a lot of <link>
items that WordPress core generates.
Why should themes be responsible for outputting the pingback_url()
<link>
?
The core code should remove this burden from the theme and ensure that it is handled every time and correctly. Currently, the theme needs code like this:
function mytheme_pingback_header() { if ( is_singular() && pings_open() ) { echo '<link rel="pingback" href="', esc_url( get_bloginfo( 'pingback_url' ) ), '">'; } } add_action( 'wp_head', 'mytheme_pingback_header' );
and a lot of themes don't even have it, so then there are core options that don't work correctly. This logic belongs in core.
Attachments (3)
Change History (10)
#3
@
6 years ago
Hello @dshanske,
Can you please share your views about this ticket so I can update patch accordingly.
Thanks
#4
@
6 years ago
- Keywords 2nd-opinion needs-refresh added
It should be get_bloginfo( 'pingback_url' ), not site_url( '/xmlrpc.php' ). That adds the ability to filter the pingback url and redirect it elsewhere. You could, if anyone ever wrote one, delegate pingback handling to a service.
I'm in favor of Core handling this. It never should have been theme territory and your points are all valid. However, this was rejected before my tenure in #10094, so I'm not sure if it would get through now. I think we need to get more consensus on whether this would be even considered for a commit.
#5
@
6 years ago
Hello @dshanske ,
Thanks for your feedback on this ticket. Yeah definitely it should be core territory.
It should be get_bloginfo( 'pingback_url' ), not site_url( '/xmlrpc.php' ).
I also refreshed the patch.
Thanks
Hello @joyously ,
Yeah it should be the part of the core. I have also created a patch (43791.diff) for this enhancement. Must test the patch.
Thanks