Make WordPress Core

Ticket #31568: 31568.diff

File 31568.diff, 4.6 KB (added by MikeSchinkel, 10 years ago)

Patch to add a 2nd parameter to editable_slug filter calls

  • wp-admin/edit-tag-form.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    4444<?php if ( !global_terms_enabled() ) { ?>
    4545                <tr class="form-field">
    4646                        <th scope="row" valign="top"><label for="slug"><?php _ex('Slug', 'Taxonomy Slug'); ?></label></th>
    47                         <td><input name="slug" id="slug" type="text" value="<?php if ( isset( $tag->slug ) ) echo esc_attr(apply_filters('editable_slug', $tag->slug)); ?>" size="40" />
     47                        <td><input name="slug" id="slug" type="text" value="<?php if ( isset( $tag->slug ) ) echo esc_attr(apply_filters('editable_slug', $tag->slug, $tag)); ?>" size="40" />
    4848                        <p class="description"><?php _e('The &#8220;slug&#8221; is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></p></td>
    4949                </tr>
    5050<?php } ?>
  • wp-admin/includes/meta-boxes.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    589589 */
    590590function post_slug_meta_box($post) {
    591591?>
    592 <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) ); ?>" />
     592<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) ); ?>" />
    593593<?php
    594594}
    595595
  • wp-admin/includes/post.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    10401040                $uri = untrailingslashit($uri);
    10411041                $uri = strrev( stristr( strrev( $uri ), '/' ) );
    10421042                $uri = untrailingslashit($uri);
    1043                 $uri = apply_filters( 'editable_slug', $uri );
     1043                $uri = apply_filters( 'editable_slug', $uri, $post );
    10441044                if ( !empty($uri) )
    10451045                        $uri .= '/';
    10461046                $permalink = str_replace('%pagename%', "{$uri}%pagename%", $permalink);
    10471047        }
    10481048
    1049         $permalink = array($permalink, apply_filters('editable_slug', $post->post_name));
     1049        $permalink = array($permalink, apply_filters('editable_slug', $post->post_name, $post));
    10501050        $post->post_status = $original_status;
    10511051        $post->post_date = $original_date;
    10521052        $post->post_name = $original_name;
  • wp-admin/includes/class-wp-terms-list-table.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    268268                $out .= $this->row_actions( $actions );
    269269                $out .= '<div class="hidden" id="inline_' . $qe_data->term_id . '">';
    270270                $out .= '<div class="name">' . $qe_data->name . '</div>';
    271                 $out .= '<div class="slug">' . apply_filters( 'editable_slug', $qe_data->slug ) . '</div>';
     271                $out .= '<div class="slug">' . apply_filters( 'editable_slug', $qe_data->slug, $qe_data ) . '</div>';
    272272                $out .= '<div class="parent">' . $qe_data->parent . '</div></div>';
    273273
    274274                return $out;
     
    279279        }
    280280
    281281        function column_slug( $tag ) {
    282                 return apply_filters( 'editable_slug', $tag->slug );
     282                return apply_filters( 'editable_slug', $tag->slug, $tag );
    283283        }
    284284
    285285        function column_posts( $tag ) {
  • wp-admin/includes/template.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    295295        echo '
    296296<div class="hidden" id="inline_' . $post->ID . '">
    297297        <div class="post_title">' . $title . '</div>
    298         <div class="post_name">' . apply_filters('editable_slug', $post->post_name) . '</div>
     298        <div class="post_name">' . apply_filters('editable_slug', $post->post_name, $post) . '</div>
    299299        <div class="post_author">' . $post->post_author . '</div>
    300300        <div class="comment_status">' . esc_html( $post->comment_status ) . '</div>
    301301        <div class="ping_status">' . esc_html( $post->ping_status ) . '</div>