editable_slug WordPress Filter Hook

The editable_slug hook allows you to modify the post slug before it is saved to the database. This can be useful for customizing the URL structure of your site.

apply_filters( 'editable_slug', string $slug, WP_Term|WP_Post $tag ) #

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.


Top ↑

Parameters

$slug

(string)The editable slug. Will be either a term slug or post URI depending upon the context in which it is evaluated.

$tag

(WP_Term|WP_Post)Term or post object.


Top ↑

Source

File: wp-admin/edit-tag-form.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
4.4.0The $tag parameter was added.
2.6.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.