Make WordPress Core

Ticket #40413: ticket-40413.patch

File ticket-40413.patch, 1.1 KB (added by MaximeCulea, 8 years ago)

Patch 40413-1

  • src/wp-includes/class-wp-post-type.php

    From 500c96aa41bdb63e38cb4949d835201a798f5333 Mon Sep 17 00:00:00 2001
    From: Maxime Culea <culea.maxime@gmail.com>
    Date: Tue, 11 Apr 2017 12:57:27 +0200
    Subject: [PATCH] #40413 : Fix the call of add_post_type_support with the 3 arg
     as features.
    
    ---
     src/wp-includes/class-wp-post-type.php | 8 +++++++-
     1 file changed, 7 insertions(+), 1 deletion(-)
    
    diff --git a/src/wp-includes/class-wp-post-type.php b/src/wp-includes/class-wp-post-type.php
    index 69b9834..fa885bb 100644
    a b final class WP_Post_Type { 
    546546         */
    547547        public function add_supports() {
    548548                if ( ! empty( $this->supports ) ) {
    549                         add_post_type_support( $this->name, $this->supports );
     549                        foreach ( $this->supports as $support => $features ) {
     550                                if ( is_array( $features ) ) {
     551                                        add_post_type_support( $this->name, $support, $features );
     552                                } else {
     553                                        add_post_type_support( $this->name, $features );
     554                                }
     555                        }
    550556                        unset( $this->supports );
    551557                } elseif ( false !== $this->supports ) {
    552558                        // Add default features.