9.7. Shortcodes aus einem Inhalt entfernen

Shortcodes lassen sich auch direkt erkennen und aus Inhalten entfernen. Dafür stellt Ihnen WordPress folgende Funktion bereit:

<?php
function strip_shortcodes( $content ) {
	...
}
?>

Es gilt:

  • $content (string)
    Der Inhalt dessen Shortcodes entfernt werden sollen.

Zurückgegeben wird der Inhalt $content, allerdings ohne Shortcodes.

Beispiel

You’re not allowed to see this content. Please log in first.