Skip to content

Instantly share code, notes, and snippets.

@michael-sumner
Created August 18, 2023 14:34
Show Gist options
  • Save michael-sumner/e350c5559f37456af7d10e6cecc2253b to your computer and use it in GitHub Desktop.
Save michael-sumner/e350c5559f37456af7d10e6cecc2253b to your computer and use it in GitHub Desktop.
<?php
// List down all the functions assigned to the "the_content" filter hook.
function get_the_content_filters() {
$filters = array();
ob_start();
the_content();
$output = ob_get_clean();
global $wp_filter;
if ( isset( $wp_filter['the_content'] ) ) {
foreach ( $wp_filter['the_content'] as $priority => $callbacks ) {
foreach ( $callbacks as $callback ) {
$filters[] = $callback['function'];
}
}
}
return $filters;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment