Opened 8 years ago
Closed 8 years ago
#38202 closed enhancement (fixed)
Allow post object or post id for ping functions
Reported by: | dshanske | Owned by: | pento |
---|---|---|---|
Milestone: | 4.7 | Priority: | low |
Severity: | minor | Version: | |
Component: | Pings/Trackbacks | Keywords: | has-patch has-unit-tests dev-feedback commit |
Focuses: | Cc: |
Description
Suggesting the following functions be updated to accept either a post_ID or a post object
get_pung( int $post_id )
get_to_ping( int $post_id )
do_trackbacks( int $post_id )
Attachments (3)
Change History (23)
This ticket was mentioned in Slack in #core by dshanske. View the logs.
8 years ago
#3
@
8 years ago
- Keywords needs-unit-tests added
- Milestone changed from Awaiting Review to 4.7
Patch looks good, sounds like a great opportunity to add some unit tests though.
#4
follow-up:
↓ 6
@
8 years ago
The @since
comment on do_trackbacks()
is incomplete.
What's the purpose of making this change?
#6
in reply to:
↑ 4
@
8 years ago
Replying to pento:
What's the purpose of making this change?
Most functions in core support poth post objects and IDs nowdays. I especially like that we can get rid of $wpdb
in get_to_ping()
that way.
#7
@
8 years ago
I could use some help with the unit tests. It's something I'm still struggling to learn how to write.
This ticket was mentioned in Slack in #core by jeffpaul. View the logs.
8 years ago
#9
@
8 years ago
- Keywords has-unit-tests added; needs-unit-tests removed
- Owner set to dshanske
- Status changed from new to assigned
#10
@
8 years ago
Added unit tests for the changes to get_to_ping, get_pung, add_ping.
Not sure how to test trackback and pingback sending. I think that is out of scope for this.
#11
@
8 years ago
@dshanske the functions still accept a post_id
, so let's keep the parameter name as $post_id
.
#13
@
8 years ago
Happy to make the change. I thought changing the parameter name to post made it more consistent with other functions that work similarly. But it isn't an issue either way.
#14
@
8 years ago
In pingack it is post_ID, in the others post_id. In the interest of consistency, I changed all of them to post_id.
Add Post Object support to Ping Functions