Index: src/wp-includes/plugin.php
===================================================================
--- src/wp-includes/plugin.php	(revision 36219)
+++ src/wp-includes/plugin.php	(working copy)
@@ -422,6 +422,26 @@
 }
 
 /**
+ * Retrieve the number of times a filter has been applied.
+ *
+ * @since x.x
+ *
+ * @global array $wp_filter Stores all of the filters.
+ *
+ * @param string $tag The name of the filter hook.
+ * @return int The number of times filter $tag has been applied.
+ */
+function did_filter( $tag = '' ) {
+    global $wp_filter;
+
+    if ( ! isset( $wp_filter[ $tag ] ) ) {
+        return 0;
+    }
+
+    return $wp_filter[ $tag ];
+}
+
+/**
  * Retrieve the name of an action currently being processed.
  *
  * @since 3.9.0
