Make WordPress Core

Ticket #45855: 45855.diff

File 45855.diff, 1.1 KB (added by ryan.kanner, 6 years ago)
  • src/wp-includes/post.php

    diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php
    index 8debd3db3b..079013c81f 100644
    a b function check_and_publish_future_post( $post_id ) { 
    41134113 * @return string Unique slug for the post, based on $post_name (with a -1, -2, etc. suffix)
    41144114 */
    41154115function wp_unique_post_slug( $slug, $post_ID, $post_status, $post_type, $post_parent ) {
     4116
     4117        /**
     4118         * Filters the post slug before any processing has happened.
     4119         *
     4120         * @since
     4121         *
     4122         * @param string $slug        The desired slug (post_name).
     4123         * @param int    $post_ID     Post ID.
     4124         * @param string $post_status The status of the post.
     4125         * @param string $post_type   Post type.
     4126         * @param int    $post_parent Post parent ID.
     4127         */
     4128        $slug = apply_filters( 'wp_unique_post_slug_pre', $slug, $post_ID, $post_status, $post_type, $post_parent );
     4129
    41164130        if ( in_array( $post_status, array( 'draft', 'pending', 'auto-draft' ) ) || ( 'inherit' == $post_status && 'revision' == $post_type ) || 'user_request' === $post_type ) {
    41174131                return $slug;
    41184132        }