wpseek.com
WordPress开发者和主题制作者的搜索引擎
wp_add_trashed_suffix_to_post_name_for_trashed_posts is private and should not be used in themes or plugins directly.
wp_add_trashed_suffix_to_post_name_for_trashed_posts › WordPress Function
Since4.5.0
已弃用n/a
› wp_add_trashed_suffix_to_post_name_for_trashed_posts ( $post_name, $post_id = 0 )
访问: |
|
参数: (2) |
|
定义在: |
|
文档: |
Adds a suffix if any trashed posts have a given slug.
Store its desired (i.e. current) slug so it can try to reclaim it if the post is untrashed. For internal use.源码
function wp_add_trashed_suffix_to_post_name_for_trashed_posts( $post_name, $post_id = 0 ) { $trashed_posts_with_desired_slug = get_posts( array( 'name' => $post_name, 'post_status' => 'trash', 'post_type' => 'any', 'nopaging' => true, 'post__not_in' => array( $post_id ), ) ); if ( ! empty( $trashed_posts_with_desired_slug ) ) { foreach ( $trashed_posts_with_desired_slug as $_post ) { wp_add_trashed_suffix_to_post_name_for_post( $_post ); } } }