When applying the 'editable_slug' filter, add a second param that provides more context.

Props MikeSchinkel, jesin.
Fixes #31568.


git-svn-id: https://develop.svn.wordpress.org/trunk@34319 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor
2015-09-19 05:48:30 +00:00
parent 09e3149b7a
commit 1c5f85e1a4
5 changed files with 14 additions and 10 deletions

View File

@@ -1243,14 +1243,14 @@ function get_sample_permalink($id, $title = null, $name = null) {
}
/** This filter is documented in wp-admin/edit-tag-form.php */
$uri = apply_filters( 'editable_slug', $uri );
$uri = apply_filters( 'editable_slug', $uri, $post );
if ( !empty($uri) )
$uri .= '/';
$permalink = str_replace('%pagename%', "{$uri}%pagename%", $permalink);
}
/** This filter is documented in wp-admin/edit-tag-form.php */
$permalink = array( $permalink, apply_filters( 'editable_slug', $post->post_name ) );
$permalink = array( $permalink, apply_filters( 'editable_slug', $post->post_name, $post ) );
$post->post_status = $original_status;
$post->post_date = $original_date;
$post->post_name = $original_name;