mirror of https://github.com/cncf/cncf.io.git
import duplicates in a deliberate way
Signed-off-by: Chris Abraham <cjyabraham@gmail.com>
This commit is contained in:
parent
a90908c4bf
commit
1414639ef2
|
|
@ -76,8 +76,8 @@ if ( ! $people ) {
|
|||
|
||||
$synced_ids = array();
|
||||
|
||||
$i = 1;
|
||||
foreach ( $people as $p ) {
|
||||
for ( $i = 0; $i < 3; $i++ ) {
|
||||
$params = array(
|
||||
'post_type' => 'lf_person',
|
||||
'post_title' => $p->name . $i,
|
||||
|
|
@ -201,21 +201,20 @@ foreach ( $people as $p ) {
|
|||
|
||||
$synced_ids[] = $newid;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// delete any People posts which aren't in $synced_ids.
|
||||
$query = new WP_Query(
|
||||
array(
|
||||
'post_type' => 'lf_person',
|
||||
'post__not_in' => $synced_ids,
|
||||
'posts_per_page' => -1,
|
||||
)
|
||||
);
|
||||
while ( $query->have_posts() ) {
|
||||
$query->the_post();
|
||||
wp_delete_post( get_the_id() );
|
||||
}
|
||||
// $query = new WP_Query(
|
||||
// array(
|
||||
// 'post_type' => 'lf_person',
|
||||
// 'post__not_in' => $synced_ids,
|
||||
// 'posts_per_page' => -1,
|
||||
// )
|
||||
// );
|
||||
// while ( $query->have_posts() ) {
|
||||
// $query->the_post();
|
||||
// wp_delete_post( get_the_id() );
|
||||
// }
|
||||
|
||||
// clear the site cache.
|
||||
if ( function_exists( 'pantheon_wp_clear_edge_all' ) ) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue