From 3801973cc307b92f316c1f7b08ee30c8cb38e3ab Mon Sep 17 00:00:00 2001
From: jrfnl <jrfnl@users.noreply.github.com>
Date: Thu, 11 Jul 2019 12:01:14 +0200
Subject: [PATCH] Simplify & modernize add_post_type_support()

---
 src/wp-includes/post.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php
index 0f76da8cb1..1c2ae8b040 100644
--- a/src/wp-includes/post.php
+++ b/src/wp-includes/post.php
@@ -1779,7 +1779,7 @@ function _add_post_type_submenus() {
  *                                feature strings or a single string.
  * @param mixed        ...$args   Optional extra arguments to pass along with certain features.
  */
-function add_post_type_support( $post_type, $feature ) {
+function add_post_type_support( $post_type, $feature, ...$args ) {
 	global $_wp_post_type_features;
 
 	$features = (array) $feature;
@@ -1787,7 +1787,7 @@ function add_post_type_support( $post_type, $feature ) {
 		if ( func_num_args() == 2 ) {
 			$_wp_post_type_features[ $post_type ][ $feature ] = true;
 		} else {
-			$_wp_post_type_features[ $post_type ][ $feature ] = array_slice( func_get_args(), 2 );
+			$_wp_post_type_features[ $post_type ][ $feature ] = $args;
 		}
 	}
 }
-- 
2.21.0.windows.1

