wp_unique_post_slug_is_bad_attachment_slug

wp_unique_post_slug_is_bad_attachment_slug

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: wordpress-6.7.2

apply_filters('wp_unique_post_slug_is_bad_attachment_slug') is found 1 times:

  • /wp-includes/post.php line 5377
    5373
    5374
    5375
    5376
    5377
    5378
    5379
    5380
    5381
    5382
    5383
    *
     * @param bool   $bad_slug Whether the slug would be bad as an attachment slug.
     * @param string $slug     The post slug.
     */
    $is_bad_attachment_slug = apply_filters( 'wp_unique_post_slug_is_bad_attachment_slug', false, $slug );
     
    if ( $post_name_check
        || in_array( $slug, $feeds, true ) || 'embed' === $slug
        || $is_bad_attachment_slug
    ) {
        $suffix = 2;