| | 3688 | /** |
| | 3689 | * Filter whether the post slug can be numeric. |
| | 3690 | * |
| | 3691 | * @since 4.2.0 |
| | 3692 | * |
| | 3693 | * @param bool $numeric_slugs Whether numeric slugs are allowed. |
| | 3694 | * @param string $slug The post slug. |
| | 3695 | * @param string $post_type Post type. |
| | 3696 | */ |
| | 3697 | if ( is_numeric( $slug ) && apply_filters( 'wp_unique_post_slug_numeric_slugs', false, $slug, $post_type ) !== true ) { |
| | 3698 | /** |
| | 3699 | * Filter the prefix for numeric slugs. |
| | 3700 | * |
| | 3701 | * Prefixes numeric slugs so they do not collide with dates in some permalink structures. |
| | 3702 | * The default prefix is the value of `$post_type` with a hyphen attached to the end. |
| | 3703 | * For example, if the current post type is 'post', the default value will be 'post-'. |
| | 3704 | * |
| | 3705 | * @since 4.2.0 |
| | 3706 | * |
| | 3707 | * @param string $slug_prefix The numeric slug prefix. |
| | 3708 | * @param string $slug The post slug. |
| | 3709 | * @param int $post_ID Post ID. |
| | 3710 | * @param string $post_status The post status. |
| | 3711 | * @param string $post_type Post type. |
| | 3712 | * @param int $post_parent Post parent ID |
| | 3713 | * @param string $original_slug The original post slug. |
| | 3714 | */ |
| | 3715 | $slug_prefix = apply_filters( 'wp_unique_post_slug_numeric_slug_prefix', $post_type . '-', $slug, $post_ID, $post_status, $post_type, $post_parent, $original_slug ); |
| | 3716 | |
| | 3717 | $slug = $slug_prefix . $slug; |
| | 3718 | } |
| | 3719 | |