get parent type for the child

This commit is contained in:
Diego Najar 2019-05-10 20:03:05 +02:00
parent 1f1cd4e3ec
commit ec7769251b

View File

@ -81,7 +81,11 @@ class Pages extends dbJSON {
// Parent
// This variable is not belong to the database so is not defined in $row
$parent = (empty($args['parent'])?'':$args['parent']);
$parent = '';
if (!empty($args['parent'])) {
$parent = $args['parent'];
$row['type'] = $this->db[$parent]['type']; // get the parent type
}
// Slug from the title or the content
// This variable is not belong to the database so is not defined in $row
@ -177,7 +181,11 @@ class Pages extends dbJSON {
// Parent
// This variable is not belong to the database so is not defined in $row
$parent = (empty($args['parent'])?'':$args['parent']);
$parent = '';
if (!empty($args['parent'])) {
$parent = $args['parent'];
$row['type'] = $this->db[$parent]['type']; // get the parent type
}
// Slug
// If the user change the slug the page key changes