[wp-trac] [WordPress Trac] #48622: `editable_slug` filter does not pass the correct value

WordPress Trac noreply at wordpress.org
Thu Nov 14 05:23:52 UTC 2019


#48622: `editable_slug` filter does not pass the correct value
--------------------------+----------------------------
 Reporter:  noisysocks    |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Future Release
Component:  General       |    Version:  5.3
 Severity:  normal        |   Keywords:  needs-patch
  Focuses:                |
--------------------------+----------------------------
 ''Originally reported in
 https://github.com/WordPress/gutenberg/issues/15802.''

 **Describe the bug**
 When using the block editor, the 1st param $post_name passed to the
 editable_slug filter hook is not the same as the classic editor, which is
 the expected one.

 **To reproduce**
 1. Install Classic Editor to switch from block to classic
 2. Create a draft post with title "the post title" and slug "this-is-the-
 slug"
 3. Create a muplugin with: add_filter( 'editable_slug', function(
 $post_name ) { wp_die( $post_name ); } );
 4. Refresh your edit page

 **Expected behavior**
 With the classic editor you should have "this-is-the-slug"
 but when using block editor you have "the-post-title", sounds like the
 post_title sanitize with sanitize_title, it should be the real post_,name
 like classic is doing.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/48622>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list