Make WordPress Core

Changeset 47203


Ignore:
Timestamp:
02/07/2020 05:31:52 PM (4 years ago)
Author:
johnbillion
Message:

Posts, Post Types: Introduce a filter which allows the addition of __trashed suffixes on post slugs to be skipped.

Fixes #46433

File:
1 edited

Legend:

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

    r47196 r47203  
    38443844    // If a trashed post has the desired slug, change it and let this post have it.
    38453845    if ( 'trash' !== $post_status && $post_name ) {
    3846         wp_add_trashed_suffix_to_post_name_for_trashed_posts( $post_name, $post_ID );
     3846        /**
     3847         * Filters whether or not to add a `__trashed` suffix to trashed posts that match the name of the updated post.
     3848         *
     3849         * @since 5.4.0
     3850         *
     3851         * @param bool   $add_trashed_suffix Whether to attempt to add the suffix.
     3852         * @param string $post_name          The name of the post being updated.
     3853         * @param int    $post_ID            Post ID.
     3854         */
     3855        $add_trashed_suffix = apply_filters( 'add_trashed_suffix_to_trashed_posts', true, $post_name, $post_ID );
     3856
     3857        if ( $add_trashed_suffix ) {
     3858            wp_add_trashed_suffix_to_post_name_for_trashed_posts( $post_name, $post_ID );
     3859        }
    38473860    }
    38483861
Note: See TracChangeset for help on using the changeset viewer.