handling post-container in build_page_chapter_index
This commit is contained in:
parent
117aab7ef0
commit
b22c9e3a1e
|
|
@ -202,10 +202,20 @@ function build_page_chapter_index($blocks)
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($block['blockName'] == 'homegrade-content-blocks/questions-container') {
|
if ($block['blockName'] == 'homegrade-content-blocks/post-content-container') {
|
||||||
|
$anchor = isset($block['attrs']['anchor']) ? esc_html($block['attrs']['anchor']) : "post-content-container-" . $block['attrs']['relatedPostId'];
|
||||||
array_push($chapterBlockIndex, [
|
array_push($chapterBlockIndex, [
|
||||||
'block-type' => $block['blockName'],
|
'block-type' => $block['blockName'],
|
||||||
'anchor' => '#questions-container-' . $block['attrs']['relatedPostId'],
|
'anchor' => "#" . $anchor,
|
||||||
|
'title' => get_the_title($block['attrs']['relatedPostId']),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
if ($block['blockName'] == 'homegrade-content-blocks/questions-container') {
|
||||||
|
$anchor = isset($block['attrs']['anchor']) ? esc_html($block['attrs']['anchor']) : "questions-container-" . $block['attrs']['relatedPostId'];
|
||||||
|
|
||||||
|
array_push($chapterBlockIndex, [
|
||||||
|
'block-type' => $block['blockName'],
|
||||||
|
'anchor' => '#' . $anchor,
|
||||||
'title' => get_the_title($block['attrs']['relatedPostId']),
|
'title' => get_the_title($block['attrs']['relatedPostId']),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user