Last active
October 23, 2019 13:01
-
-
Save hissy/b6cf3ac6279d55c5dbb0a62ae7ca2786 to your computer and use it in GitHub Desktop.
#concrete5 c5:exec command to bulk clear page paths for all pages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$list = new \Concrete\Core\Page\PageList(); | |
$list->ignorePermissions(); | |
$pages = $list->getResults(); | |
$count = 0; | |
/** @var \Concrete\Core\Page\Page $page */ | |
foreach ($pages as $page) { | |
$paths = $page->getAdditionalPagePaths(); | |
if (count($paths) > 0) { | |
$page->clearPagePaths(); | |
$page->rescanCollectionPath(); | |
} | |
++$count; | |
} | |
echo sprintf('%d pages rescanned.', $count); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment