Ticket #31568: 31568.2.diff
File 31568.2.diff, 4.4 KB (added by , 10 years ago) |
---|
-
src/wp-admin/includes/meta-boxes.php
661 661 function post_slug_meta_box($post) { 662 662 /** This filter is documented in wp-admin/edit-tag-form.php */ 663 663 ?> 664 <label class="screen-reader-text" for="post_name"><?php _e('Slug') ?></label><input name="post_name" type="text" size="13" id="post_name" value="<?php echo esc_attr( apply_filters( 'editable_slug', $post->post_name ) ); ?>" />664 <label class="screen-reader-text" for="post_name"><?php _e('Slug') ?></label><input name="post_name" type="text" size="13" id="post_name" value="<?php echo esc_attr( apply_filters( 'editable_slug', $post->post_name, $post ) ); ?>" /> 665 665 <?php 666 666 } 667 667 -
src/wp-admin/includes/post.php
1227 1227 } 1228 1228 1229 1229 /** This filter is documented in wp-admin/edit-tag-form.php */ 1230 $uri = apply_filters( 'editable_slug', $uri );1230 $uri = apply_filters( 'editable_slug', $uri, $post ); 1231 1231 if ( !empty($uri) ) 1232 1232 $uri .= '/'; 1233 1233 $permalink = str_replace('%pagename%', "{$uri}%pagename%", $permalink); 1234 1234 } 1235 1235 1236 1236 /** This filter is documented in wp-admin/edit-tag-form.php */ 1237 $permalink = array( $permalink, apply_filters( 'editable_slug', $post->post_name ) );1237 $permalink = array( $permalink, apply_filters( 'editable_slug', $post->post_name, $post ) ); 1238 1238 $post->post_status = $original_status; 1239 1239 $post->post_date = $original_date; 1240 1240 $post->post_name = $original_name; -
src/wp-admin/includes/template.php
359 359 echo ' 360 360 <div class="hidden" id="inline_' . $post->ID . '"> 361 361 <div class="post_title">' . $title . '</div> 362 <div class="post_name">' . apply_filters( 'editable_slug', $post->post_name ) . '</div>362 <div class="post_name">' . apply_filters( 'editable_slug', $post->post_name, $post ) . '</div> 363 363 <div class="post_author">' . $post->post_author . '</div> 364 364 <div class="comment_status">' . esc_html( $post->comment_status ) . '</div> 365 365 <div class="ping_status">' . esc_html( $post->ping_status ) . '</div> -
src/wp-admin/includes/class-wp-terms-list-table.php
368 368 $out .= '<div class="name">' . $qe_data->name . '</div>'; 369 369 370 370 /** This filter is documented in wp-admin/edit-tag-form.php */ 371 $out .= '<div class="slug">' . apply_filters( 'editable_slug', $qe_data->slug ) . '</div>';371 $out .= '<div class="slug">' . apply_filters( 'editable_slug', $qe_data->slug, $qe_data ) . '</div>'; 372 372 $out .= '<div class="parent">' . $qe_data->parent . '</div></div>'; 373 373 374 374 return $out; … … 388 388 */ 389 389 public function column_slug( $tag ) { 390 390 /** This filter is documented in wp-admin/edit-tag-form.php */ 391 return apply_filters( 'editable_slug', $tag->slug );391 return apply_filters( 'editable_slug', $tag->slug, $tag ); 392 392 } 393 393 394 394 /** -
src/wp-admin/edit-tag-form.php
97 97 * post URIs and term slugs. 98 98 * 99 99 * @since 2.6.0 100 * @since 4.2.0 The `$tag` parameter was added. 100 101 * 101 102 * @param string $slug The editable slug. Will be either a term slug or post URI depending 102 103 * upon the context in which it is evaluated. 104 * @param object|WP_Post $tag Term or WP_Post object. 103 105 */ 104 $slug = isset( $tag->slug ) ? apply_filters( 'editable_slug', $tag->slug ) : '';106 $slug = isset( $tag->slug ) ? apply_filters( 'editable_slug', $tag->slug, $tag ) : ''; 105 107 ?> 106 108 <td><input name="slug" id="slug" type="text" value="<?php echo esc_attr( $slug ); ?>" size="40" /> 107 109 <p class="description"><?php _e('The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></p></td>