The user needs to update the 'book-url' custom field value for all posts of the 'book' post type without having to edit each post individually.
Solution:
You can use a code like this:
function update_book_urls($post_type, $url) {
// Get all posts of the 'book' post type
$args = array(
'post_type' => $post_type,
'posts_per_page' => -1,
);
$book_posts = get_posts( $args );
// Loop through each post and update the 'book-url' custom field
foreach ( $book_posts as $post ) {
update_post_meta( $post->ID, 'wpcf-saas-deal-link', $url );
}
}
update_book_urls('saas', 'https://book.com');