Skip to content

Commit

Permalink
KAD-1909 fix deprecated: Creation of dynamic property DOMElement::$in…
Browse files Browse the repository at this point in the history
…clude
  • Loading branch information
gilbert-hernandez committed Aug 28, 2024
1 parent 0cf0e7b commit a2a0f04
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions includes/class-kadence-blocks-table-of-contents.php
Original file line number Diff line number Diff line change
Expand Up @@ -564,12 +564,16 @@ function ( $heading ) use ( $headings_page, $current_page ) {
$heading->textContent = $heading->getAttribute( 'data-alt-title' );
}

$headingWrapper = [
'element' => $heading,
'include' => ''
];
if( $heading->getAttribute( 'data-toc-include' ) === 'true' ){
$heading->include = true;
$headingWrapper['include'] = true;
} else if ( $heading->getAttribute( 'data-toc-include' ) === 'false' ) {
$heading->include = false;
$headingWrapper['include'] = false;
} else {
$heading->include = '';
$headingWrapper['include'] = '';
}

if ( $anchor_string ) {
Expand All @@ -584,7 +588,7 @@ function ( $heading ) use ( $headings_page, $current_page ) {
'anchor' => $anchor_string,
'content' => $this->convert_smart_quotes( $heading->textContent ),
'level' => $level,
'include' => $heading->include,
'include' => $headingWrapper['include'],
'page' => $headings_page,
);
}
Expand All @@ -593,7 +597,7 @@ function ( $heading ) use ( $headings_page, $current_page ) {
'anchor' => $anchor,
'content' => $this->convert_smart_quotes( $heading->textContent ),
'level' => $level,
'include' => $heading->include,
'include' => $headingWrapper['include'],
'page' => $headings_page,
);
},
Expand Down

0 comments on commit a2a0f04

Please sign in to comment.