The 'get_sample_permalink_html' filter​'s second parameter can be a post ID or a post object. This is confusing. We should pass the post ID and post object separately, for consistency with 'get_sample_permalink' filter added in [34309].

Props SergeyBiryukov.	
Fixes #33927.

Built from https://develop.svn.wordpress.org/trunk@34347


git-svn-id: http://core.svn.wordpress.org/trunk@34311 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2015-09-20 03:26:25 +00:00
parent b20e8dbf69
commit 82709c30d9
2 changed files with 8 additions and 6 deletions

View File

@ -1350,13 +1350,15 @@ function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) {
* Filter the sample permalink HTML markup.
*
* @since 2.9.0
* @since 4.4.0 Added `$post` parameter.
*
* @param string $return Sample permalink HTML markup.
* @param int|WP_Post $id Post object or ID.
* @param string $new_title New sample permalink title.
* @param string $new_slug New sample permalink slug.
* @param string $return Sample permalink HTML markup.
* @param int $post_id Post ID.
* @param string $new_title New sample permalink title.
* @param string $new_slug New sample permalink slug.
* @param WP_Post $post Post object.
*/
$return = apply_filters( 'get_sample_permalink_html', $return, $id, $new_title, $new_slug );
$return = apply_filters( 'get_sample_permalink_html', $return, $post->ID, $new_title, $new_slug, $post );
return $return;
}

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.4-alpha-34346';
$wp_version = '4.4-alpha-34347';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.