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
1 changed files with 10 additions and 2 deletions

View File

@ -81,7 +81,11 @@ class Pages extends dbJSON {
// Parent // Parent
// This variable is not belong to the database so is not defined in $row // 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 // Slug from the title or the content
// This variable is not belong to the database so is not defined in $row // This variable is not belong to the database so is not defined in $row
@ -177,7 +181,11 @@ class Pages extends dbJSON {
// Parent // Parent
// This variable is not belong to the database so is not defined in $row // 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 // Slug
// If the user change the slug the page key changes // If the user change the slug the page key changes