diff --git a/src/wp-includes/post-template.php b/src/wp-includes/post-template.php
index 6ddc4b3..122f019 100644
--- a/src/wp-includes/post-template.php
+++ b/src/wp-includes/post-template.php
@@ -445,6 +445,27 @@ function post_class( $class = '', $post_id = null ) {
  * @return array Array of classes.
  */
 function get_post_class( $class = '', $post_id = null ) {
+	/**
+	 * Filters the get_post_class result before any Database requests are made.
+	 *
+	 * This allows one to short-circuit the default logic, perhaps by
+	 * replacing it with a routine that is more optimal for your setup.
+	 *
+	 * Passing a non-null value to the filter will effectively short-circuit retrieval,
+	 * returning the passed value instead.
+	 *
+	 * @since 4.6
+	 *
+	 * @param null|string $result  The UNSANITIZED (and potentially unsafe) Classes that should be used for this post. Default null.
+	 * @param string      $class   The UNSANITIZED (and potentially unsafe) Classes that were provided to the get_post_class initially.
+	 * @param int|WP_Post $post_id Optional. Post ID or post object.
+	 */
+	$pre = apply_filters( 'pre_post_class', null, $class, $post_id );
+
+	if ( null !== $pre ) {
+		return $pre;
+	}
+
 	$post = get_post( $post_id );
 
 	$classes = array();
