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

WordPress Trac noreply at wordpress.org
Thu Nov 14 15:32:51 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:  Posts, Post Types  |     Version:  5.3
 Severity:  normal             |  Resolution:
 Keywords:  needs-patch        |     Focuses:
-------------------------------+-----------------------------

Comment (by Otto42):

 The editable_slug filter in particular is a widely used filter, called by
 multiple locations in WordPress. It's not exclusively for post-slugs, in
 other words.

 A call to apply_filters('editable_slug'...) exists in these locations:

 {{{
 wp-admin\edit-tag-form.php(153): $slug = isset( $tag->slug ) ?
 apply_filters( 'editable_slug', $tag->slug, $tag ) : '';
 wp-admin\includes\class-wp-terms-list-table.php(424): $out .= '<div
 class="slug">' . apply_filters( 'editable_slug', $qe_data->slug, $qe_data
 ) . '</div>';
 wp-admin\includes\class-wp-terms-list-table.php(547): return
 apply_filters( 'editable_slug', $tag->slug, $tag );
 wp-admin\includes\meta-boxes.php(864): $editable_slug = apply_filters(
 'editable_slug', $post->post_name, $post );
 wp-admin\includes\post.php(1372): $uri = apply_filters( 'editable_slug',
 $uri, $post );
 wp-admin\includes\post.php(1380): $permalink         = array( $permalink,
 apply_filters( 'editable_slug', $post->post_name, $post ) );
 wp-admin\includes\template.php(316): '<div class="post_name">' .
 apply_filters( 'editable_slug', $post->post_name, $post ) . '</div>
 }}}

 So, are you sure that the value you are getting is from the same types of
 calls every time? The block editor uses the REST API to make calls, so is
 it possible that you're seeing some other value come through an
 editable_slug filter which you were not expecting?

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


More information about the wp-trac mailing list