WordPress.org

Make WordPress Core

Changeset 15831


Ignore:
Timestamp:
10/18/2010 11:24:29 AM (8 years ago)
Author:
dd32
Message:

Save _wp_old_slug for all published post_type's, brings old-slug redirection to Posts and CPT's. See #15140

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/post.php

    r15819 r15831  
    38123812
    38133813/**
    3814  * Checked for changed slugs for published posts and save old slug.
    3815  *
    3816  * The function is used along with form POST data. It checks for the wp-old-slug
    3817  * POST field. Will only be concerned with published posts and the slug actually
    3818  * changing.
     3814 * Checked for changed slugs for published post objects and save the old slug.
     3815 *
     3816 * The function is used when a post object of any type is updated,
     3817 * by comparing the current and previous post objects.
    38193818 *
    38203819 * If the slug was changed and not already part of the old slugs then it will be
     
    38223821 * post.
    38233822 *
    3824  * The most logically usage of this function is redirecting changed posts, so
     3823 * The most logically usage of this function is redirecting changed post objects, so
    38253824 * that those that linked to an changed post will be redirected to the new post.
    38263825 *
     
    38283827 *
    38293828 * @param int $post_id Post ID.
     3829 * @param object $post The Post Object
     3830 * @param object $post_before The Previous Post Object
    38303831 * @return int Same as $post_id
    38313832 */
     
    38353836        return;
    38363837
    3837     // we're only concerned with published posts
    3838     if ( $post->post_status != 'publish' || $post->post_type != 'post' )
     3838    // we're only concerned with published objects
     3839    if ( $post->post_status != 'publish' )
    38393840        return;
    38403841
Note: See TracChangeset for help on using the changeset viewer.