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
|
b
|
function _add_post_type_submenus() { |
| 1779 | 1779 | * feature strings or a single string. |
| 1780 | 1780 | * @param mixed ...$args Optional extra arguments to pass along with certain features. |
| 1781 | 1781 | */ |
| 1782 | | function add_post_type_support( $post_type, $feature ) { |
| | 1782 | function add_post_type_support( $post_type, $feature, ...$args ) { |
| 1783 | 1783 | global $_wp_post_type_features; |
| 1784 | 1784 | |
| 1785 | 1785 | $features = (array) $feature; |
| … |
… |
function add_post_type_support( $post_type, $feature ) { |
| 1787 | 1787 | if ( func_num_args() == 2 ) { |
| 1788 | 1788 | $_wp_post_type_features[ $post_type ][ $feature ] = true; |
| 1789 | 1789 | } else { |
| 1790 | | $_wp_post_type_features[ $post_type ][ $feature ] = array_slice( func_get_args(), 2 ); |
| | 1790 | $_wp_post_type_features[ $post_type ][ $feature ] = $args; |
| 1791 | 1791 | } |
| 1792 | 1792 | } |
| 1793 | 1793 | } |