Skip to content

Commit beec383

Browse files
committed
Improve docblocks for ping environment functions
1 parent d048fba commit beec383

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/wp-includes/comment.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3214,8 +3214,9 @@ function wp_disable_outgoing_pings_for_environment() {
32143214
/**
32153215
* Rejects incoming trackbacks in non-production environments.
32163216
*
3217-
* Hooked to `pre_trackback_post` which fires before the trackback is processed.
3218-
* Sends an error response and exits if pings are disabled for the environment.
3217+
* Hooked to `pre_trackback_post` which fires in `wp-trackback.php` before the
3218+
* trackback is processed. Calls `trackback_response()` which sends an XML error
3219+
* response and terminates the request.
32193220
*
32203221
* @since 6.9.0
32213222
* @access private
@@ -3225,9 +3226,7 @@ function wp_disable_outgoing_pings_for_environment() {
32253226
*/
32263227
function wp_disable_trackback_for_environment( $post_id, $trackback_url ) {
32273228
if ( wp_should_disable_pings_for_environment() ) {
3228-
if ( function_exists( 'trackback_response' ) ) {
3229-
trackback_response( 1, __( 'Sorry, trackbacks are closed for this item.' ) );
3230-
}
3229+
trackback_response( 1, __( 'Sorry, trackbacks are closed for this item.' ) );
32313230
}
32323231
}
32333232

@@ -3237,8 +3236,8 @@ function wp_disable_trackback_for_environment( $post_id, $trackback_url ) {
32373236
* @since 6.9.0
32383237
* @access private
32393238
*
3240-
* @param array $methods Associative array of XML-RPC methods.
3241-
* @return array Modified associative array of XML-RPC methods.
3239+
* @param string[] $methods An array of XML-RPC methods, keyed by their methodName.
3240+
* @return string[] Modified array of XML-RPC methods.
32423241
*/
32433242
function wp_disable_xmlrpc_pingback_for_environment( $methods ) {
32443243
if ( wp_should_disable_pings_for_environment() ) {

0 commit comments

Comments
 (0)