apply_filters( 'editable_slug', string $slug, WP_Term|WP_Post $tag )
- Since
- 2.6.0, 4.4.0
Filters the editable slug for a post or term.
Description
Note: This is a multi-use hook in that it is leveraged both for editable post URIs and term slugs.
Compatibility
- WordPress
- since 4.4.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Parameters
$slugstring- The editable slug. Will be either a term slug or post URI depending upon the context in which it is evaluated.
$tagWP_Term|WP_Post- Term or post object.
Where this hook fires · 7
wp-admin/edit-tag-form.php:170file scopewp-admin/includes/class-wp-terms-list-table.php:435WP_Terms_List_Table::column_name()wp-admin/includes/class-wp-terms-list-table.php:588WP_Terms_List_Table::column_slug()wp-admin/includes/meta-boxes.php:938post_slug_meta_box()wp-admin/includes/post.php:1512get_sample_permalink()wp-admin/includes/post.php:1520get_sample_permalink()wp-admin/includes/template.php:323get_inline_data()
Source code
* @since 4.4.0 The `$tag` parameter was added. * * @param string $slug The editable slug. Will be either a term slug or post URI depending * upon the context in which it is evaluated. * @param WP_Term|WP_Post $tag Term or post object. */ $slug = isset( $tag->slug ) ? apply_filters( 'editable_slug', $tag->slug, $tag ) : ''; ?> <td><input name="slug" id="slug" type="text" value="<?php echo esc_attr( $slug ); ?>" size="40" aria-describedby="slug-description" /> <p class="description" id="slug-description"><?php echo $tax->labels->slug_field_description; ?></p></td> </tr><?php if ( is_taxonomy_hierarchical( $taxonomy ) ) : ?> <tr class="form-field term-parent-wrap">Changelog
Introduced in 2.6.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
4.4.0
The
$tag parameter was added.from the docblock2.6.0
Introduced.from the docblock
About this page
- Parsed data
- Generated from the wordpress-develop 7.0.4 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.