Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

Shortcodes in Headings

$
0
0

Replies: 0

Hi there,

hopes that will help others.

i have on my page Genie 580 XCD Aktenvernichter a heading with a shortcode “Bedienungsanleitung [product_title]”

It was shown in the TOC+ Widget as “Bedienungsanleitung [product_title]”.

I change the function build_hierarchy in the class-toc-plus.php around line 1245

$html .= strip_tags( $matches[ $i ][0] ) . '</a>';
to
$html .= do_shortcode(strip_tags( $matches[ $i ][0] )) . '</a>';

to Show the title with dissolved shortcode
and the function url_anchor_target in the class-toc-plus.php around line 1143

From


			if ( $title ) {
				$return = trim( strip_tags( $title ) );

To


			if ( $title ) {
				$title = do_shortcode($title);
				$return = trim( strip_tags( $title ) );

To get the dissolved Heading in the Anchor text.

  • This topic was modified 21 minutes ago by omegafw.

Viewing all articles
Browse latest Browse all 59525

Trending Articles