Opened 8 years ago
Last modified 4 months ago
#43791 new enhancement
Add the call to pingback_url to core instead of themes
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal |
| Severity: | normal | Version: | 4.9.5 |
| Component: | Pings/Trackbacks | Keywords: | has-patch 2nd-opinion needs-refresh |
| 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 (11)
#3
@
8 years ago
Hello @dshanske,
Can you please share your views about this ticket so I can update patch accordingly.
Thanks
#4
@
8 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
@
8 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
This ticket was mentioned in Slack in #core by joyously. View the logs.
5 years ago
#8
@
4 months ago
- Keywords needs-refresh added; needs-testing removed
I attempted to apply the patch (43791_2.diff) against current trunk (7.0-alpha).
Patch results:
- wp-includes/default-filters.php → hunk failed (.rej created)
- wp-includes/general-template.php → hunk failed (.rej created)
The patch does not apply cleanly, so testing is not currently possible.
Since the patch can’t be applied, keeping needs-testing is not meaningful at this stage. The patch should be refreshed to match current trunk first.
Removing needs-testing and adding needs-refresh. Testing can continue once an updated patch is available.
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