diff --git a/inc/functions/posts.php b/inc/functions/posts.php index 99d91d3d27..04b274127d 100755 --- a/inc/functions/posts.php +++ b/inc/functions/posts.php @@ -241,6 +241,14 @@ function rocket_url_to_postid( string $url ) { $query['post_status'] = [ 'publish', 'private' ]; + /** + * Filters WP_Query class passed args. + * + * @param array $query WP_Query passed args. + * @param string $url The URL to derive the post ID from. + */ + $query = (array) apply_filters( 'rocket_url_to_postid_query_args', $query, $url ); + // Do the query. $query = new WP_Query( $query ); if ( ! empty( $query->posts ) && $query->is_singular ) {