Allow setting URL slug through admin panel.
This commit is contained in:
@@ -33,10 +33,11 @@ class EditAsset extends HTMLController
|
||||
}
|
||||
|
||||
// Key info
|
||||
if (isset($_POST['title'], $_POST['date_captured'], $_POST['priority']))
|
||||
if (isset($_POST['title'], $_POST['slug'], $_POST['date_captured'], $_POST['priority']))
|
||||
{
|
||||
$date_captured = !empty($_POST['date_captured']) ? new DateTime($_POST['date_captured']) : null;
|
||||
$asset->setKeyData(htmlentities($_POST['title']), $date_captured, intval($_POST['priority']));
|
||||
$slug = strtr($_POST['slug'], [' ' => '-', '--' => '-', '&' => 'and', '=>' => '', "'" => "", ":"=> "", '\\' => '-']);
|
||||
$asset->setKeyData(htmlentities($_POST['title']), $slug, $date_captured, intval($_POST['priority']));
|
||||
}
|
||||
|
||||
// Handle tags
|
||||
|
||||
Reference in New Issue
Block a user