From 27298cd802e59cdd113ac900bd2dfe1b30711e68 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 15 Mar 2013 18:28:33 +0000 Subject: [PATCH] Remove redundant code from post_type_supports() and remove_post_type_support(). props obenland, bilalcoder. fixes #21527. git-svn-id: http://core.svn.wordpress.org/trunk@23722 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/post.php | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/wp-includes/post.php b/wp-includes/post.php index 494e58673e..d32a1cd4ad 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -1529,11 +1529,8 @@ function add_post_type_support( $post_type, $feature ) { function remove_post_type_support( $post_type, $feature ) { global $_wp_post_type_features; - if ( !isset($_wp_post_type_features[$post_type]) ) - return; - - if ( isset($_wp_post_type_features[$post_type][$feature]) ) - unset($_wp_post_type_features[$post_type][$feature]); + if ( isset( $_wp_post_type_features[$post_type][$feature] ) ) + unset( $_wp_post_type_features[$post_type][$feature] ); } /** @@ -1565,17 +1562,7 @@ function get_all_post_type_supports( $post_type ) { function post_type_supports( $post_type, $feature ) { global $_wp_post_type_features; - if ( !isset( $_wp_post_type_features[$post_type][$feature] ) ) - return false; - - // If no args passed then no extra checks need be performed - if ( func_num_args() <= 2 ) - return true; - - // @todo Allow pluggable arg checking - //$args = array_slice( func_get_args(), 2 ); - - return true; + return ( isset( $_wp_post_type_features[$post_type][$feature] ) ); } /**