editable_slug

Filters the editable slug.

Description

apply_filters( 'editable_slug', (string) $tag_slug, (object|WP_Post) $tag ); 

Note: This is a multi-use hook in that it is leveraged both for editable post URIs and term slugs.

Parameters (2)

0. $tag_slug (string)
The editable slug. Will be either a term slug or post URI depending upon the context in which it is evaluated.
1. $tag (object|WP_Post)
Term or WP_Post object.

Usage

To run the hook, copy the example below.
  1. $tag_slug = apply_filters( 'editable_slug', $tag_slug, $tag ); 
  2.  
  3. if ( !empty( $tag_slug ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the editable_slug callback 
  2. function filter_editable_slug( $tag_slug, $tag ) { 
  3. // make filter magic happen here... 
  4. return $tag_slug
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'editable_slug', 'filter_editable_slug', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'editable_slug', 'filter_editable_slug', 10, 2 ); 

Defined (9)

The filter is defined in the following location(s).

/wp-admin/edit-tag-form.php  
  1. $slug = isset( $tag->slug ) ? apply_filters( 'editable_slug', $tag->slug, $tag ) : ''; 
/wp-admin/includes/class-wp-terms-list-table.php  
  1. $out .= '<div class="slug">' . apply_filters( 'editable_slug', $qe_data->slug, $qe_data ) . '</div>'; 
  1. return apply_filters( 'editable_slug', $tag->slug, $tag ); 
/wp-admin/includes/meta-boxes.php  
  1. $editable_slug = apply_filters( 'editable_slug', $post->post_name, $post ); 
/wp-admin/includes/post.php  
  1. $uri = apply_filters( 'editable_slug', $uri, $post ); 
  1. $permalink = array( $permalink, apply_filters( 'editable_slug', $post->post_name, $post ) ); 
/wp-admin/includes/template.php  
  1. '<div class="post_name">' . apply_filters( 'editable_slug', $post->post_name, $post ) . '</div> 
/wp-includes/default-filters.php  
  1. add_filter( 'editable_slug', 'urldecode' ); 
  1. add_filter( 'editable_slug', 'esc_textarea' );