Filter hook 'editable_slug'

in WP Core File wp-admin/includes/template.php at line 323

View Source

editable_slug

Filter Hook
Description
Adds hidden fields with the data for use in the inline editor for posts and pages.

Hook Information

File Location wp-admin/includes/template.php View on GitHub
Hook Type Filter
Line Number 323

Hook Parameters

Type Name Description
WP_Post $post Post object.

Usage Examples

Basic Usage
<?php
// Hook into editable_slug
add_filter('editable_slug', 'my_custom_filter', 10, 1);

function my_custom_filter($post) {
    // Your custom filtering logic here
    return $post;
}

Source Code Context

wp-admin/includes/template.php:323 - How this hook is used in WordPress core
<?php
 318  
 319  	echo '
 320  <div class="hidden" id="inline_' . $post->ID . '">
 321  	<div class="post_title">' . $title . '</div>' .
 322  	/** This filter is documented in wp-admin/edit-tag-form.php */
 323  	'<div class="post_name">' . apply_filters( 'editable_slug', $post->post_name, $post ) . '</div>
 324  	<div class="post_author">' . $post->post_author . '</div>
 325  	<div class="comment_status">' . esc_html( $post->comment_status ) . '</div>
 326  	<div class="ping_status">' . esc_html( $post->ping_status ) . '</div>
 327  	<div class="_status">' . esc_html( $post->post_status ) . '</div>
 328  	<div class="jj">' . mysql2date( 'd', $post->post_date, false ) . '</div>

PHP Documentation

<?php
/**
 * Adds hidden fields with the data for use in the inline editor for posts and pages.
 *
 * @since 2.7.0
 *
 * @param WP_Post $post Post object.
 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-admin/includes/template.php
Related Hooks

Related hooks will be displayed here in future updates.