Front-End Editing and Permalinks

By Perchpole - August 14, 2014

Greg -

I added this to save.php to create the new page name:

$_REQUEST['permalink']  = $colsToValues['permalink']."-".$newRecordNum;

Then, if the user edits the page, I added this to edit.php:

$string = strtolower($_REQUEST['name']);
$string = preg_replace("/[^a-z0-9_\s-]/", "", $string);
$string = preg_replace("/[\s-]+/", " ", $string);
$_REQUEST['permalink'] = preg_replace("/[\s_]/", "-", $string);

Works really well!

Thanks for your help,

:0D

Perchpole