Rename and re-organise custom modules
- Rename `opd_talks` to `opdavies_talks` - Rename `custom` to `opdavies_blog`
This commit is contained in:
parent
e4e898f22c
commit
9b1a8fb3be
53 changed files with 125 additions and 116 deletions
17
web/modules/custom/opdavies_blog/opdavies_blog.install
Normal file
17
web/modules/custom/opdavies_blog/opdavies_blog.install
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?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();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue