- Rename `opdavies_blog` to `blog`. - Rename `opdavies_blog_test` to `blog_test`. - Rename `opdavies_talks` to `talks`. - Rename `opdavies_talks_test` to `talks_test`. The files within the directories haven't changed, so there is no breaking change caused by renaming the directories. Please enter the commit message for your changes. Lines starting
17 lines
362 B
Text
17 lines
362 B
Text
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use Drupal\opdavies_blog\Repository\PostRepository;
|
|
|
|
/**
|
|
* Mark existing blog posts as sent to social media.
|
|
*/
|
|
function opdavies_blog_update_8001(): void {
|
|
$posts = \Drupal::service(PostRepository::class)->getAll();
|
|
|
|
foreach ($posts as $post) {
|
|
$post->set('field_sent_to_social_media', TRUE);
|
|
$post->save();
|
|
}
|
|
}
|