添加到您的函数中。php文件,但使用后不要忘记将其取下!!!!!
function update_all_posts() {
$args = array(
\'post_type\' => \'post\',
\'numberposts\' => -1
);
$all_posts = get_posts($args);
foreach ($all_posts as $single_post){
$single_post->post_title = $single_post->post_title.\'\';
wp_update_post( $single_post );
}
}
add_action( \'wp_loaded\', \'update_all_posts\' );
PS:请确保在执行之前进行数据库备份!!!