From 21bd2da5b7a599906227f4eef5b38207b4abd129 Mon Sep 17 00:00:00 2001 From: mark kaplun Date: Fri, 12 Oct 2018 19:48:11 +0300 Subject: [PATCH] Misc deprecations of pingback and trackback #36 --- src/wp-admin/includes/post.php | 3 +-- src/wp-includes/class-wp-query.php | 1 + src/wp-includes/comment.php | 37 +--------------------------- src/wp-includes/default-filters.php | 2 -- src/wp-includes/general-template.php | 4 --- 5 files changed, 3 insertions(+), 44 deletions(-) diff --git a/src/wp-admin/includes/post.php b/src/wp-admin/includes/post.php index b54cbd9d77f6..e84f2ce293ea 100644 --- a/src/wp-admin/includes/post.php +++ b/src/wp-admin/includes/post.php @@ -48,8 +48,7 @@ function _wp_translate_postdata( $update = false, $post_data = null ) { if ( isset( $post_data['parent_id'] ) ) $post_data['post_parent'] = (int) $post_data['parent_id']; - if ( isset($post_data['trackback_url']) ) - $post_data['to_ping'] = ''; + $post_data['to_ping'] = ''; $post_data['user_ID'] = get_current_user_id(); diff --git a/src/wp-includes/class-wp-query.php b/src/wp-includes/class-wp-query.php index aa207a5f2d58..584c80c3725c 100644 --- a/src/wp-includes/class-wp-query.php +++ b/src/wp-includes/class-wp-query.php @@ -311,6 +311,7 @@ class WP_Query { /** * Signifies whether the current query is for trackback endpoint call. + * Left in calmPress for backward compatibility should never be true. * * @since 1.5.0 * @var bool diff --git a/src/wp-includes/comment.php b/src/wp-includes/comment.php index 41d78e2823c2..d007730aa8c0 100644 --- a/src/wp-includes/comment.php +++ b/src/wp-includes/comment.php @@ -2407,12 +2407,8 @@ function wp_update_comment_count_now($post_id) { return true; } -// -// Ping and trackback functions. -// - /** - * Perform all pingbacks, enclosures, trackbacks, and send to pingback services. + * Perform all enclosures. * * @since 2.1.0 * @@ -2428,37 +2424,6 @@ function do_all_pings() { } } -/** - * Default filter attached to pingback_ping_source_uri to validate the pingback's Source URI - * - * @since 3.5.1 - * @see wp_http_validate_url() - * - * @param string $source_uri - * @return string - */ -function pingback_ping_source_uri( $source_uri ) { - return (string) wp_http_validate_url( $source_uri ); -} - -/** - * Default filter attached to xmlrpc_pingback_error. - * - * Returns a generic pingback error code unless the error code is 48, - * which reports that the pingback is already registered. - * - * @since 3.5.1 - * @link https://www.hixie.ch/specs/pingback/pingback#TOC3 - * - * @param IXR_Error $ixr_error - * @return IXR_Error - */ -function xmlrpc_pingback_error( $ixr_error ) { - if ( $ixr_error->code === 48 ) - return $ixr_error; - return new IXR_Error( 0, '' ); -} - // // Cache // diff --git a/src/wp-includes/default-filters.php b/src/wp-includes/default-filters.php index 7c07a6953f35..77626b857637 100644 --- a/src/wp-includes/default-filters.php +++ b/src/wp-includes/default-filters.php @@ -213,8 +213,6 @@ add_filter( 'editable_slug', 'urldecode' ); add_filter( 'editable_slug', 'esc_textarea' ); add_filter( 'nav_menu_meta_box_object', '_wp_nav_menu_meta_box_object' ); -add_filter( 'pingback_ping_source_uri', 'pingback_ping_source_uri' ); -add_filter( 'xmlrpc_pingback_error', 'xmlrpc_pingback_error' ); add_filter( 'title_save_pre', 'trim' ); add_action( 'transition_comment_status', '_clear_modified_cache_on_transition_comment_status', 10, 2 ); diff --git a/src/wp-includes/general-template.php b/src/wp-includes/general-template.php index a9976e11d3b7..58a7d47af249 100644 --- a/src/wp-includes/general-template.php +++ b/src/wp-includes/general-template.php @@ -607,7 +607,6 @@ function bloginfo( $show = '' ) { * will take precedence over this value * - 'template_url' / 'template_directory' - URL of the active theme's directory. An active * child theme will NOT take precedence over this value - * - 'pingback_url' - The pingback XML-RPC file URL (xmlrpc.php) * - 'atom_url' - The Atom feed URL (/feed/atom) * - 'rdf_url' - The RDF/RSS 1.0 feed URL (/feed/rfd) * - 'rss_url' - The RSS 0.92 feed URL (/feed/rss) @@ -650,9 +649,6 @@ function get_bloginfo( $show = '', $filter = 'raw' ) { case 'comments_rss2_url': $output = get_feed_link('comments_rss2'); break; - case 'pingback_url': - $output = site_url( 'xmlrpc.php' ); - break; case 'stylesheet_url': $output = get_stylesheet_uri(); break;