diff --git wp-includes/post.php wp-includes/post.php
index d033172..72f6dc3 100644
|
|
function wp_unique_post_slug( $slug, $post_ID, $post_status, $post_type, $post_p |
3572 | 3572 | if ( in_array( $post_status, array( 'draft', 'pending', 'auto-draft' ) ) || ( 'inherit' == $post_status && 'revision' == $post_type ) ) |
3573 | 3573 | return $slug; |
3574 | 3574 | |
| 3575 | /** |
| 3576 | * Filters pre post slug. |
| 3577 | * |
| 3578 | * @since 4.6.0 |
| 3579 | * |
| 3580 | * @param string|bool $pre Unique slug for the post, based on $post_name (with a -1, -2, etc. suffix) |
| 3581 | * @param string $slug The desired slug (post_name). |
| 3582 | * @param int $post_ID Post ID. |
| 3583 | * @param string $post_status No uniqueness checks are made if the post is still draft or pending. |
| 3584 | * @param string $post_type Post type. |
| 3585 | * @param int $post_parent Post parent ID. |
| 3586 | */ |
| 3587 | $pre = apply_filters( 'pre_unique_post_slug', false, $slug, $post_ID, $post_status, $post_type, $post_parent ); |
| 3588 | if ( false !== $pre ) { |
| 3589 | return $pre; |
| 3590 | } |
| 3591 | |
3575 | 3592 | global $wpdb, $wp_rewrite; |
3576 | 3593 | |
3577 | 3594 | $original_slug = $slug; |
diff --git wp-includes/taxonomy.php wp-includes/taxonomy.php
index 104a4af..4a0460f 100644
|
|
function wp_unique_term_slug( $slug, $term ) { |
2709 | 2709 | $needs_suffix = false; |
2710 | 2710 | } |
2711 | 2711 | |
| 2712 | /** |
| 2713 | * Filters pre term slug. |
| 2714 | * |
| 2715 | * @since 4.6.0 |
| 2716 | * |
| 2717 | * @param string|bool $pre Unique slug for the post, based on $post_name (with a -1, -2, etc. suffix) |
| 2718 | * @param string $slug Unique term slug. |
| 2719 | * @param WP_Term $term Term object. |
| 2720 | */ |
| 2721 | $pre = apply_filters( 'pre_unique_term_slug', false, $slug, $term ); |
| 2722 | if ( false !== $pre ) { |
| 2723 | return $pre; |
| 2724 | } |
| 2725 | |
2712 | 2726 | /* |
2713 | 2727 | * If the taxonomy supports hierarchy and the term has a parent, make the slug unique |
2714 | 2728 | * by incorporating parent slugs. |